From e6d4f090996e4ed0d80cd5c3c30c216850251d86 Mon Sep 17 00:00:00 2001 From: Lizzy Date: Wed, 26 Aug 2020 13:59:20 +0000 Subject: [PATCH 01/45] Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/es/ --- src/i18n/strings/es.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index 0569c90275..17c91a8ae8 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -30,6 +30,7 @@ "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Su configuración de Element contiene JSON inválido. Por favor corríjalo e inténtelo de nuevo.", "Download Completed": "Descarga completada", "Open": "Abrir", - "Your browser can't run %(brand)s": "Su navegador es compatible con %(brand)s", - "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s utiliza funciones avanzadas no soportadas por su navegador." + "Your browser can't run %(brand)s": "Su navegador es incompatible con %(brand)s", + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s utiliza funciones avanzadas no soportadas por su navegador.", + "Powered by Matrix": "Powered by Matrix" } From 5be2df1fb238d40c34462ee912a160f25fc1db22 Mon Sep 17 00:00:00 2001 From: Jarshvor Date: Wed, 26 Aug 2020 14:55:42 +0000 Subject: [PATCH 02/45] Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/es/ --- src/i18n/strings/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index 17c91a8ae8..37f3c6031c 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -31,6 +31,6 @@ "Download Completed": "Descarga completada", "Open": "Abrir", "Your browser can't run %(brand)s": "Su navegador es incompatible con %(brand)s", - "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s utiliza funciones avanzadas no soportadas por su navegador.", + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s usa funciones avanzadas que su navegador actual no soporta.", "Powered by Matrix": "Powered by Matrix" } From 4ad02dc202e833e310f58dc2b28d8c658401bf6b Mon Sep 17 00:00:00 2001 From: pebles Date: Wed, 26 Aug 2020 14:55:59 +0000 Subject: [PATCH 03/45] Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/es/ --- src/i18n/strings/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index 37f3c6031c..bf1fdf0cff 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -4,7 +4,7 @@ "powered by Matrix": "con el poder de Matrix", "You need to be using HTTPS to place a screen-sharing call.": "Debes usar HTTPS para hacer una llamada con pantalla compartida.", "Welcome to Element": "Bienvenido a Element", - "Decentralised, encrypted chat & collaboration powered by [matrix]": "Conversaciones cifradas y descentralizadas y colaboración con el poder de [matrix]", + "Decentralised, encrypted chat & collaboration powered by [matrix]": "Conversaciones cifradas y descentralizadas & colaboración impulsada por [matrix]", "Sign In": "Iniciar sesión", "Create Account": "Crear cuenta", "Explore rooms": "Explorar salas", From cbe0cd12afff30ee0853a0240cba325469f8b44d Mon Sep 17 00:00:00 2001 From: Lizzy Date: Wed, 26 Aug 2020 15:03:09 +0000 Subject: [PATCH 04/45] Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/es/ --- src/i18n/strings/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index bf1fdf0cff..b06013affd 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -4,7 +4,7 @@ "powered by Matrix": "con el poder de Matrix", "You need to be using HTTPS to place a screen-sharing call.": "Debes usar HTTPS para hacer una llamada con pantalla compartida.", "Welcome to Element": "Bienvenido a Element", - "Decentralised, encrypted chat & collaboration powered by [matrix]": "Conversaciones cifradas y descentralizadas & colaboración impulsada por [matrix]", + "Decentralised, encrypted chat & collaboration powered by [matrix]": "Conversaciones cifradas y descentralizadas & colaboración impulsada por [matrix]", "Sign In": "Iniciar sesión", "Create Account": "Crear cuenta", "Explore rooms": "Explorar salas", From c71b8d61c40f5dcf7f3b2843151fa3d21bad9c70 Mon Sep 17 00:00:00 2001 From: Boo Teille Date: Mon, 31 Aug 2020 12:39:27 +0000 Subject: [PATCH 05/45] Translated using Weblate (French) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/fr/ --- src/i18n/strings/fr.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 2d7e0fb52c..dd7784b685 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -31,5 +31,6 @@ "Your Element is misconfigured": "Votre Element est mal configuré", "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "La configuration de votre Element contient du JSON invalide. Veuillez corriger le problème et recharger la page.", "Your browser can't run %(brand)s": "Votre navigateur ne peut pas exécuter %(brand)s", - "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s nécessite des fonctionnalités avancées que votre navigateur actuel ne supporte pas." + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s nécessite des fonctionnalités avancées que votre navigateur actuel ne supporte pas.", + "Powered by Matrix": "Propulsé par Matrix" } From e608c9250696456346a4dc4baa71395211b892d3 Mon Sep 17 00:00:00 2001 From: "@a2sc:matrix.org" Date: Tue, 1 Sep 2020 12:52:21 +0000 Subject: [PATCH 06/45] Translated using Weblate (German) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/de/ --- src/i18n/strings/de_DE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 9629e85441..0688ac1d37 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -15,7 +15,7 @@ "Invalid JSON": "Ungültiges JSON", "Go to your browser to complete Sign In": "Gehe zu deinem Browser, um die Anmeldung abzuschließen", "Open user settings": "Öffne Nutzer-Einstellungen", - "Unable to load config file: please refresh the page to try again.": "Konfigurationsdatei kann nicht geladen werden: Bitte aktualisieren Sie die Seite, um es erneut zu versuchen.", + "Unable to load config file: please refresh the page to try again.": "Konfigurationsdatei kann nicht geladen werden: Bitte aktualisiere die Seite, um es erneut zu versuchen.", "Missing indexeddb worker script!": "Fehlendes indexeddb Worker-Skript!", "Previous/next recently visited room or community": "Vorheriger/nächster kürzlich besuchter Raum oder Community", "Unsupported browser": "Nicht unterstützter Browser", From 5108697ac88c0819519e34d9895c3f6343fb3671 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Fri, 4 Sep 2020 13:14:52 +0300 Subject: [PATCH 07/45] Add support for Jitsi openidtoken-jwt auth If the widget URL specifies this auth, generate a JWT token containing the info needed by the Jitsi backend. --- package.json | 1 + src/vector/jitsi/index.ts | 53 +++++++++++++++++++++++++++++++++++++-- yarn.lock | 5 ++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d6d7140a09..0a151e0e28 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "browser-request": "^0.3.3", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", + "jsrsasign": "^9.1.5", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 081246c0a9..47d6e24f73 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -19,6 +19,7 @@ require("./index.scss"); import * as qs from 'querystring'; import { Capability, WidgetApi } from "matrix-react-sdk/src/widgets/WidgetApi"; +import { KJUR } from "jsrsasign"; // Dev note: we use raw JS without many dependencies to reduce bundle size. // We do not need all of React to render a Jitsi conference. @@ -33,6 +34,8 @@ let conferenceId: string; let displayName: string; let avatarUrl: string; let userId: string; +let jitsiAuth: string; +let roomId: string; let widgetApi: WidgetApi; @@ -69,6 +72,8 @@ let widgetApi: WidgetApi; displayName = qsParam('displayName', true); avatarUrl = qsParam('avatarUrl', true); // http not mxc userId = qsParam('userId'); + jitsiAuth = qsParam('auth', true); + roomId = qsParam('roomId', true); if (widgetApi) { await widgetApi.waitReady(); @@ -91,6 +96,45 @@ function switchVisibleContainers() { document.getElementById("joinButtonContainer").style.visibility = inConference ? 'hidden' : 'unset'; } +/** + * Create a JWT token fot jitsi openidtoken-jwt auth + * + * See TODO add link + */ +function createJWTToken() { + // Header + const header = {alg: 'HS256', typ: 'JWT'}; + // Payload + const payload = { + // TODO change this to refer to spec? + iss: "app_id", + sub: jitsiDomain, + aud: `https://${jitsiDomain}`, + room: "*", + context: { + matrix: { + // TODO openid token retrieved as per MSC1960 + token: "foobar", + room_id: roomId, + }, + user: { + avatar: avatarUrl, + name: displayName, + }, + }, + }; + // Sign JWT + // The secret string here is irrelevant, we're only using the JWT + // to transport data to Prosody in the Jitsi stack. + // See TODO add link + return KJUR.jws.JWS.sign( + "HS256", + JSON.stringify(header), + JSON.stringify(payload), + "notused", + ); +} + function joinConference() { // event handler bound in HTML switchVisibleContainers(); @@ -102,7 +146,7 @@ function joinConference() { // event handler bound in HTML "they mention 'external_api' or 'jitsi' in the stack. They're just Jitsi Meet trying to parse " + "our fragment values and not recognizing the options.", ); - const meetApi = new JitsiMeetExternalAPI(jitsiDomain, { + const options = { width: "100%", height: "100%", parentNode: document.querySelector("#jitsiContainer"), @@ -113,7 +157,12 @@ function joinConference() { // event handler bound in HTML MAIN_TOOLBAR_BUTTONS: [], VIDEO_LAYOUT_FIT: "height", }, - }); + jwt: undefined, + }; + if (jitsiAuth === "openidtoken-jwt") { + options.jwt = createJWTToken(); + } + const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); if (displayName) meetApi.executeCommand("displayName", displayName); if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl); if (userId) meetApi.executeCommand("email", userId); diff --git a/yarn.lock b/yarn.lock index 9b1342e5e6..441250b72c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6914,6 +6914,11 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +jsrsasign@^9.1.5: + version "9.1.5" + resolved "https://registry.yarnpkg.com/jsrsasign/-/jsrsasign-9.1.5.tgz#fe286425d2c05b2d0865d24ded53e34b12abd2ca" + integrity sha512-iJLF8FvZHlwyQudrRtQomHj1HdPAcM8QSRTt0FJo8a6iFgaGCpKUrE7lWyELpAjrFs8jUC/Azc0vfhlj3yqHPQ== + jsx-ast-utils@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.3.0.tgz#edd727794ea284d7fda575015ed1b0cde0289ab6" From 8534328921f7e1d0324587b7e825adfe48b33d69 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 18:10:19 +0300 Subject: [PATCH 08/45] Implement OpenID token fetch from Jitsi widget Using MSC1960 to fetch an OpenID token via postmessage API. This is needed for Jitsi openidtoken-jwt auth. --- src/vector/jitsi/index.ts | 85 +++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 12 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 47d6e24f73..48a0cd020c 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -18,8 +18,9 @@ limitations under the License. require("./index.scss"); import * as qs from 'querystring'; -import { Capability, WidgetApi } from "matrix-react-sdk/src/widgets/WidgetApi"; -import { KJUR } from "jsrsasign"; +import {Capability, KnownWidgetActions, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi'; +import {KJUR} from 'jsrsasign'; +import {objectClone} from 'matrix-react-sdk/lib/utils/objects'; // Dev note: we use raw JS without many dependencies to reduce bundle size. // We do not need all of React to render a Jitsi conference. @@ -36,9 +37,54 @@ let avatarUrl: string; let userId: string; let jitsiAuth: string; let roomId: string; +let openIDToken: string; let widgetApi: WidgetApi; +function processOpenIDMessage(msg) { + const data = (msg.action === 'get_openid') ? msg.response : msg.data; + // TODO: just use data.state once https://github.com/matrix-org/matrix-react-sdk/pull/5172 is out + const result = (data.state !== undefined) ? data.state : + (data.success === true) ? 'allowed' : 'blocked'; + + switch (result) { + case 'allowed': + console.info('Successfully got OpenID credentials.'); + openIDToken = data.access_token; + // Send a response if this was not a response + if (msg.action === 'openid_credentials') { + const request = objectClone(msg); + request.response = {}; + window.parent.postMessage(request, '*'); + } + enableJoinButton(); + break; + case 'blocked': + console.warn('OpenID credentials request was blocked by user.'); + break; + default: + // nothing to do + } +} + +/** + * Implements processing OpenID token requests as per MSC1960 + */ +function onWidgetMessage(msg) { + const data = msg.data; + if (!data) { + return; + } + switch (data.action) { + case 'get_openid': + case 'openid_credentials': + processOpenIDMessage(data); + break; + default: + // Nothing to do + } +} + (async function() { try { // The widget's options are encoded into the fragment to avoid leaking info to the server. The widget @@ -78,11 +124,21 @@ let widgetApi: WidgetApi; if (widgetApi) { await widgetApi.waitReady(); await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen + + if (jitsiAuth === 'openidtoken-jwt') { + window.addEventListener('message', onWidgetMessage); + widgetApi.callAction( + KnownWidgetActions.GetOpenIDCredentials, + {}, + (response) => {console.log(response);}, + ); + } else { + enableJoinButton(); + } + // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) + } else { + enableJoinButton(); } - - // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) - - document.getElementById("joinButton").onclick = () => joinConference(); } catch (e) { console.error("Error setting up Jitsi widget", e); document.getElementById("jitsiContainer").innerText = "Failed to load Jitsi widget"; @@ -90,6 +146,11 @@ let widgetApi: WidgetApi; } })(); + +function enableJoinButton() { + document.getElementById("joinButton").onclick = () => joinConference(); +} + function switchVisibleContainers() { inConference = !inConference; document.getElementById("jitsiContainer").style.visibility = inConference ? 'unset' : 'hidden'; @@ -107,14 +168,13 @@ function createJWTToken() { // Payload const payload = { // TODO change this to refer to spec? - iss: "app_id", + iss: 'app_id', sub: jitsiDomain, aud: `https://${jitsiDomain}`, room: "*", context: { matrix: { - // TODO openid token retrieved as per MSC1960 - token: "foobar", + token: openIDToken, room_id: roomId, }, user: { @@ -128,10 +188,10 @@ function createJWTToken() { // to transport data to Prosody in the Jitsi stack. // See TODO add link return KJUR.jws.JWS.sign( - "HS256", + 'HS256', JSON.stringify(header), JSON.stringify(payload), - "notused", + 'notused', ); } @@ -159,7 +219,7 @@ function joinConference() { // event handler bound in HTML }, jwt: undefined, }; - if (jitsiAuth === "openidtoken-jwt") { + if (jitsiAuth === 'penidtoken-jwt') { options.jwt = createJWTToken(); } const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); @@ -168,6 +228,7 @@ function joinConference() { // event handler bound in HTML if (userId) meetApi.executeCommand("email", userId); meetApi.on("readyToClose", () => { + window.removeEventListener('message', onWidgetMessage); switchVisibleContainers(); // noinspection JSIgnoredPromiseFromCall From 0410a6b3be82a41457275e4d1ce879dea146e092 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 19:23:36 +0300 Subject: [PATCH 09/45] Use Jitsi domain in the JWT issuer --- src/vector/jitsi/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 48a0cd020c..73c561bccf 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -167,8 +167,10 @@ function createJWTToken() { const header = {alg: 'HS256', typ: 'JWT'}; // Payload const payload = { - // TODO change this to refer to spec? - iss: 'app_id', + // As per Jitsi token auth, `iss` needs to be set to something agreed between + // JWT generating side and Prosody config. Since we have no configuration for + // the widgets, we can't set one anywhere. Using the Jitsi domain here probably makes sense. + iss: jitsiDomain, sub: jitsiDomain, aud: `https://${jitsiDomain}`, room: "*", From 2205f0611eb539cd46016898b5fec4e5438d6067 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 19:25:44 +0300 Subject: [PATCH 10/45] Add some links to the openidtoken-jwt spec --- src/vector/jitsi/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 73c561bccf..3fe0aa3011 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -125,6 +125,7 @@ function onWidgetMessage(msg) { await widgetApi.waitReady(); await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen + // See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification if (jitsiAuth === 'openidtoken-jwt') { window.addEventListener('message', onWidgetMessage); widgetApi.callAction( @@ -160,7 +161,7 @@ function switchVisibleContainers() { /** * Create a JWT token fot jitsi openidtoken-jwt auth * - * See TODO add link + * See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification */ function createJWTToken() { // Header From 4164df647ca99bd57cb74f8268d5f49cb7f4babe Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 19:51:16 +0300 Subject: [PATCH 11/45] Improve error messsage of Jitsi widget If openidtoken request fails, show an error. Also render error a bit nicer in generic widget load errors. --- src/vector/jitsi/index.html | 4 +++- src/vector/jitsi/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vector/jitsi/index.html b/src/vector/jitsi/index.html index b9fc950e15..1259eb1c4a 100644 --- a/src/vector/jitsi/index.html +++ b/src/vector/jitsi/index.html @@ -11,7 +11,9 @@

