refactor: Update SDK

This commit is contained in:
Christian Pauly 2021-05-20 13:59:55 +02:00
commit 91f52956f0
26 changed files with 57 additions and 187 deletions

View file

@ -133,7 +133,7 @@ class BackgroundPush {
}
final clientName = PlatformInfos.clientName;
oldTokens ??= <String>{};
final pushers = await client.requestPushers().catchError((e) {
final pushers = await client.getPushers().catchError((e) {
Logs().w('[Push] Unable to request pushers', e);
return <Pusher>[];
});
@ -179,7 +179,7 @@ class BackgroundPush {
oldTokens.contains(pusher.pushkey)) {
pusher.kind = null;
try {
await client.setPusher(
await client.postPusher(
pusher,
append: true,
);
@ -191,7 +191,7 @@ class BackgroundPush {
}
if (setNewPusher) {
try {
await client.setPusher(
await client.postPusher(
Pusher(
token,
thisAppId,
@ -534,7 +534,7 @@ class BackgroundPush {
try {
Logs().v(
'[Push] failed to sync for fallback push, fetching notifications endpoint...');
final notifications = await client.requestNotifications(limit: 20);
final notifications = await client.getNotifications(limit: 20);
final notificationRooms =
notifications.notifications.map((n) => n.roomId).toSet();
emptyRooms = client.rooms

View file

@ -45,8 +45,7 @@ class UrlLauncher {
// we were unable to find the room locally...so resolve it
final response = await showFutureLoadingDialog(
context: context,
future: () =>
matrix.client.requestRoomAliasInformation(roomIdOrAlias),
future: () => matrix.client.getRoomIdByAlias(roomIdOrAlias),
);
if (response.error != null) {
return; // nothing to do, the alias doesn't exist
@ -79,7 +78,7 @@ class UrlLauncher {
roomId = roomIdOrAlias;
final response = await showFutureLoadingDialog(
context: context,
future: () => matrix.client.joinRoomOrAlias(
future: () => matrix.client.joinRoom(
roomIdOrAlias,
servers: servers.isNotEmpty ? servers.toList() : null,
),