mirror of https://github.com/vector-im/riot-web
move e2ee-default switch to well-known from config.json
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
cbc2aee746
commit
3f72a590f5
|
@ -23,8 +23,8 @@ import dis from "./dispatcher/dispatcher";
|
|||
import * as Rooms from "./Rooms";
|
||||
import DMRoomMap from "./utils/DMRoomMap";
|
||||
import {getAddressType} from "./UserAddress";
|
||||
import SettingsStore from "./settings/SettingsStore";
|
||||
import SdkConfig from "./SdkConfig";
|
||||
|
||||
const E2EE_WK_KEY = "im.vector.riot.e2ee";
|
||||
|
||||
/**
|
||||
* Create a new room, and switch to it.
|
||||
|
@ -238,5 +238,11 @@ export async function ensureDMExists(client, userId) {
|
|||
}
|
||||
|
||||
export function privateShouldBeEncrypted() {
|
||||
return SettingsStore.getValue("feature_cross_signing") && SdkConfig.get().e2ee_default_for_private_rooms !== false;
|
||||
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
|
||||
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY]) {
|
||||
const defaultDisabled = clientWellKnown[E2EE_WK_KEY]["default"] === false;
|
||||
return !defaultDisabled;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue