You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Move E2EE well-known access to utils
This commit is contained in:
@@ -26,9 +26,7 @@ import dis from "./dispatcher/dispatcher";
|
||||
import * as Rooms from "./Rooms";
|
||||
import DMRoomMap from "./utils/DMRoomMap";
|
||||
import {getAddressType} from "./UserAddress";
|
||||
|
||||
const E2EE_WK_KEY = "im.vector.e2ee";
|
||||
const E2EE_WK_KEY_DEPRECATED = "im.vector.riot.e2ee";
|
||||
import { getE2EEWellKnown } from "./utils/WellKnownUtils";
|
||||
|
||||
// we define a number of interfaces which take their names from the js-sdk
|
||||
/* eslint-disable camelcase */
|
||||
@@ -295,16 +293,11 @@ export async function ensureDMExists(client: MatrixClient, userId: string): Prom
|
||||
return roomId;
|
||||
}
|
||||
|
||||
export function privateShouldBeEncrypted() {
|
||||
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
|
||||
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY]) {
|
||||
const defaultDisabled = clientWellKnown[E2EE_WK_KEY]["default"] === false;
|
||||
export function privateShouldBeEncrypted(): boolean {
|
||||
const e2eeWellKnown = getE2EEWellKnown();
|
||||
if (e2eeWellKnown) {
|
||||
const defaultDisabled = e2eeWellKnown["default"] === false;
|
||||
return !defaultDisabled;
|
||||
}
|
||||
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY_DEPRECATED]) {
|
||||
const defaultDisabled = clientWellKnown[E2EE_WK_KEY_DEPRECATED]["default"] === false;
|
||||
return !defaultDisabled;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user