From 28b46a1e5bcb9b81afe0774f0bc7c70edbb9e722 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 4 Sep 2020 12:10:28 +0200 Subject: [PATCH] add some comments --- src/matrix/e2ee/megolm/Encryption.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/matrix/e2ee/megolm/Encryption.js b/src/matrix/e2ee/megolm/Encryption.js index e39280ea..9849ce55 100644 --- a/src/matrix/e2ee/megolm/Encryption.js +++ b/src/matrix/e2ee/megolm/Encryption.js @@ -36,6 +36,7 @@ export class Encryption { let roomKeyMessage; let encryptedContent; try { + // TODO: we could consider keeping the session in memory for the current room let sessionEntry = await txn.outboundGroupSessions.get(roomId); if (sessionEntry) { session.unpickle(this._pickleKey, sessionEntry.session); @@ -114,6 +115,11 @@ export class Encryption { session_id: session.session_id(), session_key: session.session_key(), algorithm: MEGOLM_ALGORITHM, + // if we need to do this, do we need to create + // the room key message after or before having encrypted + // with the new session? I guess before as we do now + // because the chain_index is where you should start decrypting? + // // chain_index: session.message_index() } }