From b293ef067442c157b39760fb7506b6fcf3c770b7 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 14 Aug 2020 13:01:43 +0100 Subject: [PATCH] Check for .well-known E2EE settings under new key This adds an extra check for `.well-known` E2EE settings under the key `im.vector.e2ee`. The older key `im.vector.riot.e2ee` is kept for historical compatibility. Part of https://github.com/vector-im/element-web/issues/14954 --- src/createRoom.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/createRoom.ts b/src/createRoom.ts index 23a664a4c4..b9f30476e4 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -27,7 +27,8 @@ import * as Rooms from "./Rooms"; import DMRoomMap from "./utils/DMRoomMap"; import {getAddressType} from "./UserAddress"; -const E2EE_WK_KEY = "im.vector.riot.e2ee"; +const E2EE_WK_KEY = "im.vector.e2ee"; +const E2EE_WK_KEY_DEPRECATED = "im.vector.riot.e2ee"; // we define a number of interfaces which take their names from the js-sdk /* eslint-disable camelcase */ @@ -300,6 +301,10 @@ export function privateShouldBeEncrypted() { const defaultDisabled = clientWellKnown[E2EE_WK_KEY]["default"] === false; return !defaultDisabled; } + if (clientWellKnown && clientWellKnown[E2EE_WK_KEY_DEPRECATED]) { + const defaultDisabled = clientWellKnown[E2EE_WK_KEY_DEPRECATED]["default"] === false; + return !defaultDisabled; + } return true; }