Add .well-known config option to force disable encryption on room creation (#11120)

* force disable encryption on room creation

* test allowChangingEncryption

* move into utils/room directory

* tests

* unit test CreateRoomDialog

* remove debug

* wait for constructor promises to settle

* test case for force_disable

* comment

* set forced value after resolving checkUserIsAllowedToChangeEncryption

* tidy and comments

* use label text in test
This commit is contained in:
Kerry 2023-06-22 09:50:01 +12:00 committed by GitHub
parent 9d9c55d92e
commit a692fe2181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 375 additions and 9 deletions

View file

@ -16,9 +16,13 @@ limitations under the License.
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { shouldForceDisableEncryption } from "./room/shouldForceDisableEncryption";
import { getE2EEWellKnown } from "./WellKnownUtils";
export function privateShouldBeEncrypted(client: MatrixClient): boolean {
if (shouldForceDisableEncryption(client)) {
return false;
}
const e2eeWellKnown = getE2EEWellKnown(client);
if (e2eeWellKnown) {
const defaultDisabled = e2eeWellKnown["default"] === false;