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
pull/21833/head
J. Ryan Stinnett 2020-08-14 13:01:43 +01:00
parent d700a5a78c
commit b293ef0674
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}