From baad4bd37f7b2a49d230b6ca09d3b92c233ba8c1 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 4 Sep 2020 15:31:27 +0200 Subject: [PATCH] hookup megolm decryption in session --- src/matrix/Session.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/matrix/Session.js b/src/matrix/Session.js index c3429075..d48e0d00 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -49,6 +49,9 @@ export class Session { this._e2eeAccount = null; this._deviceTracker = null; this._olmEncryption = null; + this._megolmEncryption = null; + this._megolmDecryption = null; + if (olm) { this._olmUtil = new olm.Utility(); this._deviceTracker = new DeviceTracker({ @@ -92,9 +95,12 @@ export class Session { storage: this._storage, now: this._clock.now, ownDeviceId: this._sessionInfo.deviceId, - }) - const megolmDecryption = new MegOlmDecryption({pickleKey: PICKLE_KEY, olm: this._olm}); - this._deviceMessageHandler.enableEncryption({olmDecryption, megolmDecryption}); + }); + this._megolmDecryption = new MegOlmDecryption({ + pickleKey: PICKLE_KEY, + olm: this._olm, + }); + this._deviceMessageHandler.enableEncryption({olmDecryption, megolmDecryption: this._megolmDecryption}); } _createRoomEncryption(room, encryptionParams) { @@ -118,6 +124,7 @@ export class Session { deviceTracker: this._deviceTracker, olmEncryption: this._olmEncryption, megolmEncryption: this._megolmEncryption, + megolmDecryption: this._megolmDecryption, encryptionParams }); }