From 3ab5a7222160551e9143a7182f374d462633677f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 28 Aug 2020 13:52:27 +0200 Subject: [PATCH] give e2ee account values a prefix so we can prevent from clearing them --- src/matrix/e2ee/Account.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/matrix/e2ee/Account.js b/src/matrix/e2ee/Account.js index 829e7595..f53532f1 100644 --- a/src/matrix/e2ee/Account.js +++ b/src/matrix/e2ee/Account.js @@ -16,8 +16,10 @@ limitations under the License. import anotherjson from "../../../lib/another-json/index.js"; -const ACCOUNT_SESSION_KEY = "olmAccount"; -const DEVICE_KEY_FLAG_SESSION_KEY = "areDeviceKeysUploaded"; +// use common prefix so it's easy to clear properties that are not e2ee related during session clear +export const SESSION_KEY_PREFIX = "e2ee:"; +const ACCOUNT_SESSION_KEY = SESSION_KEY_PREFIX + "olmAccount"; +const DEVICE_KEY_FLAG_SESSION_KEY = SESSION_KEY_PREFIX + "areDeviceKeysUploaded"; const OLM_ALGORITHM = "m.olm.v1.curve25519-aes-sha2"; const MEGOLM_ALGORITHM = "m.megolm.v1.aes-sha2";