From fb4d20410a049b3b7cde3432ff1371b45708c546 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Tue, 26 Oct 2021 16:25:34 -0700 Subject: [PATCH] Encrypt voip events with Olm --- index.html | 32 +++++++++++++++++-------------- package.json | 1 + src/ConferenceCallManagerHooks.js | 5 ++++- yarn.lock | 4 ++++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 72c59a78..a9b839dd 100644 --- a/index.html +++ b/index.html @@ -1,16 +1,20 @@ - - - - - Matrix Video Chat - - - -
- - - + + + + + + Matrix Video Chat + + + + +
+ + + + + \ No newline at end of file diff --git a/package.json b/package.json index b760eb5b..2cb17ffd 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "events": "^3.3.0", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#robertlong/group-call", "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#robertlong/group-call", + "olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz", "postcss-preset-env": "^6.7.0", "re-resizable": "^6.9.0", "react": "^17.0.0", diff --git a/src/ConferenceCallManagerHooks.js b/src/ConferenceCallManagerHooks.js index 383bfb25..47afbf37 100644 --- a/src/ConferenceCallManagerHooks.js +++ b/src/ConferenceCallManagerHooks.js @@ -30,7 +30,10 @@ function waitForSync(client) { } async function initClient(clientOptions, guest) { - const client = matrix.createClient(clientOptions); + const sessionStore = new matrix.WebStorageSessionStore(localStorage); + const client = matrix.createClient({ ...clientOptions, sessionStore }); + + await client.initCrypto(); if (guest) { client.setGuest(true); diff --git a/yarn.lock b/yarn.lock index 2da842e2..44e60569 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2020,6 +2020,10 @@ object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== +"olm@https://packages.matrix.org/npm/olm/olm-3.2.1.tgz": + version "3.2.1" + resolved "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz#d623d76f99c3518dde68be8c86618d68bc7b004a" + opus-recorder@^8.0.3: version "8.0.4" resolved "https://registry.yarnpkg.com/opus-recorder/-/opus-recorder-8.0.4.tgz#c4cdbb8bb94d17aa406934b58dcf9caab6c79b09"