From 1d4a5cd6d4f52a2547d6abeaf1cbf10a63636729 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Sep 2020 15:32:08 +0200 Subject: [PATCH] instantiate olm encryption in session --- src/matrix/Session.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 6929430f..1e3f8382 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -21,6 +21,7 @@ import {User} from "./User.js"; import {Account as E2EEAccount} from "./e2ee/Account.js"; import {DeviceMessageHandler} from "./DeviceMessageHandler.js"; import {Decryption as OlmDecryption} from "./e2ee/olm/Decryption.js"; +import {Encryption as OlmEncryption} from "./e2ee/olm/Encryption.js"; import {Decryption as MegOlmDecryption} from "./e2ee/megolm/Decryption.js"; import {DeviceTracker} from "./e2ee/DeviceTracker.js"; import {LockMap} from "../utils/LockMap.js"; @@ -44,6 +45,7 @@ export class Session { this._olmUtil = null; this._e2eeAccount = null; this._deviceTracker = null; + this._olmEncryption = null; if (olm) { this._olmUtil = new olm.Utility(); this._deviceTracker = new DeviceTracker({ @@ -68,6 +70,16 @@ export class Session { olm: this._olm, senderKeyLock }); + this._olmEncryption = new OlmEncryption({ + account: this._e2eeAccount, + pickleKey: PICKLE_KEY, + now: this._clock.now, + ownUserId: this._user.id, + storage: this._storage, + olm: this._olm, + olmUtil: this._olmUtil, + senderKeyLock + }); const megolmDecryption = new MegOlmDecryption({pickleKey: PICKLE_KEY, olm: this._olm}); this._deviceMessageHandler.enableEncryption({olmDecryption, megolmDecryption}); }