From 5dd5668389c564800d892c0736517d9a0cc1dfcd Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 4 Jul 2022 20:10:13 +0100 Subject: [PATCH 1/3] Add config param to disable e2e for signalling --- src/matrix-utils.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index b76e9137..0a3a3be8 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -14,6 +14,7 @@ import { GroupCallType, } from "matrix-js-sdk/src/webrtc/groupCall"; import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; +import { logger } from "matrix-js-sdk/src/logger"; import IndexedDBWorker from "./IndexedDBWorker?worker"; @@ -79,6 +80,19 @@ export async function initClient( storeOpts.cryptoStore = new MemoryCryptoStore(); } + // XXX: we read from the URL search params in RoomPage too: + // it would be much better to read them in one place and pass + // the values around, but we initialise the matrix client in + // many different places so we'd have to pass it into all of + // them. + const params = new URLSearchParams(window.location.search); + // disable e2e only if enableE2e=false is given + const enableE2e = !(params.get("enableE2e") === "false"); + + if (!enableE2e) { + logger.info("Disabling E2E: group call signalling will NOT be encrypted."); + } + const client = createClient({ ...storeOpts, ...clientOptions, @@ -86,6 +100,7 @@ export async function initClient( // Use a relatively low timeout for API calls: this is a realtime application // so we don't want API calls taking ages, we'd rather they just fail. localTimeoutMs: 5000, + useE2eForGroupCall: enableE2e, }); try { From 6b03ae0dc31ab473bd48a7ce62d612d946c54828 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 4 Jul 2022 20:32:20 +0100 Subject: [PATCH 2/3] Use the traditional syntax for not-equals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Šimon Brandner --- src/matrix-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index 0a3a3be8..1a1a2ea6 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -87,7 +87,7 @@ export async function initClient( // them. const params = new URLSearchParams(window.location.search); // disable e2e only if enableE2e=false is given - const enableE2e = !(params.get("enableE2e") === "false"); + const enableE2e = params.get("enableE2e") !== "false"; if (!enableE2e) { logger.info("Disabling E2E: group call signalling will NOT be encrypted."); From e310392800478398747eb8f9b1c00c295d0a55cb Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 5 Jul 2022 13:19:32 +0100 Subject: [PATCH 3/3] Bump js-sdk --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 76e5796b..00b61e35 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "classnames": "^2.3.1", "color-hash": "^2.0.1", "events": "^3.3.0", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#e980c889016b48268031b22735e70b7f618e219c", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#9a15094374f52053ca9f833269d2b1c6c7f964d2", "mermaid": "^8.13.8", "normalize.css": "^8.0.1", "pako": "^2.0.4", diff --git a/yarn.lock b/yarn.lock index 269f7970..76ed2dba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8602,9 +8602,9 @@ matrix-events-sdk@^0.0.1-beta.7: resolved "https://registry.yarnpkg.com/matrix-events-sdk/-/matrix-events-sdk-0.0.1-beta.7.tgz#5ffe45eba1f67cc8d7c2377736c728b322524934" integrity sha512-9jl4wtWanUFSy2sr2lCjErN/oC8KTAtaeaozJtrgot1JiQcEI4Rda9OLgQ7nLKaqb4Z/QUx/fR3XpDzm5Jy1JA== -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#e980c889016b48268031b22735e70b7f618e219c": +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#9a15094374f52053ca9f833269d2b1c6c7f964d2": version "18.1.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/e980c889016b48268031b22735e70b7f618e219c" + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/9a15094374f52053ca9f833269d2b1c6c7f964d2" dependencies: "@babel/runtime" "^7.12.5" "@types/sdp-transform" "^2.4.5"