From f4d335c161c348fe8d00ffb7e2299a0689e42e1d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 11 Feb 2020 17:42:17 +0100 Subject: [PATCH] use default methods if none are provided to the client --- src/crypto/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crypto/index.js b/src/crypto/index.js index db0fa548b..78af9b1d1 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -126,8 +126,8 @@ export function Crypto(baseApis, sessionStore, userId, deviceId, this._clientStore = clientStore; this._cryptoStore = cryptoStore; this._roomList = roomList; - this._verificationMethods = new Map(); if (verificationMethods) { + this._verificationMethods = new Map(); for (const method of verificationMethods) { if (typeof method === "string") { if (defaultVerificationMethods[method]) { @@ -145,8 +145,9 @@ export function Crypto(baseApis, sessionStore, userId, deviceId, console.warn(`Excluding unknown verification method ${method}`); } } + } else { + this._verificationMethods = defaultVerificationMethods; } - // track whether this device's megolm keys are being backed up incrementally // to the server or not. // XXX: this should probably have a single source of truth from OlmAccount