From 6cd227b82dfc88d74d55ad21e7f8ab469d8c3148 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 22 Sep 2020 09:30:25 +0200 Subject: [PATCH] only prompt after waiting 10s for sync UTD --- src/matrix/e2ee/RoomEncryption.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/matrix/e2ee/RoomEncryption.js b/src/matrix/e2ee/RoomEncryption.js index 87c64cbe..f0446f98 100644 --- a/src/matrix/e2ee/RoomEncryption.js +++ b/src/matrix/e2ee/RoomEncryption.js @@ -159,10 +159,6 @@ export class RoomEncryption { } async _requestMissingSessionFromBackup(senderKey, sessionId, source) { - if (!this._sessionBackup) { - this._notifyMissingMegolmSession(); - return; - } // if the message came from sync, wait 10s to see if the room key arrives, // and only after that proceed to request from backup if (source === DecryptionSource.Sync) { @@ -171,6 +167,11 @@ export class RoomEncryption { return; } } + // show prompt to enable secret storage + if (!this._sessionBackup) { + this._notifyMissingMegolmSession(); + return; + } try { const session = await this._sessionBackup.getSession(this._room.id, sessionId);