From 955fb747c29eab76b17eb9a13ebc15026e917fb8 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Wed, 28 Oct 2020 11:27:36 +0100 Subject: [PATCH] fix: Only look at online keybackup for automated requests --- lib/encryption/key_manager.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/encryption/key_manager.dart b/lib/encryption/key_manager.dart index 8ca7b36..2b4da5d 100644 --- a/lib/encryption/key_manager.dart +++ b/lib/encryption/key_manager.dart @@ -215,7 +215,7 @@ class KeyManager { // do e2ee recovery _requestedSessionIds.add(requestIdent); unawaited(runInRoot(() => - request(room, sessionId, senderKey, askOnlyOwnDevices: true))); + request(room, sessionId, senderKey, onlineKeyBackupOnly: true))); } return null; } @@ -544,7 +544,7 @@ class KeyManager { String sessionId, String senderKey, { bool tryOnlineBackup = true, - bool askOnlyOwnDevices = false, + bool onlineKeyBackupOnly = false, }) async { if (tryOnlineBackup && await isCached()) { // let's first check our online key backup store thingy... @@ -568,13 +568,13 @@ class KeyManager { return; // we managed to load the session from online backup, no need to care about it now } } + if (onlineKeyBackupOnly) { + return; // we only want to do the online key backup + } try { // while we just send the to-device event to '*', we still need to save the // devices themself to know where to send the cancel to after receiving a reply final devices = await room.getUserDeviceKeys(); - if (askOnlyOwnDevices) { - devices.removeWhere((d) => d.userId != client.userID); - } final requestId = client.generateUniqueTransactionId(); final request = KeyManagerKeyShareRequest( requestId: requestId,