From fefa14075893c0c8b3218381568e4229feb0c750 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Wed, 27 Jan 2021 11:15:41 +0100 Subject: [PATCH] fix: Dont update user device keys if logged out --- lib/src/client.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index edc81510..7b8ac86a 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1442,6 +1442,7 @@ sort order of ${prevState.sortOrder}. This should never happen...'''); if (!isLogged()) return; final dbActions = Function()>[]; var trackedUserIds = await _getUserIdsInEncryptedRooms(); + if (!isLogged()) return; trackedUserIds.add(userID); // Remove all userIds we no longer need to track the devices of. @@ -1466,8 +1467,8 @@ sort order of ${prevState.sortOrder}. This should never happen...'''); if (outdatedLists.isNotEmpty) { // Request the missing device key lists from the server. - if (!isLogged()) return; final response = await requestDeviceKeys(outdatedLists, timeout: 10000); + if (!isLogged()) return; for (final rawDeviceKeyListEntry in response.deviceKeys.entries) { final userId = rawDeviceKeyListEntry.key; @@ -1619,6 +1620,7 @@ sort order of ${prevState.sortOrder}. This should never happen...'''); } if (dbActions.isNotEmpty) { + if (!isLogged()) return; await database?.transaction(() async { for (final f in dbActions) { await f();