From d24be7ee552195721d694fed67d5d379a3252a72 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 28 Aug 2020 13:51:58 +0200 Subject: [PATCH] extract constants out --- src/matrix/e2ee/Account.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/matrix/e2ee/Account.js b/src/matrix/e2ee/Account.js index ef342d49..829e7595 100644 --- a/src/matrix/e2ee/Account.js +++ b/src/matrix/e2ee/Account.js @@ -18,6 +18,8 @@ import anotherjson from "../../../lib/another-json/index.js"; const ACCOUNT_SESSION_KEY = "olmAccount"; const DEVICE_KEY_FLAG_SESSION_KEY = "areDeviceKeysUploaded"; +const OLM_ALGORITHM = "m.olm.v1.curve25519-aes-sha2"; +const MEGOLM_ALGORITHM = "m.megolm.v1.aes-sha2"; export class Account { static async load({olm, pickleKey, hsApi, userId, deviceId, txn}) { @@ -84,10 +86,7 @@ export class Account { const obj = { user_id: this._userId, device_id: this._deviceId, - algorithms: [ - "m.olm.v1.curve25519-aes-sha2", - "m.megolm.v1.aes-sha2" - ], + algorithms: [OLM_ALGORITHM, MEGOLM_ALGORITHM], keys: {} }; for (const [algorithm, pubKey] of Object.entries(identityKeys)) {