Jitsi Video Conference

- +
+ +
diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 3fe0aa3011..ba24451feb 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -61,6 +61,7 @@ function processOpenIDMessage(msg) { break; case 'blocked': console.warn('OpenID credentials request was blocked by user.'); + document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; break; default: // nothing to do @@ -142,8 +143,7 @@ function onWidgetMessage(msg) { } } catch (e) { console.error("Error setting up Jitsi widget", e); - document.getElementById("jitsiContainer").innerText = "Failed to load Jitsi widget"; - switchVisibleContainers(); + document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; } })(); From acfd7252bdeb1f5083679fcac269ed2af4be5bb4 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 20:26:05 +0300 Subject: [PATCH 12/45] Remove todo --- src/vector/jitsi/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index ba24451feb..785d4c3c61 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -189,7 +189,6 @@ function createJWTToken() { // Sign JWT // The secret string here is irrelevant, we're only using the JWT // to transport data to Prosody in the Jitsi stack. - // See TODO add link return KJUR.jws.JWS.sign( 'HS256', JSON.stringify(header), From 3b434a70d21daa59bf41ef446d304a7248a0ecb9 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 20:36:26 +0300 Subject: [PATCH 13/45] Fix typo --- src/vector/jitsi/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 785d4c3c61..e3cafa8221 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -221,7 +221,7 @@ function joinConference() { // event handler bound in HTML }, jwt: undefined, }; - if (jitsiAuth === 'penidtoken-jwt') { + if (jitsiAuth === 'openidtoken-jwt') { options.jwt = createJWTToken(); } const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); From 21c862fe2b5e9ccbf5cacd51e59a0b7b66e4d197 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Sep 2020 20:47:07 +0300 Subject: [PATCH 14/45] Remove console.log --- src/vector/jitsi/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index e3cafa8221..84a858c094 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -132,7 +132,7 @@ function onWidgetMessage(msg) { widgetApi.callAction( KnownWidgetActions.GetOpenIDCredentials, {}, - (response) => {console.log(response);}, + () => {}, ); } else { enableJoinButton(); From 151dd5709cff0cba373e8f31e702a03bac56ee67 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 8 Sep 2020 11:32:09 +0300 Subject: [PATCH 15/45] Fix import Co-authored-by: Travis Ralston --- src/vector/jitsi/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 84a858c094..fa9e7759fb 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -20,7 +20,7 @@ require("./index.scss"); import * as qs from 'querystring'; import {Capability, KnownWidgetActions, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi'; import {KJUR} from 'jsrsasign'; -import {objectClone} from 'matrix-react-sdk/lib/utils/objects'; +import {objectClone} from 'matrix-react-sdk/src/utils/objects'; // Dev note: we use raw JS without many dependencies to reduce bundle size. // We do not need all of React to render a Jitsi conference. From 3309b2ec552bc463e7a7197ce7c44bc8b6aec0b9 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 8 Sep 2020 11:37:50 +0300 Subject: [PATCH 16/45] Block on matrix-org/matrix-react-sdk#5172 And shuffle code around a bit. --- src/vector/jitsi/index.ts | 86 +++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index fa9e7759fb..8392e1e530 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -41,51 +41,6 @@ let openIDToken: string; let widgetApi: WidgetApi; -function processOpenIDMessage(msg) { - const data = (msg.action === 'get_openid') ? msg.response : msg.data; - // TODO: just use data.state once https://github.com/matrix-org/matrix-react-sdk/pull/5172 is out - const result = (data.state !== undefined) ? data.state : - (data.success === true) ? 'allowed' : 'blocked'; - - switch (result) { - case 'allowed': - console.info('Successfully got OpenID credentials.'); - openIDToken = data.access_token; - // Send a response if this was not a response - if (msg.action === 'openid_credentials') { - const request = objectClone(msg); - request.response = {}; - window.parent.postMessage(request, '*'); - } - enableJoinButton(); - break; - case 'blocked': - console.warn('OpenID credentials request was blocked by user.'); - document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; - break; - default: - // nothing to do - } -} - -/** - * Implements processing OpenID token requests as per MSC1960 - */ -function onWidgetMessage(msg) { - const data = msg.data; - if (!data) { - return; - } - switch (data.action) { - case 'get_openid': - case 'openid_credentials': - processOpenIDMessage(data); - break; - default: - // Nothing to do - } -} - (async function() { try { // The widget's options are encoded into the fragment to avoid leaking info to the server. The widget @@ -147,6 +102,47 @@ function onWidgetMessage(msg) { } })(); +function processOpenIDMessage(msg) { + const data = (msg.action === 'get_openid') ? msg.response : msg.data; + + switch (data.state) { + case 'allowed': + console.info('Successfully got OpenID credentials.'); + openIDToken = data.access_token; + // Send a response if this was not a response + if (msg.action === 'openid_credentials') { + const request = objectClone(msg); + request.response = {}; + window.parent.postMessage(request, '*'); + } + enableJoinButton(); + break; + case 'blocked': + console.warn('OpenID credentials request was blocked by user.'); + document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; + break; + default: + // nothing to do + } +} + +/** + * Implements processing OpenID token requests as per MSC1960 + */ +function onWidgetMessage(msg) { + const data = msg.data; + if (!data) { + return; + } + switch (data.action) { + case 'get_openid': + case 'openid_credentials': + processOpenIDMessage(data); + break; + default: + // Nothing to do + } +} function enableJoinButton() { document.getElementById("joinButton").onclick = () => joinConference(); From a7abd8599e56eb63c1bbec0bae1721115eb05a1c Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 8 Sep 2020 11:44:11 +0300 Subject: [PATCH 17/45] More usage of constants --- src/vector/jitsi/index.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 8392e1e530..a80a07c471 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -22,6 +22,8 @@ import {Capability, KnownWidgetActions, WidgetApi} from 'matrix-react-sdk/src/wi import {KJUR} from 'jsrsasign'; import {objectClone} from 'matrix-react-sdk/src/utils/objects'; +const JITSI_OPENIDTOKEN_JWT_AUTH = 'openidtoken-jwt'; + // Dev note: we use raw JS without many dependencies to reduce bundle size. // We do not need all of React to render a Jitsi conference. @@ -82,7 +84,7 @@ let widgetApi: WidgetApi; await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen // See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification - if (jitsiAuth === 'openidtoken-jwt') { + if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { window.addEventListener('message', onWidgetMessage); widgetApi.callAction( KnownWidgetActions.GetOpenIDCredentials, @@ -103,14 +105,14 @@ let widgetApi: WidgetApi; })(); function processOpenIDMessage(msg) { - const data = (msg.action === 'get_openid') ? msg.response : msg.data; + const data = (msg.action === KnownWidgetActions.GetOpenIDCredentials) ? msg.response : msg.data; switch (data.state) { case 'allowed': console.info('Successfully got OpenID credentials.'); openIDToken = data.access_token; - // Send a response if this was not a response - if (msg.action === 'openid_credentials') { + // Send a response if this was not a response to GetOpenIDCredentials + if (msg.action === KnownWidgetActions.ReceiveOpenIDCredentials) { const request = objectClone(msg); request.response = {}; window.parent.postMessage(request, '*'); @@ -135,8 +137,8 @@ function onWidgetMessage(msg) { return; } switch (data.action) { - case 'get_openid': - case 'openid_credentials': + case KnownWidgetActions.GetOpenIDCredentials: + case KnownWidgetActions.ReceiveOpenIDCredentials: processOpenIDMessage(data); break; default: @@ -217,7 +219,7 @@ function joinConference() { // event handler bound in HTML }, jwt: undefined, }; - if (jitsiAuth === 'openidtoken-jwt') { + if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { options.jwt = createJWTToken(); } const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); From 579650a1dd61d466d0125cc621ccf00724823c29 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 8 Sep 2020 12:50:53 +0300 Subject: [PATCH 18/45] Move most of the OpenID token flow to WidgetAPI --- src/vector/jitsi/index.ts | 77 +++++++++++++-------------------------- 1 file changed, 25 insertions(+), 52 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index a80a07c471..0f94f04db0 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -18,9 +18,8 @@ limitations under the License. require("./index.scss"); import * as qs from 'querystring'; -import {Capability, KnownWidgetActions, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi'; +import {Capability, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi'; import {KJUR} from 'jsrsasign'; -import {objectClone} from 'matrix-react-sdk/src/utils/objects'; const JITSI_OPENIDTOKEN_JWT_AUTH = 'openidtoken-jwt'; @@ -39,7 +38,6 @@ let avatarUrl: string; let userId: string; let jitsiAuth: string; let roomId: string; -let openIDToken: string; let widgetApi: WidgetApi; @@ -85,12 +83,8 @@ let widgetApi: WidgetApi; // See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { - window.addEventListener('message', onWidgetMessage); - widgetApi.callAction( - KnownWidgetActions.GetOpenIDCredentials, - {}, - () => {}, - ); + // Request credentials, give callback to continue when received + widgetApi.requestOpenIDCredentials(credentialsResponseCallback); } else { enableJoinButton(); } @@ -104,45 +98,16 @@ let widgetApi: WidgetApi; } })(); -function processOpenIDMessage(msg) { - const data = (msg.action === KnownWidgetActions.GetOpenIDCredentials) ? msg.response : msg.data; - - switch (data.state) { - case 'allowed': - console.info('Successfully got OpenID credentials.'); - openIDToken = data.access_token; - // Send a response if this was not a response to GetOpenIDCredentials - if (msg.action === KnownWidgetActions.ReceiveOpenIDCredentials) { - const request = objectClone(msg); - request.response = {}; - window.parent.postMessage(request, '*'); - } - enableJoinButton(); - break; - case 'blocked': - console.warn('OpenID credentials request was blocked by user.'); - document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; - break; - default: - // nothing to do - } -} - /** - * Implements processing OpenID token requests as per MSC1960 + * Enable or show error depending on what the credentials response is. */ -function onWidgetMessage(msg) { - const data = msg.data; - if (!data) { - return; - } - switch (data.action) { - case KnownWidgetActions.GetOpenIDCredentials: - case KnownWidgetActions.ReceiveOpenIDCredentials: - processOpenIDMessage(data); - break; - default: - // Nothing to do +function credentialsResponseCallback() { + if (widgetApi.openIDCredentials) { + console.info('Successfully got OpenID credentials.'); + enableJoinButton(); + } else { + console.warn('OpenID credentials request was blocked by user.'); + document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; } } @@ -175,7 +140,7 @@ function createJWTToken() { room: "*", context: { matrix: { - token: openIDToken, + token: widgetApi.openIDCredentials.accessToken, room_id: roomId, }, user: { @@ -196,6 +161,17 @@ function createJWTToken() { } function joinConference() { // event handler bound in HTML + let jwt; + if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { + if (!widgetApi.openIDCredentials || !widgetApi.openIDCredentials.accessToken) { + // We've failing to get a token, don't try to init conference + console.warn('Expected to have an OpenID credential, cannot initialize widget.'); + document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; + return; + } + jwt = createJWTToken(); + } + switchVisibleContainers(); // noinspection JSIgnoredPromiseFromCall @@ -217,18 +193,15 @@ function joinConference() { // event handler bound in HTML MAIN_TOOLBAR_BUTTONS: [], VIDEO_LAYOUT_FIT: "height", }, - jwt: undefined, + jwt: jwt, }; - if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { - options.jwt = createJWTToken(); - } + const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); if (displayName) meetApi.executeCommand("displayName", displayName); if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl); if (userId) meetApi.executeCommand("email", userId); meetApi.on("readyToClose", () => { - window.removeEventListener('message', onWidgetMessage); switchVisibleContainers(); // noinspection JSIgnoredPromiseFromCall From 7018a498a70931fc01e5835fc63d08640f264f72 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 8 Sep 2020 12:52:17 +0300 Subject: [PATCH 19/45] Quieten some IDE warnings --- src/vector/jitsi/index.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 0f94f04db0..6e697fee2f 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -174,8 +174,11 @@ function joinConference() { // event handler bound in HTML switchVisibleContainers(); - // noinspection JSIgnoredPromiseFromCall - if (widgetApi) widgetApi.setAlwaysOnScreen(true); // ignored promise because we don't care if it works + if (widgetApi) { + // ignored promise because we don't care if it works + // noinspection JSIgnoredPromiseFromCall + widgetApi.setAlwaysOnScreen(true); + } console.warn( "[Jitsi Widget] The next few errors about failing to parse URL parameters are fine if " + @@ -204,8 +207,11 @@ function joinConference() { // event handler bound in HTML meetApi.on("readyToClose", () => { switchVisibleContainers(); - // noinspection JSIgnoredPromiseFromCall - if (widgetApi) widgetApi.setAlwaysOnScreen(false); // ignored promise because we don't care if it works + if (widgetApi) { + // ignored promise because we don't care if it works + // noinspection JSIgnoredPromiseFromCall + widgetApi.setAlwaysOnScreen(false); + } document.getElementById("jitsiContainer").innerHTML = ""; }); From bbfbef7f24de70f34b329973792fddb2d7741a37 Mon Sep 17 00:00:00 2001 From: riverside6 Date: Tue, 8 Sep 2020 19:00:56 +0000 Subject: [PATCH 20/45] Translated using Weblate (German) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/de/ --- src/i18n/strings/de_DE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 0688ac1d37..1007742d6b 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -32,5 +32,5 @@ "Open": "Öffnen", "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s verwendet erweiterte Browserfunktionen, die von Ihrem aktuellen Browser nicht unterstützt werden.", "Your browser can't run %(brand)s": "Dein Browser kann %(brand)s nicht ausführen", - "Powered by Matrix": "Betrieben von Matrix" + "Powered by Matrix": "Betrieben mit Matrix" } From 5a5be814b620f2da8d540a4ed3dbf1cde5001a6c Mon Sep 17 00:00:00 2001 From: TERMICO Date: Tue, 8 Sep 2020 14:29:25 +0000 Subject: [PATCH 21/45] Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/es/ --- src/i18n/strings/es.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index b06013affd..f48ad2c15f 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -15,10 +15,10 @@ "Invalid JSON": "JSON inválido", "Open user settings": "Abrir opciones de usuario", "Go to your browser to complete Sign In": "Abre tu navegador web para completar el registro", - "Missing indexeddb worker script!": "¡Worker script “indexeddb” faltante!", + "Missing indexeddb worker script!": "Falta el script de trabajo indexeddb!", "Unable to load config file: please refresh the page to try again.": "No se ha podido cargar el archivo de configuración. Recarga la página para intentar nuevamente.", "Previous/next recently visited room or community": "Anterior/siguiente sala o comunidad visitada recientemente", - "%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)", + "%(brand)s Desktop (%(platformName)s)": "%(brand)s Escritorio (%(platformName)s)", "%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)", "Unsupported browser": "Navegador no soportado", "Please install Chrome, Firefox, or Safari for the best experience.": "Por favor, instale Chrome, Firefox, o Safari para la mejor experiencia.", @@ -26,11 +26,11 @@ "I understand the risks and wish to continue": "Entiendo los riesgos y deseo continuar", "Go to element.io": "Ir a element.io", "Failed to start": "Fallo al iniciar", - "Your Element is misconfigured": "Su Element está mal configurado", + "Your Element is misconfigured": "Tu elemento está mal configurado", "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Su configuración de Element contiene JSON inválido. Por favor corríjalo e inténtelo de nuevo.", "Download Completed": "Descarga completada", "Open": "Abrir", "Your browser can't run %(brand)s": "Su navegador es incompatible con %(brand)s", "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s usa funciones avanzadas que su navegador actual no soporta.", - "Powered by Matrix": "Powered by Matrix" + "Powered by Matrix": "Desarrollado por Matrix" } From fcdda7a95670f5f7565f34949ecf0729fa246235 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 15:56:42 +0100 Subject: [PATCH 22/45] Upgrade matrix-js-sdk to 8.3.0-rc.1 --- package.json | 2 +- yarn.lock | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a151e0e28..126ffa95bd 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "8.3.0-rc.1", "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", diff --git a/yarn.lock b/yarn.lock index 441250b72c..fea0fb02b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7317,6 +7317,21 @@ mathml-tag-names@^2.1.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== +matrix-js-sdk@8.3.0-rc.1: + version "8.3.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.3.0-rc.1.tgz#19546de4bb9476e52e1e2761db54a9f138510f49" + integrity sha512-TnnaM2qsCNzZpNbzuduCDbIWchO9rrKhOjVHcbbbNBlpPUukEeoQo0FYw6MUjy7MSjyH1GIstAmRFlg0vbu0Qw== + dependencies: + "@babel/runtime" "^7.8.3" + another-json "^0.2.0" + browser-request "^0.3.3" + bs58 "^4.0.1" + content-type "^1.0.2" + loglevel "^1.6.4" + qs "^6.5.2" + request "^2.88.0" + unhomoglyph "^1.0.2" + "matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "8.2.0" resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/c6992e2056901502af19e40ba0d1103c4c1f61ed" From 2ad02e4feb2b12940e191982e60d28f5a3429b33 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 15:56:58 +0100 Subject: [PATCH 23/45] Upgrade matrix-react-sdk to 3.4.0-rc.1 --- package.json | 2 +- yarn.lock | 43 +++++++++++++------------------------------ 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 126ffa95bd..7639de1e79 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "8.3.0-rc.1", - "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", + "matrix-react-sdk": "3.4.0-rc.1", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index fea0fb02b4..598090e696 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3160,15 +3160,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-react-class@^15.6.3: - version "15.6.3" - resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" - integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg== - dependencies: - fbjs "^0.8.9" - loose-envify "^1.3.1" - object-assign "^4.1.1" - cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -4688,7 +4679,7 @@ fbjs@0.1.0-alpha.7: promise "^7.0.3" whatwg-fetch "^0.9.0" -fbjs@^0.8.4, fbjs@^0.8.9: +fbjs@^0.8.4: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -7191,7 +7182,7 @@ longest-streak@^2.0.1: resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -7332,20 +7323,6 @@ matrix-js-sdk@8.3.0-rc.1: request "^2.88.0" unhomoglyph "^1.0.2" -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": - version "8.2.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/c6992e2056901502af19e40ba0d1103c4c1f61ed" - dependencies: - "@babel/runtime" "^7.8.3" - another-json "^0.2.0" - browser-request "^0.3.3" - bs58 "^4.0.1" - content-type "^1.0.2" - loglevel "^1.6.4" - qs "^6.5.2" - request "^2.88.0" - unhomoglyph "^1.0.2" - matrix-mock-request@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/matrix-mock-request/-/matrix-mock-request-1.2.3.tgz#56b15d86e2601a9b48a854844396d18caab649c8" @@ -7354,9 +7331,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop": - version "3.3.0" - resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/0d290c9bd2604343610e1fc3b17bbdb941ad2ad6" +matrix-react-sdk@3.4.0-rc.1: + version "3.4.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.0-rc.1.tgz#e3588eecd97de976d97add7e466892d8ea03fb6c" + integrity sha512-mJsBaQpDmMG61jv2oTzNXX+/35QKhAMRvnehlWH2zwcu/yAZbFFeV72ZdWCGYb8RcN+u8Aw856YebWAFMsdbyw== dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" @@ -7366,7 +7344,6 @@ matrix-mock-request@^1.2.3: classnames "^2.2.6" commonmark "^0.29.1" counterpart "^0.18.6" - create-react-class "^15.6.3" diff-dom "^4.1.6" diff-match-patch "^1.0.5" emojibase-data "^5.0.1" @@ -7384,7 +7361,7 @@ matrix-mock-request@^1.2.3: is-ip "^2.0.0" linkifyjs "^2.1.9" lodash "^4.17.19" - matrix-js-sdk "github:matrix-org/matrix-js-sdk#develop" + matrix-js-sdk "8.3.0-rc.1" minimist "^1.2.5" pako "^1.0.11" parse5 "^5.1.1" @@ -7400,6 +7377,7 @@ matrix-mock-request@^1.2.3: react-focus-lock "^2.4.1" react-transition-group "^4.4.1" resize-observer-polyfill "^1.5.1" + rfc4648 "^1.4.0" sanitize-html "^1.27.1" tar-js "^0.3.0" text-encoding-utf-8 "^1.0.2" @@ -10309,6 +10287,11 @@ retry@^0.12.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= +rfc4648@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/rfc4648/-/rfc4648-1.4.0.tgz#c75b2856ad2e2d588b6ddb985d556f1f7f2a2abd" + integrity sha512-3qIzGhHlMHA6PoT6+cdPKZ+ZqtxkIvg8DZGKA5z6PQ33/uuhoJ+Ws/D/J9rXW6gXodgH8QYlz2UCl+sdUDmNIg== + rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" From ff2fe8053761f4fb9156ed357fa82348a175133a Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 16:00:06 +0100 Subject: [PATCH 24/45] Prepare changelog for v1.7.6-rc.1 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d21f06095b..0a0c387074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +Changes in [1.7.6-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.6-rc.1) (2020-09-09) +======================================================================================================= +[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.5...v1.7.6-rc.1) + + * Upgrade to React SDK 3.4.0-rc.1 and JS SDK 8.3.0-rc.1 + * Update from Weblate + [\#15125](https://github.com/vector-im/element-web/pull/15125) + * Support usage of Jitsi widgets with "openidtoken-jwt" auth + [\#15114](https://github.com/vector-im/element-web/pull/15114) + * Fix eslint ts override tsx matching and delint + [\#15064](https://github.com/vector-im/element-web/pull/15064) + * Add testing to review guidelines + [\#15050](https://github.com/vector-im/element-web/pull/15050) + Changes in [1.7.5](https://github.com/vector-im/element-web/releases/tag/v1.7.5) (2020-09-01) ============================================================================================= [Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.5-rc.1...v1.7.5) From cf448f1f0ae6d0f965b2c0bccb0ae193e705490b Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 16:00:06 +0100 Subject: [PATCH 25/45] v1.7.6-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7639de1e79..071f693bc9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "riot-web", "productName": "Riot", - "version": "1.7.5", + "version": "1.7.6-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From ac447fd318d676425ef76130bc297e2d0bbe749b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 9 Sep 2020 16:52:48 +0100 Subject: [PATCH 26/45] Fix onNewScreen to use replace when going from roomId->roomAlias to prevent locking the user in place --- src/vector/app.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vector/app.tsx b/src/vector/app.tsx index 445a37ba55..bc9a4fdb11 100644 --- a/src/vector/app.tsx +++ b/src/vector/app.tsx @@ -71,11 +71,16 @@ function onHashChange(ev: HashChangeEvent) { // This will be called whenever the SDK changes screens, // so a web page can update the URL bar appropriately. -function onNewScreen(screen: string) { +function onNewScreen(screen: string, replaceLast = false) { console.log("newscreen " + screen); const hash = '#/' + screen; lastLocationHashSet = hash; - window.location.hash = hash; + + if (replaceLast) { + window.location.replace(hash); + } else { + window.location.assign(hash); + } } // We use this to work out what URL the SDK should From 6853cabca2f030960da93d52cbf966d2fa80aad3 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 10 Sep 2020 10:03:13 +0100 Subject: [PATCH 27/45] Enable Estonian in language menu Fixes https://github.com/vector-im/element-web/issues/15135 --- scripts/copy-res.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 68d131c7c6..ebe1c625ea 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -21,6 +21,7 @@ const INCLUDE_LANGS = [ {'value': 'en_US', 'label': 'English (US)'}, {'value': 'eo', 'label': 'Esperanto'}, {'value': 'es', 'label': 'Español'}, + {'value': 'et', 'label': 'Eesti'}, {'value': 'eu', 'label': 'Euskara'}, {'value': 'fi', 'label': 'Suomi'}, {'value': 'fr', 'label': 'Français'}, From 7262b372b36687698ae7d6d4dee8034119a71570 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 10 Sep 2020 10:14:43 +0100 Subject: [PATCH 28/45] Remove references to Travis CI Also cleans up a Riot reference as well Part of https://github.com/vector-im/element-web/issues/15098 --- CONTRIBUTING.rst | 6 +++--- scripts/fetch-develop.deps.sh | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f084b474bd..3af9d3945b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,4 +1,4 @@ -Contributing code to Riot -========================= +Contributing code to Element +============================ -Riot follows the same pattern as https://github.com/matrix-org/matrix-js-sdk/blob/master/CONTRIBUTING.rst. +Element follows the same pattern as https://github.com/matrix-org/matrix-js-sdk/blob/master/CONTRIBUTING.rst. diff --git a/scripts/fetch-develop.deps.sh b/scripts/fetch-develop.deps.sh index a45159c256..c4001f7dc8 100755 --- a/scripts/fetch-develop.deps.sh +++ b/scripts/fetch-develop.deps.sh @@ -70,7 +70,6 @@ function dodep() { ############################## -echo -en 'travis_fold:start:matrix-js-sdk\r' echo 'Setting up matrix-js-sdk' dodep matrix-org matrix-js-sdk @@ -83,11 +82,8 @@ popd yarn link matrix-js-sdk -echo -en 'travis_fold:end:matrix-js-sdk\r' - ############################## -echo -en 'travis_fold:start:matrix-react-sdk\r' echo 'Setting up matrix-react-sdk' dodep matrix-org matrix-react-sdk @@ -101,8 +97,6 @@ popd yarn link matrix-react-sdk -echo -en 'travis_fold:end:matrix-react-sdk\r' - ############################## # Link the reskindex binary in place: if we used `yarn link`, From d1aed258157eb9d173426c5d54620b90796e6c4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2020 11:02:13 +0000 Subject: [PATCH 29/45] Bump node-fetch from 2.6.0 to 2.6.1 Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 441250b72c..7793b2c5e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7838,9 +7838,9 @@ node-fetch@^1.0.1: is-stream "^1.0.1" node-fetch@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" - integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== node-forge@0.9.0: version "0.9.0" From c8a0d94b610a79934d7bb668438745f21f0ee8e4 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:42:53 +0100 Subject: [PATCH 30/45] Upgrade matrix-js-sdk to 8.3.0 --- package.json | 2 +- yarn.lock | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 071f693bc9..24451a7e54 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", - "matrix-js-sdk": "8.3.0-rc.1", + "matrix-js-sdk": "8.3.0", "matrix-react-sdk": "3.4.0-rc.1", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", diff --git a/yarn.lock b/yarn.lock index 598090e696..3d9beeb7f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7308,6 +7308,21 @@ mathml-tag-names@^2.1.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== +matrix-js-sdk@8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.3.0.tgz#a57a6d071619c24b6e8501ae21fa4d21f6bbd052" + integrity sha512-ndKedUtZt72/4KWjlMevNwNDGfhPTOn/i4U6Iv1ZEfm7uZfbp5u3hVIyr8tyOiVuvMIxmcTajRdwSlRsNtYFkA== + dependencies: + "@babel/runtime" "^7.8.3" + another-json "^0.2.0" + browser-request "^0.3.3" + bs58 "^4.0.1" + content-type "^1.0.2" + loglevel "^1.6.4" + qs "^6.5.2" + request "^2.88.0" + unhomoglyph "^1.0.2" + matrix-js-sdk@8.3.0-rc.1: version "8.3.0-rc.1" resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.3.0-rc.1.tgz#19546de4bb9476e52e1e2761db54a9f138510f49" From 6d124e6c28b6167598877984e9d9452bcd694c88 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:44:41 +0100 Subject: [PATCH 31/45] Upgrade matrix-react-sdk to 3.4.0 --- package.json | 2 +- yarn.lock | 25 +++++-------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 24451a7e54..9d9cc40a00 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "8.3.0", - "matrix-react-sdk": "3.4.0-rc.1", + "matrix-react-sdk": "3.4.0", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 3d9beeb7f7..40f5475cab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7323,21 +7323,6 @@ matrix-js-sdk@8.3.0: request "^2.88.0" unhomoglyph "^1.0.2" -matrix-js-sdk@8.3.0-rc.1: - version "8.3.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.3.0-rc.1.tgz#19546de4bb9476e52e1e2761db54a9f138510f49" - integrity sha512-TnnaM2qsCNzZpNbzuduCDbIWchO9rrKhOjVHcbbbNBlpPUukEeoQo0FYw6MUjy7MSjyH1GIstAmRFlg0vbu0Qw== - dependencies: - "@babel/runtime" "^7.8.3" - another-json "^0.2.0" - browser-request "^0.3.3" - bs58 "^4.0.1" - content-type "^1.0.2" - loglevel "^1.6.4" - qs "^6.5.2" - request "^2.88.0" - unhomoglyph "^1.0.2" - matrix-mock-request@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/matrix-mock-request/-/matrix-mock-request-1.2.3.tgz#56b15d86e2601a9b48a854844396d18caab649c8" @@ -7346,10 +7331,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@3.4.0-rc.1: - version "3.4.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.0-rc.1.tgz#e3588eecd97de976d97add7e466892d8ea03fb6c" - integrity sha512-mJsBaQpDmMG61jv2oTzNXX+/35QKhAMRvnehlWH2zwcu/yAZbFFeV72ZdWCGYb8RcN+u8Aw856YebWAFMsdbyw== +matrix-react-sdk@3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.0.tgz#418cd8f0f6c2e884189272e5813136a2ab90ce4c" + integrity sha512-rSKRxo1NmgXKEsGUfU2vmAqQvvKbRHd8hcY6WVh/5YydiGuXdKf7w8cdpzv8LMU+Le9QUf+3hWOdZ8p++gOymA== dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" @@ -7376,7 +7361,7 @@ matrix-react-sdk@3.4.0-rc.1: is-ip "^2.0.0" linkifyjs "^2.1.9" lodash "^4.17.19" - matrix-js-sdk "8.3.0-rc.1" + matrix-js-sdk "8.3.0" minimist "^1.2.5" pako "^1.0.11" parse5 "^5.1.1" From 9ed26c66a69d0301859c929424eceb47dc3e6479 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:46:13 +0100 Subject: [PATCH 32/45] Prepare changelog for v1.7.6 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0c387074..5fd0f36657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [1.7.6](https://github.com/vector-im/element-web/releases/tag/v1.7.6) (2020-09-14) +============================================================================================= +[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.6-rc.1...v1.7.6) + + * Upgrade to React SDK 3.4.0 and JS SDK 8.3.0 + Changes in [1.7.6-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.6-rc.1) (2020-09-09) ======================================================================================================= [Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.5...v1.7.6-rc.1) From 70febe3109023c4088ce3ad42ec28bd84bea7318 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:46:13 +0100 Subject: [PATCH 33/45] v1.7.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d9cc40a00..84b6b530d6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "riot-web", "productName": "Riot", - "version": "1.7.6-rc.1", + "version": "1.7.6", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 451842f2bf6bbdb6f6b6ea8f0e27c02c4c50c6cb Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:51:31 +0100 Subject: [PATCH 34/45] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- yarn.lock | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 84b6b530d6..3d9c727ed3 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", - "matrix-js-sdk": "8.3.0", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-react-sdk": "3.4.0", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", diff --git a/yarn.lock b/yarn.lock index bf6af8c8a7..4eab5677de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7323,6 +7323,20 @@ matrix-js-sdk@8.3.0: request "^2.88.0" unhomoglyph "^1.0.2" +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": + version "8.3.0" + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/b9886d4f3479c041fc6d91ebc88c4a998e9d2e7c" + dependencies: + "@babel/runtime" "^7.8.3" + another-json "^0.2.0" + browser-request "^0.3.3" + bs58 "^4.0.1" + content-type "^1.0.2" + loglevel "^1.6.4" + qs "^6.5.2" + request "^2.88.0" + unhomoglyph "^1.0.2" + matrix-mock-request@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/matrix-mock-request/-/matrix-mock-request-1.2.3.tgz#56b15d86e2601a9b48a854844396d18caab649c8" From 8b2560dbef9223c38c9b2289276ed31d6c5ef2fd Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:51:40 +0100 Subject: [PATCH 35/45] Reset matrix-react-sdk back to develop branch --- package.json | 2 +- yarn.lock | 22 +++------------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 3d9c727ed3..149e6aae86 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", - "matrix-react-sdk": "3.4.0", + "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 4eab5677de..844df889d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7308,21 +7308,6 @@ mathml-tag-names@^2.1.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.3.0.tgz#a57a6d071619c24b6e8501ae21fa4d21f6bbd052" - integrity sha512-ndKedUtZt72/4KWjlMevNwNDGfhPTOn/i4U6Iv1ZEfm7uZfbp5u3hVIyr8tyOiVuvMIxmcTajRdwSlRsNtYFkA== - dependencies: - "@babel/runtime" "^7.8.3" - another-json "^0.2.0" - browser-request "^0.3.3" - bs58 "^4.0.1" - content-type "^1.0.2" - loglevel "^1.6.4" - qs "^6.5.2" - request "^2.88.0" - unhomoglyph "^1.0.2" - "matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "8.3.0" resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/b9886d4f3479c041fc6d91ebc88c4a998e9d2e7c" @@ -7345,10 +7330,9 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@3.4.0: +"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop": version "3.4.0" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.0.tgz#418cd8f0f6c2e884189272e5813136a2ab90ce4c" - integrity sha512-rSKRxo1NmgXKEsGUfU2vmAqQvvKbRHd8hcY6WVh/5YydiGuXdKf7w8cdpzv8LMU+Le9QUf+3hWOdZ8p++gOymA== + resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/148cad6ea2daecee3dc799616dc102698b0751f8" dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" @@ -7375,7 +7359,7 @@ matrix-react-sdk@3.4.0: is-ip "^2.0.0" linkifyjs "^2.1.9" lodash "^4.17.19" - matrix-js-sdk "8.3.0" + matrix-js-sdk "github:matrix-org/matrix-js-sdk#develop" minimist "^1.2.5" pako "^1.0.11" parse5 "^5.1.1" From 0eccd03a787814fa472de686a9c32835e28f1c4e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 15:57:32 +0100 Subject: [PATCH 36/45] Upgrade matrix-react-sdk to 3.4.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 84b6b530d6..686758286d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "8.3.0", - "matrix-react-sdk": "3.4.0", + "matrix-react-sdk": "3.4.1", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 40f5475cab..07a294c768 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7331,10 +7331,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.0.tgz#418cd8f0f6c2e884189272e5813136a2ab90ce4c" - integrity sha512-rSKRxo1NmgXKEsGUfU2vmAqQvvKbRHd8hcY6WVh/5YydiGuXdKf7w8cdpzv8LMU+Le9QUf+3hWOdZ8p++gOymA== +matrix-react-sdk@3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.1.tgz#820fe83081c475f98158c4e9e71a3c8e1afa7c14" + integrity sha512-aAfMgJuutQas3rF+Z7iOOkOuhwYNG+ugq7bmF8CEs00IYY6UEfreqiqGBwnvTm+1b1Sdl6p2kjgil8941veCZg== dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" From 3d53908686b82a74bcefcb3ab86440bdcfbf4a5b Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 16:00:49 +0100 Subject: [PATCH 37/45] Prepare changelog for v1.7.7 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fd0f36657..73aeb997f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [1.7.7](https://github.com/vector-im/element-web/releases/tag/v1.7.7) (2020-09-14) +============================================================================================= +[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.6...v1.7.7) + + * Upgrade to React SDK 3.4.1 + Changes in [1.7.6](https://github.com/vector-im/element-web/releases/tag/v1.7.6) (2020-09-14) ============================================================================================= [Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.6-rc.1...v1.7.6) From 2f4299e836b53e360807528bebba37353631ab09 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 16:00:49 +0100 Subject: [PATCH 38/45] v1.7.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 686758286d..309b3d5659 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "riot-web", "productName": "Riot", - "version": "1.7.6", + "version": "1.7.7", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 82cfc751afe1dbf601083fa377e7ab7738c67c62 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 16:10:08 +0100 Subject: [PATCH 39/45] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 309b3d5659..de7863dbaa 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", - "matrix-js-sdk": "8.3.0", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-react-sdk": "3.4.1", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", From df5cb15cf9c5bd043c1724cc21e58b0b513f5aab Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 16:10:18 +0100 Subject: [PATCH 40/45] Reset matrix-react-sdk back to develop branch --- package.json | 2 +- yarn.lock | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index de7863dbaa..ce25adc792 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", - "matrix-react-sdk": "3.4.1", + "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 289813f53e..ec950eb494 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7330,10 +7330,9 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@3.4.1: +"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop": version "3.4.1" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.4.1.tgz#820fe83081c475f98158c4e9e71a3c8e1afa7c14" - integrity sha512-aAfMgJuutQas3rF+Z7iOOkOuhwYNG+ugq7bmF8CEs00IYY6UEfreqiqGBwnvTm+1b1Sdl6p2kjgil8941veCZg== + resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/747126950b14ded4e09b3c0c8cc6beb04b64b052" dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" From 85979079f12e2af4d699f493dba328faf722a0c3 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 14 Sep 2020 22:28:57 -0600 Subject: [PATCH 41/45] Add end-user documentation for UI features --- docs/config.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/config.md b/docs/config.md index a9d05d8618..25af77f77e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -144,3 +144,15 @@ Desktop app configuration ========================= See https://github.com/vector-im/riot-desktop#user-specified-configjson + +UI Features +=========== + +Parts of the UI can be disabled using UI features. These are settings which appear +under `settingDefaults` and can only be `true` (default) or `false`. When `false`, +parts of the UI relating to that feature will be disabled regardless of the user's +preferences. + +Currently, the following UI feature flags are supported: + +* `UIFeature.URLPreviews` - Disables URL previews across the entire application. From 40813a6b339566248f4fa144e15de18e083eeff6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 15 Sep 2020 15:49:25 +0100 Subject: [PATCH 42/45] If no bug_report_endpoint_url, hide rageshaking from the App --- src/vector/rageshakesetup.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vector/rageshakesetup.ts b/src/vector/rageshakesetup.ts index e495557429..cc29670213 100644 --- a/src/vector/rageshakesetup.ts +++ b/src/vector/rageshakesetup.ts @@ -51,12 +51,18 @@ export function initRageshake() { } window.mxSendRageshake = function(text: string, withLogs?: boolean) { + const url = SdkConfig.get().bug_report_endpoint_url; + if (!url) { + console.error("Cannot send a rageshake - no bug_report_endpoint_url configured"); + return; + } + if (withLogs === undefined) withLogs = true; if (!text || !text.trim()) { console.error("Cannot send a rageshake without a message - please tell us what went wrong"); return; } - sendBugReport(SdkConfig.get().bug_report_endpoint_url, { + sendBugReport(url, { userText: text, sendLogs: withLogs, progressCallback: console.log.bind(console), From cad03d0c47d9f1414c75b385567866d8b4e3826b Mon Sep 17 00:00:00 2001 From: Tom Lant Date: Wed, 16 Sep 2020 21:34:00 +0100 Subject: [PATCH 43/45] Update README.md Including `git checkout develop` in the dev env instructions is redundant and confusing (since `develop` is already the default branch) --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 58bb12158d..429ad5046e 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,6 @@ First clone and build `matrix-js-sdk`: ``` bash git clone https://github.com/matrix-org/matrix-js-sdk.git pushd matrix-js-sdk -git checkout develop yarn link yarn install popd @@ -236,7 +235,6 @@ Then similarly with `matrix-react-sdk`: ```bash git clone https://github.com/matrix-org/matrix-react-sdk.git pushd matrix-react-sdk -git checkout develop yarn link yarn link matrix-js-sdk yarn install @@ -248,7 +246,6 @@ Finally, build and start Element itself: ```bash git clone https://github.com/vector-im/element-web.git cd element-web -git checkout develop yarn link matrix-js-sdk yarn link matrix-react-sdk yarn install From 72d1950bea909914cc0fcb9e7958f2c52491b64c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 17 Sep 2020 22:22:11 -0600 Subject: [PATCH 44/45] Update documentation for UI Features --- docs/config.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/config.md b/docs/config.md index 25af77f77e..5ea177388f 100644 --- a/docs/config.md +++ b/docs/config.md @@ -48,7 +48,7 @@ For a good example, see https://develop.element.io/config.json. 1. `integrations_widgets_urls`: list of URLs to the REST interface for the widget integrations server. 1. `bug_report_endpoint_url`: endpoint to send bug reports to (must be running a https://github.com/matrix-org/rageshake server). Bug reports are sent when a user clicks - "Send Logs" within the application. Bug reports can be disabled by leaving the + "Send Logs" within the application. Bug reports can be disabled/hidden by leaving the `bug_report_endpoint_url` out of your config file. 1. `roomDirectory`: config for the public room directory. This section is optional. 1. `roomDirectory.servers`: List of other homeservers' directories to include in the drop @@ -155,4 +155,29 @@ preferences. Currently, the following UI feature flags are supported: -* `UIFeature.URLPreviews` - Disables URL previews across the entire application. +* `UIFeature.urlPreviews` - Whether URL previews are enabled across the entire application. +* `UIFeature.feedback` - Whether prompts to supply feedback are shown. +* `UIFeature.voip` - Whether or not VoIP is shown readily to the user. When disabled, + Jitsi widgets will still work though they cannot easily be added. +* `UIFeature.widgets` - Whether or not widgets will be shown. +* `UIFeature.flair` - Whether or not community flair is shown in rooms. +* `UIFeature.communities` - Whether or not to show any UI related to communities. Implicitly + disables `UIFeature.flair` when disabled. +* `UIFeature.advancedSettings` - Whether or not sections titled "advanced" in room and + user settings are shown to the user. +* `UIFeature.shareQrCode` - Whether or not the QR code on the share room/event dialog + is shown. +* `UIFeature.shareSocial` - Whether or not the social icons on the share room/event dialog + are shown. +* `UIFeature.identityServer` - Whether or not functionality requiring an identity server + is shown. When disabled, the user will not be able to interact with the identity + server (sharing email addresses, 3PID invites, etc). +* `UIFeature.thirdPartyId` - Whether or not UI relating to third party identifiers (3PIDs) + is shown. Typically this is considered "contact information" on the homeserver, and is + not directly related to the identity server. +* `UIFeature.registration` - Whether or not the registration page is accessible. Typically + useful if accounts are managed externally. +* `UIFeature.passwordReset` - Whether or not the password reset page is accessible. Typically + useful if accounts are managed externally. +* `UIFeature.deactivate` - Whether or not the deactivate account button is accessible. Typically + useful if accounts are managed externally. From c364215d538800c729d6bfec60409c559d8dede8 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 18 Sep 2020 12:24:06 -0600 Subject: [PATCH 45/45] Add missing options --- docs/config.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/config.md b/docs/config.md index 5ea177388f..e557a79214 100644 --- a/docs/config.md +++ b/docs/config.md @@ -101,6 +101,15 @@ For a good example, see https://develop.element.io/config.json. Defaults to false (3rd party identity options are shown). 1. `default_federate`: Default option for room federation when creating a room Defaults to true (room federation enabled). +1. `desktopBuilds`: Used to alter promotional links to the desktop app. By default + the builds are considered available and accessible from https://element.io. This + config option is typically used in the context of encouraging encrypted message + search capabilities (Seshat). All the options listed below are required if this + option is specified. + 1. `available`: When false, the desktop app will not be promoted to the user. + 1. `logo`: An HTTP URL to the avatar for the desktop build. Should be 24x24, ideally + an SVG. + 1. `url`: An HTTP URL for where to send the user to download the desktop build. Note that `index.html` also has an og:image meta tag that is set to an image hosted on riot.im. This is the image used if links to your copy of Element @@ -181,3 +190,5 @@ Currently, the following UI feature flags are supported: useful if accounts are managed externally. * `UIFeature.deactivate` - Whether or not the deactivate account button is accessible. Typically useful if accounts are managed externally. +* `UIFeature.advancedEncryption` - Whether or not advanced encryption options are shown to the + user.