From 3302469a2b4368500d20840a1f101781b5ef3711 Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 24 Feb 2020 18:04:11 +0000 Subject: [PATCH 001/749] Catch errors sooner so users can recover more easily --- res/css/views/rooms/_EventTile.scss | 14 ++++ src/components/structures/MessagePanel.js | 76 ++++++++++--------- .../views/messages/TileErrorBoundary.js | 70 +++++++++++++++++ src/i18n/strings/en_EN.json | 1 + 4 files changed, 126 insertions(+), 35 deletions(-) create mode 100644 src/components/views/messages/TileErrorBoundary.js diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index d292c729dd..68aca63459 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -653,3 +653,17 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { } } } + +.mx_EventTile_tileError { + color: red; + + .mx_EventTile_line span { + padding: 4px 8px; + border-radius: 11px; + box-shadow: 0px 0px 3px red inset; + } + + a { + margin-left: 1em; + } +} \ No newline at end of file diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index b8b11fbb31..e6f8de61a9 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -502,6 +502,7 @@ export default class MessagePanel extends React.Component { } _getTilesForEvent(prevEvent, mxEv, last) { + const TileErrorBoundary = sdk.getComponent('messages.TileErrorBoundary'); const EventTile = sdk.getComponent('rooms.EventTile'); const DateSeparator = sdk.getComponent('messages.DateSeparator'); const ret = []; @@ -575,25 +576,27 @@ export default class MessagePanel extends React.Component { ref={this._collectEventNode.bind(this, eventId)} data-scroll-tokens={scrollToken} > - + + + , ); @@ -755,6 +758,7 @@ export default class MessagePanel extends React.Component { } render() { + const ErrorBoundary = sdk.getComponent('elements.ErrorBoundary'); const ScrollPanel = sdk.getComponent("structures.ScrollPanel"); const WhoIsTypingTile = sdk.getComponent("rooms.WhoIsTypingTile"); const Spinner = sdk.getComponent("elements.Spinner"); @@ -787,22 +791,24 @@ export default class MessagePanel extends React.Component { } return ( - - { topSpinner } - { this._getEventTiles() } - { whoIsTyping } - { bottomSpinner } - + + + { topSpinner } + { this._getEventTiles() } + { whoIsTyping } + { bottomSpinner } + + ); } } diff --git a/src/components/views/messages/TileErrorBoundary.js b/src/components/views/messages/TileErrorBoundary.js new file mode 100644 index 0000000000..372d402899 --- /dev/null +++ b/src/components/views/messages/TileErrorBoundary.js @@ -0,0 +1,70 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from 'react'; +import classNames from 'classnames'; +import { _t } from '../../../languageHandler'; +import * as sdk from '../../../index'; +import Modal from '../../../Modal'; + +export default class TileErrorBoundary extends React.Component { + constructor(props) { + super(props); + + this.state = { + error: null, + }; + } + + static getDerivedStateFromError(error) { + // Side effects are not permitted here, so we only update the state so + // that the next render shows an error message. + return { error }; + } + + _onBugReport = () => { + const BugReportDialog = sdk.getComponent("dialogs.BugReportDialog"); + if (!BugReportDialog) { + return; + } + Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { + label: 'react-soft-crash-tile', + }); + }; + + render() { + if (this.state.error) { + const classes = { + mx_EventTile: true, + mx_EventTile_info: true, + mx_EventTile_content: true, + mx_EventTile_tileError: true, + }; + return (
+
+ + {_t("An error occurred while rendering this event.")} + + {_t("Submit debug logs")} + + +
+
); + } + + return this.props.children; + } +} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1d030f5118..adce7f9a03 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1268,6 +1268,7 @@ "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?": "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?", "Edited at %(date)s. Click to view edits.": "Edited at %(date)s. Click to view edits.", "edited": "edited", + "An error occurred while rendering this event.": "An error occurred while rendering this event.", "Removed or unknown message type": "Removed or unknown message type", "Message removed by %(userId)s": "Message removed by %(userId)s", "Message removed": "Message removed", From 0d03a8791dc6ba1cdb7ec7dd1e0290f09fcc0b7f Mon Sep 17 00:00:00 2001 From: Zoe Date: Tue, 25 Feb 2020 10:20:42 +0000 Subject: [PATCH 002/749] style lint --- res/css/views/rooms/_EventTile.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 68aca63459..9e683c5fe4 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -666,4 +666,4 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { a { margin-left: 1em; } -} \ No newline at end of file +} From adf6dfe4ea831e08730485f85147d9805f711aa8 Mon Sep 17 00:00:00 2001 From: Zoe Date: Tue, 25 Feb 2020 10:30:35 +0000 Subject: [PATCH 003/749] Threaded through the event type to the user --- src/components/structures/MessagePanel.js | 2 +- src/components/views/messages/TileErrorBoundary.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index e6f8de61a9..d35b0fce1f 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -576,7 +576,7 @@ export default class MessagePanel extends React.Component { ref={this._collectEventNode.bind(this, eventId)} data-scroll-tokens={scrollToken} > - + {_t("An error occurred while rendering this event.")} + { mxEvent && ` [${mxEvent.getType()}]` } {_t("Submit debug logs")} From 76104edeca3b8ba37d4a24903fa1e0193dad56c2 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Tue, 24 Mar 2020 21:35:17 -0500 Subject: [PATCH 004/749] Mark room as read when escape is pressed Signed-off-by: Aaron Raimist --- src/components/structures/RoomView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 5fd5f42f78..9405a26ab2 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -560,6 +560,12 @@ export default createReactClass({ handled = true; } break; + + case Key.ESCAPE: + this._messagePanel.forgetReadMarker(); + this.jumpToLiveTimeline(); + handled = true; + break; } if (handled) { From 04849f7f0d91ed9bee30db744d8397cf9e835800 Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 26 Mar 2020 13:47:32 +0000 Subject: [PATCH 005/749] incorporated design feedback --- res/css/views/rooms/_EventTile.scss | 3 +-- src/components/views/messages/TileErrorBoundary.js | 6 +++--- src/i18n/strings/en_EN.json | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 2f89c96d57..59f82808dc 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -661,11 +661,10 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { .mx_EventTile_tileError { color: red; + text-align: center; .mx_EventTile_line span { padding: 4px 8px; - border-radius: 11px; - box-shadow: 0px 0px 3px red inset; } a { diff --git a/src/components/views/messages/TileErrorBoundary.js b/src/components/views/messages/TileErrorBoundary.js index a8e7b144f2..e42ddab16a 100644 --- a/src/components/views/messages/TileErrorBoundary.js +++ b/src/components/views/messages/TileErrorBoundary.js @@ -57,10 +57,10 @@ export default class TileErrorBoundary extends React.Component { return (
- {_t("An error occurred while rendering this event.")} - { mxEvent && ` [${mxEvent.getType()}]` } + {_t("Can't load this message")} + { mxEvent && ` (${mxEvent.getType()})` } - {_t("Submit debug logs")} + {_t("Submit logs")}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index cf170fce62..40b1cab99d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1294,7 +1294,8 @@ "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?": "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?", "Edited at %(date)s. Click to view edits.": "Edited at %(date)s. Click to view edits.", "edited": "edited", - "An error occurred while rendering this event.": "An error occurred while rendering this event.", + "Can't load this message": "Can't load this message", + "Submit logs": "Submit logs", "Removed or unknown message type": "Removed or unknown message type", "Message removed by %(userId)s": "Message removed by %(userId)s", "Message removed": "Message removed", From 36120738525816f8442ab49aded73a7e0f96f766 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 2 Apr 2020 15:12:19 +0100 Subject: [PATCH 006/749] Nuke the icon_person.svg DM Indicator as it causes more confusion than it solves. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/img/icon_person.svg | 23 ------------------- src/components/views/rooms/RoomBreadcrumbs.js | 12 ---------- src/components/views/rooms/RoomTile.js | 14 ----------- 3 files changed, 49 deletions(-) delete mode 100644 res/img/icon_person.svg diff --git a/res/img/icon_person.svg b/res/img/icon_person.svg deleted file mode 100644 index 4be70df0db..0000000000 --- a/res/img/icon_person.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - 815EF7DE-169A-4322-AE2A-B65CBE91DCED - Created with sketchtool. - - - - - - - - - - - - - - - - - - diff --git a/src/components/views/rooms/RoomBreadcrumbs.js b/src/components/views/rooms/RoomBreadcrumbs.js index 1d433c9a40..86c0d7ca96 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.js +++ b/src/components/views/rooms/RoomBreadcrumbs.js @@ -363,17 +363,6 @@ export default class RoomBreadcrumbs extends React.Component { badge =
{r.formattedCount}
; } - let dmIndicator; - if (this._isDmRoom(r.room) && !SettingsStore.isFeatureEnabled("feature_cross_signing")) { - dmIndicator = {_t("Direct; - } - return ( {badge} - {dmIndicator} {tooltip} ); diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 0b06be48af..448f856b50 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -479,20 +479,7 @@ export default createReactClass({ let ariaLabel = name; - let dmIndicator; let dmOnline; - /* Post-cross-signing we don't show DM indicators at all, instead relying on user - context to let them know when that is. */ - if (dmUserId && !SettingsStore.isFeatureEnabled("feature_cross_signing")) { - dmIndicator = dm; - } - const { room } = this.props; const member = room.getMember(dmUserId); if ( @@ -557,7 +544,6 @@ export default createReactClass({
- { dmIndicator } { e2eIcon }
From a28aa4c0b44702ede672f252e161aed37bd7aa03 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 2 Apr 2020 15:13:19 +0100 Subject: [PATCH 007/749] Tweak user online dot in room tile, make it occupy same space and inverse behaviour of the context menu button Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/css/views/rooms/_RoomTile.scss | 31 +++++++++++++++++-------- res/css/views/rooms/_UserOnlineDot.scss | 4 ++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/res/css/views/rooms/_RoomTile.scss b/res/css/views/rooms/_RoomTile.scss index 31d887cbbb..aa8a77de78 100644 --- a/res/css/views/rooms/_RoomTile.scss +++ b/res/css/views/rooms/_RoomTile.scss @@ -24,6 +24,20 @@ limitations under the License. margin: 0; padding: 0 8px 0 10px; position: relative; + + .mx_RoomTile_menuButton { + display: none; + flex: 0 0 16px; + height: 16px; + background-image: url('$(res)/img/icon_context.svg'); + background-repeat: no-repeat; + background-position: center; + } + + .mx_UserOnlineDot { + display: block; + margin-right: 5px; + } } .mx_RoomTile:focus { @@ -31,15 +45,6 @@ limitations under the License. background-color: $roomtile-focused-bg-color; } -.mx_RoomTile_menuButton { - display: none; - flex: 0 0 16px; - height: 16px; - background-image: url('$(res)/img/icon_context.svg'); - background-repeat: no-repeat; - background-position: center; -} - .mx_RoomTile_tooltip { display: inline-block; position: relative; @@ -151,7 +156,10 @@ limitations under the License. } .mx_RoomTile_menuButton { - display: none; //no design for this for now + display: none; // no design for this for now + } + .mx_UserOnlineDot { + display: none; // no design for this for now } } @@ -164,6 +172,9 @@ limitations under the License. .mx_RoomTile_menuButton { display: block; } + .mx_UserOnlineDot { + display: none; + } } .mx_RoomTile_unreadNotify .mx_RoomTile_badge, diff --git a/res/css/views/rooms/_UserOnlineDot.scss b/res/css/views/rooms/_UserOnlineDot.scss index 339e5cc48a..f9da8648ed 100644 --- a/res/css/views/rooms/_UserOnlineDot.scss +++ b/res/css/views/rooms/_UserOnlineDot.scss @@ -17,7 +17,7 @@ limitations under the License. .mx_UserOnlineDot { border-radius: 50%; background-color: $accent-color; - height: 5px; - width: 5px; + height: 6px; + width: 6px; display: inline-block; } From 1ae370b97eca7d9d6ef13b1c05fc6776968528ca Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 2 Apr 2020 15:20:35 +0100 Subject: [PATCH 008/749] Pull feature_presence_in_room_list out of labs. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/RoomTile.js | 5 +---- src/i18n/strings/en_EN.json | 3 +-- src/settings/Settings.js | 6 ------ 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 448f856b50..87d288561c 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -482,10 +482,7 @@ export default createReactClass({ let dmOnline; const { room } = this.props; const member = room.getMember(dmUserId); - if ( - member && member.membership === "join" && room.getJoinedMemberCount() === 2 && - SettingsStore.isFeatureEnabled("feature_presence_in_room_list") - ) { + if (member && member.membership === "join" && room.getJoinedMemberCount() === 2) { const UserOnlineDot = sdk.getComponent('rooms.UserOnlineDot'); dmOnline = ; } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 24a6568d82..163b3ad341 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -393,7 +393,6 @@ "Render simple counters in room header": "Render simple counters in room header", "Multiple integration managers": "Multiple integration managers", "Try out new ways to ignore people (experimental)": "Try out new ways to ignore people (experimental)", - "Show a presence dot next to DMs in the room list": "Show a presence dot next to DMs in the room list", "Support adding custom themes": "Support adding custom themes", "Enable cross-signing to verify per-user instead of per-session (in development)": "Enable cross-signing to verify per-user instead of per-session (in development)", "Enable local event indexing and E2EE search (requires restart)": "Enable local event indexing and E2EE search (requires restart)", @@ -1075,7 +1074,6 @@ "Seen by %(userName)s at %(dateTime)s": "Seen by %(userName)s at %(dateTime)s", "Seen by %(displayName)s (%(userName)s) at %(dateTime)s": "Seen by %(displayName)s (%(userName)s) at %(dateTime)s", "Replying": "Replying", - "Direct Chat": "Direct Chat", "Room %(name)s": "Room %(name)s", "Recent rooms": "Recent rooms", "No rooms to show": "No rooms to show", @@ -1815,6 +1813,7 @@ "Forget": "Forget", "Favourite": "Favourite", "Low Priority": "Low Priority", + "Direct Chat": "Direct Chat", "Clear status": "Clear status", "Update status": "Update status", "Set status": "Set status", diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 0d72017878..df3bf91b17 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -131,12 +131,6 @@ export const SETTINGS = { supportedLevels: LEVELS_FEATURE, default: false, }, - "feature_presence_in_room_list": { - isFeature: true, - displayName: _td("Show a presence dot next to DMs in the room list"), - supportedLevels: LEVELS_FEATURE, - default: false, - }, "feature_custom_themes": { isFeature: true, displayName: _td("Support adding custom themes"), From 1395cb02edaab4f9f589814cc58e79cdc261ab1d Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 6 Apr 2020 11:44:46 +0100 Subject: [PATCH 009/749] Fixup alignment --- res/css/views/rooms/_EventTile.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 0f324cc082..3c91089dc9 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -665,6 +665,13 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { color: red; text-align: center; + // Remove some of the default tile padding so that the error is centered + margin-right: 0; + .mx_EventTile_line { + padding-left: 0; + margin-right: 0; + } + .mx_EventTile_line span { padding: 4px 8px; } From 6095a00703cd320281a432d65b80eca9027167a9 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 8 Apr 2020 13:52:46 +0100 Subject: [PATCH 010/749] Upgrade matrix-js-sdk to 5.3.0-rc.1 --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 616f3f541e..d610b35692 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.6", "lodash": "^4.17.14", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "5.3.0-rc.1", "minimist": "^1.2.0", "pako": "^1.0.5", "png-chunks-extract": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 0391132786..bf43c92bde 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5689,9 +5689,10 @@ mathml-tag-names@^2.0.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@github:matrix-org/matrix-js-sdk#develop": - version "5.2.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/934ed37fdc90948273d7da3ec9f8728195c78a63" +matrix-js-sdk@5.3.0-rc.1: + version "5.3.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-5.3.0-rc.1.tgz#9a962a0c821266e02e214591e9cbe58b102945a0" + integrity sha512-k/4xw114zk2ugAUkKDL51tN7bmddvNPYek0nttnipgnooU7HLnojRiMvTzSROkqNwic+8iRx7F2xn/hPCKGTvg== dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From 9a1ac39f495f6e3430f510bb6a98307b475435ce Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 8 Apr 2020 13:59:22 +0100 Subject: [PATCH 011/749] Prepare changelog for v2.4.0-rc.1 --- CHANGELOG.md | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6f25f1858..e9f7c0eddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,164 @@ +Changes in [2.4.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.4.0-rc.1) (2020-04-08) +============================================================================================================= +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.3.1...v2.4.0-rc.1) + + * Upgrade to JS SDK to 5.3.0-rc.1 + * EventIndex: Log if we had all events in a checkpoint but are continuing. + [\#4363](https://github.com/matrix-org/matrix-react-sdk/pull/4363) + * Update from Weblate + [\#4364](https://github.com/matrix-org/matrix-react-sdk/pull/4364) + * Support deactivating your account with SSO + [\#4356](https://github.com/matrix-org/matrix-react-sdk/pull/4356) + * Add debug status for cached backup key format + [\#4359](https://github.com/matrix-org/matrix-react-sdk/pull/4359) + * Fix composer placeholder not updating + [\#4361](https://github.com/matrix-org/matrix-react-sdk/pull/4361) + * Fix sas verification buttons to match figma + [\#4358](https://github.com/matrix-org/matrix-react-sdk/pull/4358) + * Don't show fallback text for verification requests + [\#4345](https://github.com/matrix-org/matrix-react-sdk/pull/4345) + * Fix share dialog correctly + [\#4360](https://github.com/matrix-org/matrix-react-sdk/pull/4360) + * Use singular copy when only deleting one device + [\#4357](https://github.com/matrix-org/matrix-react-sdk/pull/4357) + * Deem m.sticker events as actionable for reacting + [\#4288](https://github.com/matrix-org/matrix-react-sdk/pull/4288) + * Don't show spinner over encryption setup dialogs + [\#4354](https://github.com/matrix-org/matrix-react-sdk/pull/4354) + * Support Jitsi information from client .well-known + [\#4348](https://github.com/matrix-org/matrix-react-sdk/pull/4348) + * Add new default home page fallback + [\#4350](https://github.com/matrix-org/matrix-react-sdk/pull/4350) + * Check more account data in toast listener + [\#4351](https://github.com/matrix-org/matrix-react-sdk/pull/4351) + * Don't try to send presence updates until the client is started + [\#4353](https://github.com/matrix-org/matrix-react-sdk/pull/4353) + * Fix copy button on code blocks when there is no code tag just pre + [\#4352](https://github.com/matrix-org/matrix-react-sdk/pull/4352) + * Clear sessionStorage on sign out + [\#4346](https://github.com/matrix-org/matrix-react-sdk/pull/4346) + * Re-request room keys after auth + [\#4341](https://github.com/matrix-org/matrix-react-sdk/pull/4341) + * Update emojibase for fixed emoji codepoints and Emoji 13 support + [\#4344](https://github.com/matrix-org/matrix-react-sdk/pull/4344) + * App load order tweaks for code splitting + [\#4343](https://github.com/matrix-org/matrix-react-sdk/pull/4343) + * Fix alignment of e2e icon in userinfo and expose full displayname in title + [\#4312](https://github.com/matrix-org/matrix-react-sdk/pull/4312) + * Adjust copy & UX for self-verification + [\#4342](https://github.com/matrix-org/matrix-react-sdk/pull/4342) + * QR code reciprocation + [\#4334](https://github.com/matrix-org/matrix-react-sdk/pull/4334) + * Fix Hangul typing does not work properly + [\#4339](https://github.com/matrix-org/matrix-react-sdk/pull/4339) + * Fix: dismiss setup encryption toast if cross-signing is ready + [\#4336](https://github.com/matrix-org/matrix-react-sdk/pull/4336) + * Fix read marker visibility for grouped events + [\#4340](https://github.com/matrix-org/matrix-react-sdk/pull/4340) + * Make all 'font-size's and 'line-height's rem + [\#4305](https://github.com/matrix-org/matrix-react-sdk/pull/4305) + * Fix spurious extra devices on registration + [\#4337](https://github.com/matrix-org/matrix-react-sdk/pull/4337) + * Fix the edit messager composer + [\#4333](https://github.com/matrix-org/matrix-react-sdk/pull/4333) + * Fix Room Settings Dialog Notifications tab icon + [\#4321](https://github.com/matrix-org/matrix-react-sdk/pull/4321) + * Fix various cases of React warnings by silencing them + [\#4331](https://github.com/matrix-org/matrix-react-sdk/pull/4331) + * Only apply padding to standard textual buttons (kind buttons) + [\#4332](https://github.com/matrix-org/matrix-react-sdk/pull/4332) + * Use console.log in place of console.warn for less warnings + [\#4330](https://github.com/matrix-org/matrix-react-sdk/pull/4330) + * Revert componentDidMount changes on breadcrumbs + [\#4329](https://github.com/matrix-org/matrix-react-sdk/pull/4329) + * Use new method for checking secret storage key + [\#4309](https://github.com/matrix-org/matrix-react-sdk/pull/4309) + * Label and use UNSAFE_componentWillMount to minimize warnings + [\#4315](https://github.com/matrix-org/matrix-react-sdk/pull/4315) + * Fix a number of minor code quality issues + [\#4314](https://github.com/matrix-org/matrix-react-sdk/pull/4314) + * Use componentDidMount in place of componentWillMount where possible + [\#4313](https://github.com/matrix-org/matrix-react-sdk/pull/4313) + * EventIndex: Mark the initial checkpoints for a full crawl. + [\#4325](https://github.com/matrix-org/matrix-react-sdk/pull/4325) + * Fix UserInfo e2e buttons to match Figma + [\#4320](https://github.com/matrix-org/matrix-react-sdk/pull/4320) + * Only auto-scroll to RoomTile when clicking on RoomTile or via shortcuts + [\#4316](https://github.com/matrix-org/matrix-react-sdk/pull/4316) + * Support SSO for interactive authentication + [\#4292](https://github.com/matrix-org/matrix-react-sdk/pull/4292) + * Fix /invite Slash Command + [\#4328](https://github.com/matrix-org/matrix-react-sdk/pull/4328) + * Fix jitsi popout URL + [\#4326](https://github.com/matrix-org/matrix-react-sdk/pull/4326) + * Use our own jitsi widget for the popout URL + [\#4323](https://github.com/matrix-org/matrix-react-sdk/pull/4323) + * Fix popout support for jitsi widgets + [\#4319](https://github.com/matrix-org/matrix-react-sdk/pull/4319) + * Fix: legacy verify user throwing error + [\#4318](https://github.com/matrix-org/matrix-react-sdk/pull/4318) + * Document settingDefaults + [\#3046](https://github.com/matrix-org/matrix-react-sdk/pull/3046) + * Fix Ctrl+/ for Finnish keyboard where it includes Shift + [\#4317](https://github.com/matrix-org/matrix-react-sdk/pull/4317) + * Rework SlashCommands to better expose aliases + [\#4302](https://github.com/matrix-org/matrix-react-sdk/pull/4302) + * Fix EventListSummary when RR rendering is disabled + [\#4311](https://github.com/matrix-org/matrix-react-sdk/pull/4311) + * Update link to css location. + [\#4299](https://github.com/matrix-org/matrix-react-sdk/pull/4299) + * Fix peeking keeping two timeline update mechanisms in play + [\#4310](https://github.com/matrix-org/matrix-react-sdk/pull/4310) + * Pass new secret storage key to bootstrap path + [\#4308](https://github.com/matrix-org/matrix-react-sdk/pull/4308) + * Show red shield for users that become unverified + [\#4303](https://github.com/matrix-org/matrix-react-sdk/pull/4303) + * Accessibility fixed for Event List Summary and Composer Format Bar + [\#4295](https://github.com/matrix-org/matrix-react-sdk/pull/4295) + * Support $riot: Templates for SSO/CAS urls in the welcome.html page + [\#4279](https://github.com/matrix-org/matrix-react-sdk/pull/4279) + * Added the /html command + [\#4296](https://github.com/matrix-org/matrix-react-sdk/pull/4296) + * EventIndex: Better logging on how many events are added. + [\#4301](https://github.com/matrix-org/matrix-react-sdk/pull/4301) + * Field: mark id as optional in propTypes + [\#4307](https://github.com/matrix-org/matrix-react-sdk/pull/4307) + * Fix view community link icon contrast + [\#4254](https://github.com/matrix-org/matrix-react-sdk/pull/4254) + * Remove underscore from Jitsi conference names + [\#4304](https://github.com/matrix-org/matrix-react-sdk/pull/4304) + * Refactor shield display logic; changed rules for DMs + [\#4290](https://github.com/matrix-org/matrix-react-sdk/pull/4290) + * Fix: bring back global thin scrollbars + [\#4300](https://github.com/matrix-org/matrix-react-sdk/pull/4300) + * Keyboard shortcuts: Escape cancel reply and fix Ctrl+K + [\#4297](https://github.com/matrix-org/matrix-react-sdk/pull/4297) + * Field: make id optional, generate one if not provided + [\#4298](https://github.com/matrix-org/matrix-react-sdk/pull/4298) + * Fix ugly scrollbars in TabbedView (settings), emojipicker and widgets + [\#4293](https://github.com/matrix-org/matrix-react-sdk/pull/4293) + * Rename secret storage force-reset variable to avoid confusion + [\#4274](https://github.com/matrix-org/matrix-react-sdk/pull/4274) + * Fix: can't dismiss unverified session toast when encryption hasn't been + upgraded + [\#4291](https://github.com/matrix-org/matrix-react-sdk/pull/4291) + * Blank out UserInfo avatar when changing between members + [\#4289](https://github.com/matrix-org/matrix-react-sdk/pull/4289) + * Add cancel button to verification panel + [\#4283](https://github.com/matrix-org/matrix-react-sdk/pull/4283) + * Show ongoing verification request straight away when navigating to member + [\#4284](https://github.com/matrix-org/matrix-react-sdk/pull/4284) + * Fix: allow scrolling while window is not focused & remove scrollbar hack + [\#4276](https://github.com/matrix-org/matrix-react-sdk/pull/4276) + * Show whether backup key is cached + [\#4287](https://github.com/matrix-org/matrix-react-sdk/pull/4287) + * Rename unverified session toast + [\#4285](https://github.com/matrix-org/matrix-react-sdk/pull/4285) + * Fix: pick last active DM for verification request + [\#4286](https://github.com/matrix-org/matrix-react-sdk/pull/4286) + * Fix formatBar not hidden after highlight and backspacing some text + [\#4269](https://github.com/matrix-org/matrix-react-sdk/pull/4269) + Changes in [2.3.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.3.1) (2020-04-01) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.3.0...v2.3.1) From 0d1b7b99631e8ce526fb169e02b86f805c92826b Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 8 Apr 2020 13:59:23 +0100 Subject: [PATCH 012/749] v2.4.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d610b35692..0a9f081998 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "2.3.1", + "version": "2.4.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 197a2145b6e25c613fa5c8a1305a9244d22adc05 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Thu, 9 Apr 2020 03:00:58 +0000 Subject: [PATCH 013/749] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (2282 of 2282 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/zh_Hant/ --- src/i18n/strings/zh_Hant.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index 46d32a2af5..668e3ed158 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -2344,5 +2344,14 @@ "Liberate your communication": "讓您的通訊自由", "Send a Direct Message": "傳送直接訊息", "Explore Public Rooms": "探索公開聊天室", - "Create a Group Chat": "建立群組聊天" + "Create a Group Chat": "建立群組聊天", + "%(name)s is requesting verification": "%(name)s 正在要求驗證", + "well formed": "結構良好", + "unexpected type": "預料之外的類型", + "Confirm your account deactivation by using Single Sign On to prove your identity.": "透過使用單一登入系統來證您的身份以確認刪除您的帳號。", + "Are you sure you want to deactivate your account? This is irreversible.": "您確定您想要停用您的帳號嗎?此為不可逆的操作。", + "Confirm account deactivation": "確認停用帳號", + "Server did not require any authentication": "伺服器不需要任何驗證", + "Server did not return valid authentication information.": "伺服器沒有回傳有效的驗證資訊。", + "There was a problem communicating with the server. Please try again.": "與伺服器通訊時發生問題。請再試一次。" } From 75a665ec2ed319cd31ac78b604a1a221e97637cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20C?= Date: Thu, 9 Apr 2020 06:49:35 +0000 Subject: [PATCH 014/749] Translated using Weblate (French) Currently translated at 100.0% (2282 of 2282 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/ --- src/i18n/strings/fr.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index c4343432d2..ea885c6202 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -2345,5 +2345,14 @@ "Liberate your communication": "Libérez votre communication", "Send a Direct Message": "Envoyez un message direct", "Explore Public Rooms": "Explorez les salons publics", - "Create a Group Chat": "Créez une discussion de groupe" + "Create a Group Chat": "Créez une discussion de groupe", + "%(name)s is requesting verification": "%(name)s demande une vérification", + "well formed": "bien formée", + "unexpected type": "type inattendu", + "Confirm your account deactivation by using Single Sign On to prove your identity.": "Confirmez la désactivation de votre compte en utilisant l’authentification unique pour prouver votre identité.", + "Are you sure you want to deactivate your account? This is irreversible.": "Voulez-vous vraiment désactiver votre compte ? Ceci est irréversible.", + "Confirm account deactivation": "Confirmez la désactivation de votre compte", + "Server did not require any authentication": "Le serveur n’a pas demandé d’authentification", + "Server did not return valid authentication information.": "Le serveur n’a pas renvoyé des informations d’authentification valides.", + "There was a problem communicating with the server. Please try again.": "Un problème est survenu en essayant de communiquer avec le serveur. Veuillez réessayer." } From e1a496f231619c7c2dde03f6b5be35cb9e89e4c2 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 9 Apr 2020 17:30:10 +0100 Subject: [PATCH 015/749] Pass along key backup for bootstrap If we ask for the key backup key early in creating secret storage to ensure we trust the backup, then we stash it to ensure it's available to bootstrap as well without prompting again. Fixes https://github.com/vector-im/riot-web/issues/12958 --- src/CrossSigningManager.js | 2 +- .../CreateSecretStorageDialog.js | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/CrossSigningManager.js b/src/CrossSigningManager.js index 1bcf1ba706..07ec776bd1 100644 --- a/src/CrossSigningManager.js +++ b/src/CrossSigningManager.js @@ -185,7 +185,7 @@ export async function promptForBackupPassphrase() { const RestoreKeyBackupDialog = sdk.getComponent('dialogs.keybackup.RestoreKeyBackupDialog'); const { finished } = Modal.createTrackedDialog('Restore Backup', '', RestoreKeyBackupDialog, { - showSummary: false, keyCallback: k => key = k, + showSummary: false, keyCallback: k => key = k, }, null, /* priority = */ false, /* static = */ true); const success = await finished; diff --git a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js index 01a2856df0..d63db617d5 100644 --- a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js @@ -70,6 +70,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent { this._recoveryKey = null; this._recoveryKeyNode = null; this._setZxcvbnResultTimeout = null; + this._backupKey = null; this.state = { phase: PHASE_LOADING, @@ -243,7 +244,15 @@ export default class CreateSecretStorageDialog extends React.PureComponent { createSecretStorageKey: async () => this._recoveryKey, keyBackupInfo: this.state.backupInfo, setupNewKeyBackup: !this.state.backupInfo && this.state.useKeyBackup, - getKeyBackupPassphrase: promptForBackupPassphrase, + getKeyBackupPassphrase: () => { + // We may already have the backup key if we earlier went + // through the restore backup path, so pass it along + // rather than prompting again. + if (this._backupKey) { + return this._backupKey; + } + return promptForBackupPassphrase(); + }, }); } this.setState({ @@ -272,10 +281,18 @@ export default class CreateSecretStorageDialog extends React.PureComponent { } _restoreBackup = async () => { + // It's possible we'll need the backup key later on for bootstrapping, + // so let's stash it here, rather than prompting for it twice. + const keyCallback = k => this._backupKey = k; + const RestoreKeyBackupDialog = sdk.getComponent('dialogs.keybackup.RestoreKeyBackupDialog'); const { finished } = Modal.createTrackedDialog( - 'Restore Backup', '', RestoreKeyBackupDialog, {showSummary: false}, null, - /* priority = */ false, /* static = */ false, + 'Restore Backup', '', RestoreKeyBackupDialog, + { + showSummary: false, + keyCallback, + }, + null, /* priority = */ false, /* static = */ false, ); await finished; From 0cd8d067426cd42535504cedaff870ad0299f846 Mon Sep 17 00:00:00 2001 From: Osoitz Date: Thu, 9 Apr 2020 17:51:21 +0000 Subject: [PATCH 016/749] Translated using Weblate (Basque) Currently translated at 100.0% (2284 of 2284 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/eu/ --- src/i18n/strings/eu.json | 53 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/src/i18n/strings/eu.json b/src/i18n/strings/eu.json index 1283a7a379..1edea6c518 100644 --- a/src/i18n/strings/eu.json +++ b/src/i18n/strings/eu.json @@ -1236,8 +1236,8 @@ "%(senderDisplayName)s has prevented guests from joining the room.": "%(senderDisplayName)s bisitariak gelara elkartzea eragotzi du.", "%(senderDisplayName)s changed guest access to %(rule)s": "%(senderDisplayName)s erabiltzaileak bisitarien araua aldatu du: %(rule)s", "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.": "Erabiltzaile honekin dauzkazun mezu seguruak muturretik muturrera zifratuta daude eta ezin ditu beste inork irakurri.", - "Verify this user by confirming the following emoji appear on their screen.": "Baieztatu erabiltzaile hau beheko emojiak bere pantailan agertzen direla egiaztatuz.", - "Verify this user by confirming the following number appears on their screen.": "Baieztatu erabiltzaile hau honako zenbakia bere pantailan agertzen dela egiaztatuz.", + "Verify this user by confirming the following emoji appear on their screen.": "Egiaztatu erabiltzaile hau beheko emojiak bere pantailan agertzen direla baieztatuz.", + "Verify this user by confirming the following number appears on their screen.": "Egiaztatu erabiltzaile hau honako zenbakia bere pantailan agertzen dela baieztatuz.", "Unable to find a supported verification method.": "Ezin izan da onartutako egiaztaketa metodorik aurkitu.", "Thumbs up": "Ederto", "Hourglass": "Harea-erlojua", @@ -2234,7 +2234,7 @@ "Signature upload success": "Sinaduren igoera ongi burutu da", "Signature upload failed": "Sinaduren igoerak huts egin du", "Confirm by comparing the following with the User Settings in your other session:": "Berretsi honako hau zure beste saioaren erabiltzaile-ezarpenetan agertzen denarekin alderatuz:", - "Confirm this user's session by comparing the following with their User Settings:": "Baieztatu erabiltzaile saio hau, honako hau bestearen erabiltzaile-ezarpenekin alderatuz:", + "Confirm this user's session by comparing the following with their User Settings:": "Egiaztatu erabiltzailearen saio hau, honako hau bestearen erabiltzaile-ezarpenekin alderatuz:", "If they don't match, the security of your communication may be compromised.": "Ez badatoz bat, komunikazioaren segurtasuna konprometitua egon daiteke.", "Navigation": "Nabigazioa", "Calls": "Deiak", @@ -2296,5 +2296,50 @@ "Session backup key:": "Saioaren babes-kopia gakoa:", "Sends a message as html, without interpreting it as markdown": "Bidali mezua html gisa, markdown balitz aztertu gabe", "Sign in with SSO": "Hasi saioa SSO-rekin", - "Cancel replying to a message": "Utzi mezua erantzuteari" + "Cancel replying to a message": "Utzi mezua erantzuteari", + "Use Single Sign On to continue": "Erabili Single sign-on jarraitzeko", + "Confirm adding this email address by using Single Sign On to prove your identity.": "Baieztatu e-mail hau gehitzea Single sign-on bidez zure identitatea frogatuz.", + "Single Sign On": "Single sign-on", + "Confirm adding email": "Baieztatu e-maila gehitzea", + "Click the button below to confirm adding this email address.": "Sakatu beheko botoia e-mail helbide hau gehitzea berresteko.", + "Confirm adding this phone number by using Single Sign On to prove your identity.": "Baieztatu telefono zenbaki hau gehitzea Single sign-on bidez zure identitatea frogatuz.", + "Confirm adding phone number": "Berretsi telefono zenbakia gehitzea", + "Click the button below to confirm adding this phone number.": "Sakatu beheko botoia telefono zenbaki hau gehitzea berresteko.", + "%(name)s is requesting verification": "%(name)s egiaztaketa eskatzen ari da", + "Confirm the emoji below are displayed on both sessions, in the same order:": "Baieztatu beheko emojiak bi saioetan ikusten direla, ordena berean:", + "Verify this session by confirming the following number appears on its screen.": "Egiaztatu saio hau honako zenbakia bere pantailan agertzen dela baieztatuz.", + "Waiting for your other session, %(deviceName)s (%(deviceId)s), to verify…": "Beste saioaren zain, %(deviceName)s (%(deviceId)s), egiaztatzeko…", + "From %(deviceName)s (%(deviceId)s)": "%(deviceName)s (%(deviceId)s) gailutik", + "well formed": "ongi osatua", + "unexpected type": "ustekabeko mota", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|other": "Berretsi saio hauek ezabatzea Single sign-on bidez zure identitatea frogatuz.", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|one": "Berretsi saio hau ezabatzea Single sign-on bidez zure identitatea frogatuz.", + "Confirm deleting these sessions": "Berretsi saio hauek ezabatzea", + "Click the button below to confirm deleting these sessions.|other": "Sakatu beheko botoia saio hauek ezabatzea berresteko.", + "Click the button below to confirm deleting these sessions.|one": "Sakatu beheko botoia saio hau ezabatzea berresteko.", + "Delete sessions": "Ezabatu saioak", + "Waiting for you to accept on your other session…": "Zu beste saioa onartu bitartean zain…", + "Almost there! Is your other session showing the same shield?": "Ia amaitu duzu! Zure beste saioak ezkutu bera erakusten du?", + "Almost there! Is %(displayName)s showing the same shield?": "Ia amaitu duzu! %(displayName)s gailuak ezkutu bera erakusten du?", + "You've successfully verified %(deviceName)s (%(deviceId)s)!": "Ongi egiaztatu duzu %(deviceName)s (%(deviceId)s)!", + "Start verification again from the notification.": "Hasi egiaztaketa berriro jakinarazpenetik.", + "Start verification again from their profile.": "Hasi egiaztaketa berriro bere profiletik.", + "Verification timed out.": "Egiaztaketarako denbora-muga agortu da.", + "You cancelled verification on your other session.": "Egiaztaketa ezeztatu duzu zure beste saioan.", + "%(displayName)s cancelled verification.": "%(displayName)s-k egiaztaketa ezeztatu du.", + "You cancelled verification.": "Egiaztaketa ezeztatu duzu.", + "Enable end-to-end encryption": "Gaitu muturretik-muturrera zifratzea", + "You can’t disable this later. Bridges & most bots won’t work yet.": "Ezin duzu hau gero desgaitu: Zubiak eta bot gehienak ez dabiltza oraindik.", + "Confirm your account deactivation by using Single Sign On to prove your identity.": "Berretsi zure kontua desgaitzea Single sign-on bidez zure identitatea frogatuz.", + "Are you sure you want to deactivate your account? This is irreversible.": "Ziur kontua desaktibatu nahi duzula? Ez dago gero atzera egiterik.", + "Confirm account deactivation": "Baieztatu kontua desaktibatzea", + "Server did not require any authentication": "Zerbitzariak ez du autentifikaziorik eskatu", + "Server did not return valid authentication information.": "Zerbitzariak ez du baliozko autentifikazio informaziorik itzuli.", + "There was a problem communicating with the server. Please try again.": "Arazo bat egon da zerbitzariarekin komunikatzeko. Saiatu berriro.", + "Welcome to %(appName)s": "Ongi etorri %(appName)s-era", + "Liberate your communication": "Askatu zure komunikazioa", + "Send a Direct Message": "Bidali mezu zuzena", + "Explore Public Rooms": "Arakatu gela publikoak", + "Create a Group Chat": "Sortu talde-txata", + "Self-verification request": "Auto-egiaztaketa eskaria" } From 474e46fcca32aed60efcd88cd56622960b2e95d3 Mon Sep 17 00:00:00 2001 From: Tuomas Hietala Date: Thu, 9 Apr 2020 16:51:44 +0000 Subject: [PATCH 017/749] Translated using Weblate (Finnish) Currently translated at 91.7% (2094 of 2284 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fi/ --- src/i18n/strings/fi.json | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fi.json b/src/i18n/strings/fi.json index 797acf90a6..11d4a33545 100644 --- a/src/i18n/strings/fi.json +++ b/src/i18n/strings/fi.json @@ -2106,5 +2106,39 @@ "Esc": "Esc", "Enter": "Enter", "Space": "Välilyönti", - "End": "End" + "End": "End", + "Use Single Sign On to continue": "Jatka kertakirjautumista käyttäen", + "Confirm adding this email address by using Single Sign On to prove your identity.": "Vahvista tämän sähköpostiosoitteen lisääminen todistamalla henkilöllisyytesi kertakirjautumista käyttäen.", + "Single Sign On": "Kertakirjautuminen", + "Confirm adding email": "Vahvista sähköpostin lisääminen", + "Confirm adding this phone number by using Single Sign On to prove your identity.": "Vahvista tämän puhelinnumeron lisääminen todistamalla henkilöllisyytesi kertakirjautumista käyttäen.", + "Confirm adding phone number": "Vahvista puhelinnumeron lisääminen", + "From %(deviceName)s (%(deviceId)s)": "Laitteelta %(deviceName)s (%(deviceId)s)", + "cached locally": "paikallisessa välimuistissa", + "not found locally": "ei paikallisessa välimuistissa", + "exists": "on olemassa", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|other": "Vahvista näiden istuntojen poistaminen todistamalla henkilöllisyytesi kertakirjautumista käyttäen.", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|one": "Vahvista tämän istunnon poistaminen todistamalla henkilöllisyytesi kertakirjautumista käyttäen.", + "Confirm deleting these sessions": "Vahvista näiden istuntojen poistaminen", + "Delete sessions": "Poista istunnot", + "You can use /help to list available commands. Did you mean to send this as a message?": "/help näyttää luettelon käytettävissä olevista komennoista. Oliko tarkoituksesi lähettää se viestinä?", + "Hint: Begin your message with // to start it with a slash.": "Vinkki: // aloittaa viestin kauttaviivalla.", + "Published Addresses": "Julkaistut osoitteet", + "Published addresses can be used by anyone on any server to join your room. To publish an address, it needs to be set as a local address first.": "Kuka tahansa millä tahansa palvelimella voi käyttää julkaistuja osoitteita liittyäksesi huoneeseesi. Osoitteen julkaisemiseksi se on ensin asetettava paikalliseksi osoitteeksi.", + "Other published addresses:": "Muut julkaistut osoitteet:", + "No other published addresses yet, add one below": "Toistaiseksi ei muita julkaistuja osoitteita, lisää alle", + "New published address (e.g. #alias:server)": "Uusi julkaistu osoite (esim. #alias:palvelin)", + "Ask %(displayName)s to scan your code:": "Pyydä käyttäjää %(displayName)s lukemaan koodisi:", + "Matrix rooms": "Matrix-huoneet", + "The internet connection either session is using": "Jomman kumman istunnon käyttämä internet-yhteys", + "Sign in with SSO": "Kirjaudu kertakirjautumista käyttäen", + "Welcome to %(appName)s": "Tervetuloa %(appName)s-sovellukseen", + "Liberate your communication": "Vapauta viestintäsi", + "Send a Direct Message": "Lähetä yksityisviesti", + "Explore Public Rooms": "Selaa julkisia huoneita", + "Create a Group Chat": "Luo ryhmäkeskustelu", + "Secure your encryption keys with a passphrase. For maximum security this should be different to your account password:": "Suojaa salausavaimesi salalauseella. Parhaan turvallisuuden takaamiseksi sen tulisi olla eri kuin käyttäjätilisi salasana:", + "Super": "Super", + "Cancel replying to a message": "Peruuta viestiin vastaaminen", + "Jump to room search": "Siirry huonehakuun" } From 34be024b21c2c52a2c77c74b084e8752e8c66d4d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Apr 2020 14:47:20 -0600 Subject: [PATCH 018/749] Minimize widgets by default Fixes https://github.com/vector-im/riot-web/issues/12921 --- src/components/structures/RoomView.js | 11 +++-------- src/components/views/rooms/AppsDrawer.js | 6 ++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 90bf3a5a99..78bd34bf7f 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -49,7 +49,6 @@ import RoomViewStore from '../../stores/RoomViewStore'; import RoomScrollStateStore from '../../stores/RoomScrollStateStore'; import WidgetEchoStore from '../../stores/WidgetEchoStore'; import SettingsStore, {SettingLevel} from "../../settings/SettingsStore"; -import WidgetUtils from '../../utils/WidgetUtils'; import AccessibleButton from "../views/elements/AccessibleButton"; import RightPanelStore from "../../stores/RightPanelStore"; import {haveTileForEvent} from "../views/rooms/EventTile"; @@ -406,13 +405,9 @@ export default createReactClass({ const hideWidgetDrawer = localStorage.getItem( room.roomId + "_hide_widget_drawer"); - if (hideWidgetDrawer === "true") { - return false; - } - - const widgets = WidgetEchoStore.getEchoedRoomWidgets(room.roomId, WidgetUtils.getRoomWidgets(room)); - - return widgets.length > 0 || WidgetEchoStore.roomHasPendingWidgets(room.roomId, WidgetUtils.getRoomWidgets(room)); + // This is confusing, but it means to say that we default to the tray being + // hidden unless the user clicked to open it. + return hideWidgetDrawer === "false"; }, componentDidMount: function() { diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index f7c5e8122f..b64eb33435 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -81,12 +81,14 @@ export default createReactClass({ const hideWidgetKey = this.props.room.roomId + '_hide_widget_drawer'; switch (action.action) { case 'appsDrawer': + // Note: these booleans are awkward because localstorage is fundamentally + // string-based. We also do exact equality on the strings later on. if (action.show) { - localStorage.removeItem(hideWidgetKey); + localStorage.setItem(hideWidgetKey, "false"); } else { // Store hidden state of widget // Don't show if previously hidden - localStorage.setItem(hideWidgetKey, true); + localStorage.setItem(hideWidgetKey, "true"); } break; From dc92f557fd8ec8e65b7088a006dd993071c002ed Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Apr 2020 15:11:57 -0600 Subject: [PATCH 019/749] Support m.jitsi-typed widgets as Jitsi widgets Fixes https://github.com/vector-im/riot-web/issues/9268 --- src/CallHandler.js | 10 ++++----- src/components/views/elements/AppTile.js | 7 ++++--- src/stores/WidgetEchoStore.js | 5 +++-- src/utils/WidgetUtils.js | 22 +++++++++++++++----- src/widgets/WidgetType.ts | 26 ++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 src/widgets/WidgetType.ts diff --git a/src/CallHandler.js b/src/CallHandler.js index c63bfe309a..2bfe10850a 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -66,6 +66,7 @@ import WidgetEchoStore from './stores/WidgetEchoStore'; import SettingsStore, { SettingLevel } from './settings/SettingsStore'; import {generateHumanReadableId} from "./utils/NamingUtils"; import {Jitsi} from "./widgets/Jitsi"; +import {WidgetType} from "./widgets/WidgetType"; global.mxCalls = { //room_id: MatrixCall @@ -401,9 +402,9 @@ async function _startCallApp(roomId, type) { }); const room = MatrixClientPeg.get().getRoom(roomId); - const currentRoomWidgets = WidgetUtils.getRoomWidgets(room); + const currentJitsiWidgets = WidgetUtils.getRoomWidgetsOfType(room, WidgetType.JITSI); - if (WidgetEchoStore.roomHasPendingWidgetsOfType(roomId, currentRoomWidgets, 'jitsi')) { + if (WidgetEchoStore.roomHasPendingWidgetsOfType(roomId, currentJitsiWidgets, WidgetType.JITSI)) { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call already in progress', '', ErrorDialog, { @@ -413,9 +414,6 @@ async function _startCallApp(roomId, type) { return; } - const currentJitsiWidgets = currentRoomWidgets.filter((ev) => { - return ev.getContent().type === 'jitsi'; - }); if (currentJitsiWidgets.length > 0) { console.warn( "Refusing to start conference call widget in " + roomId + @@ -454,7 +452,7 @@ async function _startCallApp(roomId, type) { Date.now() ); - WidgetUtils.setRoomWidget(roomId, widgetId, 'jitsi', widgetUrl, 'Jitsi', widgetData).then(() => { + WidgetUtils.setRoomWidget(roomId, widgetId, WidgetType.JITSI, widgetUrl, 'Jitsi', widgetData).then(() => { console.log('Jitsi widget added'); }).catch((e) => { if (e.errcode === 'M_FORBIDDEN') { diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 73ed605edd..58bfda8d22 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -38,6 +38,7 @@ import {IntegrationManagers} from "../../../integrations/IntegrationManagers"; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; import {aboveLeftOf, ContextMenu, ContextMenuButton} from "../../structures/ContextMenu"; import PersistedElement from "./PersistedElement"; +import {WidgetType} from "../../../widgets/WidgetType"; const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:']; const ENABLE_REACT_PERF = false; @@ -454,7 +455,7 @@ export default class AppTile extends React.Component { // We only tell Jitsi widgets that we're ready because they're realistically the only ones // using this custom extension to the widget API. - if (this.props.app.type === 'jitsi') { + if (WidgetType.JITSI.matches(this.props.app.type)) { widgetMessaging.flagReadyToContinue(); } }).catch((err) => { @@ -597,7 +598,7 @@ export default class AppTile extends React.Component { _getRenderedUrl() { let url; - if (this.props.app.type === 'jitsi') { + if (WidgetType.JITSI.matches(this.props.app.type)) { console.log("Replacing Jitsi widget URL with local wrapper"); url = WidgetUtils.getLocalJitsiWrapperUrl({forLocalRender: true}); url = this._addWurlParams(url); @@ -608,7 +609,7 @@ export default class AppTile extends React.Component { } _getPopoutUrl() { - if (this.props.app.type === 'jitsi') { + if (WidgetType.JITSI.matches(this.props.app.type)) { return this._templatedUrl( WidgetUtils.getLocalJitsiWrapperUrl({forLocalRender: false}), ); diff --git a/src/stores/WidgetEchoStore.js b/src/stores/WidgetEchoStore.js index 33fa45c635..a5e7b12da0 100644 --- a/src/stores/WidgetEchoStore.js +++ b/src/stores/WidgetEchoStore.js @@ -16,6 +16,7 @@ limitations under the License. */ import EventEmitter from 'events'; +import {WidgetType} from "../widgets/WidgetType"; /** * Acts as a place to get & set widget state, storing local echo state and @@ -64,7 +65,7 @@ class WidgetEchoStore extends EventEmitter { return echoedWidgets; } - roomHasPendingWidgetsOfType(roomId, currentRoomWidgets, type) { + roomHasPendingWidgetsOfType(roomId, currentRoomWidgets, type: WidgetType) { const roomEchoState = Object.assign({}, this._roomWidgetEcho[roomId]); // any widget IDs that are already in the room are not pending, so @@ -79,7 +80,7 @@ class WidgetEchoStore extends EventEmitter { return Object.keys(roomEchoState).length > 0; } else { return Object.values(roomEchoState).some((widget) => { - return widget.type === type; + return type.matches(widget.type); }); } } diff --git a/src/utils/WidgetUtils.js b/src/utils/WidgetUtils.js index 9fb6358c1f..bebed54438 100644 --- a/src/utils/WidgetUtils.js +++ b/src/utils/WidgetUtils.js @@ -29,6 +29,8 @@ import SettingsStore from "../settings/SettingsStore"; import ActiveWidgetStore from "../stores/ActiveWidgetStore"; import {IntegrationManagers} from "../integrations/IntegrationManagers"; import {Capability} from "../widgets/WidgetApi"; +import {Room} from "matrix-js-sdk/src/models/room"; +import {WidgetType} from "../widgets/WidgetType"; export default class WidgetUtils { /* Returns true if user is able to send state events to modify widgets in this room @@ -249,14 +251,16 @@ export default class WidgetUtils { }); } - static setRoomWidget(roomId, widgetId, widgetType, widgetUrl, widgetName, widgetData) { + static setRoomWidget(roomId, widgetId, widgetType: WidgetType, widgetUrl, widgetName, widgetData) { let content; const addingWidget = Boolean(widgetUrl); if (addingWidget) { content = { - type: widgetType, + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) + // For now we'll send the legacy event type for compatibility with older apps/riots + type: widgetType.legacy, url: widgetUrl, name: widgetName, data: widgetData, @@ -279,10 +283,10 @@ export default class WidgetUtils { /** * Get room specific widgets - * @param {object} room The room to get widgets force + * @param {Room} room The room to get widgets force * @return {[object]} Array containing current / active room widgets */ - static getRoomWidgets(room) { + static getRoomWidgets(room: Room) { const appsStateEvents = room.currentState.getStateEvents('im.vector.modular.widgets'); if (!appsStateEvents) { return []; @@ -335,6 +339,14 @@ export default class WidgetUtils { return widgets.filter(w => w.content && w.content.type === "m.integration_manager"); } + static getRoomWidgetsOfType(room: Room, type: WidgetType) { + const widgets = WidgetUtils.getRoomWidgets(room); + return (widgets || []).filter(w => { + const content = w.getContent(); + return content.url && type.matches(content.type); + }); + } + static removeIntegrationManagerWidgets() { const client = MatrixClientPeg.get(); if (!client) { @@ -402,7 +414,7 @@ export default class WidgetUtils { // Obviously anyone that can add a widget can claim it's a jitsi widget, // so this doesn't really offer much over the set of domains we load // widgets from at all, but it probably makes sense for sanity. - if (appType === 'jitsi') { + if (WidgetType.JITSI.matches(appType)) { capWhitelist.push(Capability.AlwaysOnScreen); } diff --git a/src/widgets/WidgetType.ts b/src/widgets/WidgetType.ts new file mode 100644 index 0000000000..7608819bb9 --- /dev/null +++ b/src/widgets/WidgetType.ts @@ -0,0 +1,26 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +export class WidgetType { + public static readonly JITSI = new WidgetType("m.jitsi", "jitsi"); + + constructor(public readonly preferred: string, public readonly legacy: string) { + } + + public matches(type: string): boolean { + return type === this.preferred || type === this.legacy; + } +} From b4b0c4c6dfd944346e7ea82bc607e2f83fcf228a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Apr 2020 15:14:07 -0600 Subject: [PATCH 020/749] Add comments to highlight where we'll need m.widget support For https://github.com/vector-im/riot-web/issues/13111 --- src/ScalarMessaging.js | 2 ++ src/TextForEvent.js | 1 + src/components/views/rooms/EventTile.js | 1 + .../views/settings/tabs/room/RolesRoomSettingsTab.js | 2 ++ src/stores/ActiveWidgetStore.js | 1 + src/utils/WidgetUtils.js | 7 +++++-- test/components/views/rooms/RoomSettings-test.js | 1 + 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 2211e513c3..ca8ca103e1 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -172,6 +172,7 @@ Request: Response: [ { + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) type: "im.vector.modular.widgets", state_key: "wid1", content: { @@ -190,6 +191,7 @@ Example: room_id: "!foo:bar", response: [ { + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) type: "im.vector.modular.widgets", state_key: "wid1", content: { diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 6b1c1dcd2d..3607d7a676 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -603,6 +603,7 @@ const stateHandlers = { 'm.room.guest_access': textForGuestAccessEvent, 'm.room.related_groups': textForRelatedGroupsEvent, + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) 'im.vector.modular.widgets': textForWidgetEvent, }; diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index aed2d4b25b..75fbe5caa3 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -59,6 +59,7 @@ const stateEventTileTypes = { 'm.room.power_levels': 'messages.TextualEvent', 'm.room.pinned_events': 'messages.TextualEvent', 'm.room.server_acl': 'messages.TextualEvent', + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) 'im.vector.modular.widgets': 'messages.TextualEvent', 'm.room.tombstone': 'messages.TextualEvent', 'm.room.join_rules': 'messages.TextualEvent', diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js index a3a9cb78c5..b812bb6b68 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js @@ -33,6 +33,7 @@ const plEventsToLabels = { "m.room.tombstone": _td("Upgrade the room"), "m.room.encryption": _td("Enable room encryption"), + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) "im.vector.modular.widgets": _td("Modify widgets"), }; @@ -47,6 +48,7 @@ const plEventsToShow = { "m.room.tombstone": {isState: true}, "m.room.encryption": {isState: true}, + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) "im.vector.modular.widgets": {isState: true}, }; diff --git a/src/stores/ActiveWidgetStore.js b/src/stores/ActiveWidgetStore.js index 60ea3f9106..c6f8dc69b7 100644 --- a/src/stores/ActiveWidgetStore.js +++ b/src/stores/ActiveWidgetStore.js @@ -64,6 +64,7 @@ class ActiveWidgetStore extends EventEmitter { // Everything else relies on views listening for events and calling setters // on this class which is terrible. This store should just listen for events // and keep itself up to date. + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) if (ev.getType() !== 'im.vector.modular.widgets') return; if (ev.getStateKey() === this._persistentWidgetId) { diff --git a/src/utils/WidgetUtils.js b/src/utils/WidgetUtils.js index 9fb6358c1f..6768119d8f 100644 --- a/src/utils/WidgetUtils.js +++ b/src/utils/WidgetUtils.js @@ -66,6 +66,7 @@ export default class WidgetUtils { return false; } + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) return room.currentState.maySendStateEvent('im.vector.modular.widgets', me); } @@ -180,6 +181,7 @@ export default class WidgetUtils { } const room = MatrixClientPeg.get().getRoom(roomId); + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) const startingWidgetEvents = room.currentState.getStateEvents('im.vector.modular.widgets'); if (eventsInIntendedState(startingWidgetEvents)) { resolve(); @@ -189,6 +191,7 @@ export default class WidgetUtils { function onRoomStateEvents(ev) { if (ev.getRoomId() !== roomId) return; + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) const currentWidgetEvents = room.currentState.getStateEvents('im.vector.modular.widgets'); if (eventsInIntendedState(currentWidgetEvents)) { @@ -268,8 +271,7 @@ export default class WidgetUtils { WidgetEchoStore.setRoomWidgetEcho(roomId, widgetId, content); const client = MatrixClientPeg.get(); - // TODO - Room widgets need to be moved to 'm.widget' state events - // https://docs.google.com/document/d/1uPF7XWY_dXTKVKV7jZQ2KmsI19wn9-kFRgQ1tFQP7wQ/edit?usp=sharing + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) return client.sendStateEvent(roomId, "im.vector.modular.widgets", content, widgetId).then(() => { return WidgetUtils.waitForRoomWidget(widgetId, roomId, addingWidget); }).finally(() => { @@ -283,6 +285,7 @@ export default class WidgetUtils { * @return {[object]} Array containing current / active room widgets */ static getRoomWidgets(room) { + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) const appsStateEvents = room.currentState.getStateEvents('im.vector.modular.widgets'); if (!appsStateEvents) { return []; diff --git a/test/components/views/rooms/RoomSettings-test.js b/test/components/views/rooms/RoomSettings-test.js index 5e21f729d0..b3790b2507 100644 --- a/test/components/views/rooms/RoomSettings-test.js +++ b/test/components/views/rooms/RoomSettings-test.js @@ -177,6 +177,7 @@ describe.skip('RoomSettings', () => { 'm.room.history_visibility': 50, 'm.room.power_levels': 50, 'm.room.topic': 50, + // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111) 'im.vector.modular.widgets': 50, }, }, From 4510499987b8244f24b41e958dc1990f39bebf7c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Apr 2020 15:25:11 -0600 Subject: [PATCH 021/749] Fix widgets for all other sources too --- src/ScalarMessaging.js | 6 +++++- src/SlashCommands.tsx | 3 ++- src/widgets/WidgetType.ts | 11 +++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 2211e513c3..9be7730c3a 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -239,6 +239,7 @@ import WidgetUtils from './utils/WidgetUtils'; import RoomViewStore from './stores/RoomViewStore'; import { _t } from './languageHandler'; import {IntegrationManagers} from "./integrations/IntegrationManagers"; +import {WidgetType} from "./widgets/WidgetType"; function sendResponse(event, res) { const data = JSON.parse(JSON.stringify(event.data)); @@ -290,7 +291,7 @@ function inviteUser(event, roomId, userId) { function setWidget(event, roomId) { const widgetId = event.data.widget_id; - const widgetType = event.data.type; + let widgetType = event.data.type; const widgetUrl = event.data.url; const widgetName = event.data.name; // optional const widgetData = event.data.data; // optional @@ -322,6 +323,9 @@ function setWidget(event, roomId) { } } + // convert the widget type to a known widget type + widgetType = WidgetType.fromString(widgetType); + if (userWidget) { WidgetUtils.setUserWidget(widgetId, widgetType, widgetUrl, widgetName, widgetData).then(() => { sendResponse(event, { diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index d60434cf97..0afea63a78 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -35,6 +35,7 @@ import { abbreviateUrl } from './utils/UrlUtils'; import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from './utils/IdentityServerUtils'; import {isPermalinkHost, parsePermalink} from "./utils/permalinks/Permalinks"; import {inviteUsersToRoom} from "./RoomInvite"; +import { WidgetType } from "./widgets/WidgetType"; // XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816 interface HTMLInputEvent extends Event { @@ -775,7 +776,7 @@ export const Commands = [ const nowMs = (new Date()).getTime(); const widgetId = encodeURIComponent(`${roomId}_${userId}_${nowMs}`); return success(WidgetUtils.setRoomWidget( - roomId, widgetId, "m.custom", args, "Custom Widget", {})); + roomId, widgetId, WidgetType.CUSTOM, args, "Custom Widget", {})); } else { return reject(_t("You cannot modify widgets in this room.")); } diff --git a/src/widgets/WidgetType.ts b/src/widgets/WidgetType.ts index 7608819bb9..09c30430dd 100644 --- a/src/widgets/WidgetType.ts +++ b/src/widgets/WidgetType.ts @@ -16,6 +16,7 @@ limitations under the License. export class WidgetType { public static readonly JITSI = new WidgetType("m.jitsi", "jitsi"); + public static readonly CUSTOM = new WidgetType("m.custom", "m.custom"); constructor(public readonly preferred: string, public readonly legacy: string) { } @@ -23,4 +24,14 @@ export class WidgetType { public matches(type: string): boolean { return type === this.preferred || type === this.legacy; } + + static fromString(type: string): WidgetType { + // First try and match it against something we're already aware of + const known = Object.values(WidgetType).filter(v => v instanceof WidgetType); + const knownMatch = known.find(w => w.matches(type)); + if (knownMatch) return knownMatch; + + // If that fails, invent a new widget type + return new WidgetType(type, type); + } } From 0153f39c10bedae25cd04abd74ffa0406ccb07dd Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 9 Apr 2020 22:55:28 +0100 Subject: [PATCH 022/749] Rageshake, remind user of unsupported browser and report missing features in report Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/dialogs/BugReportDialog.js | 8 ++++++++ src/rageshake/submit-rageshake.js | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index 6e337d53dc..2f7ad4163d 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -137,12 +137,20 @@ export default class BugReportDialog extends React.Component { ); } + let warning; + if (window.Modernizr && Object.values(window.Modernizr).some(support => support === false)) { + warning =

+ { _t("Your browser is unsupported, you accepted that things may not work.") } +

; + } + return (
+ { warning }

{ _t( "Debug logs contain application usage data including your " + diff --git a/src/rageshake/submit-rageshake.js b/src/rageshake/submit-rageshake.js index 00ef87f89c..2c529ea0b9 100644 --- a/src/rageshake/submit-rageshake.js +++ b/src/rageshake/submit-rageshake.js @@ -136,6 +136,13 @@ export default async function sendBugReport(bugReportEndpoint, opts) { } catch (e) {} } + if (window.Modernizr) { + const missingFeatures = Object.keys(window.Modernizr).filter(key => window.Modernizr[key] === false); + if (missingFeatures.length > 0) { + body.append("modernizr_missing_features", missingFeatures.join(", ")); + } + } + if (opts.sendLogs) { progressCallback(_t("Collecting logs")); const logs = await rageshake.getLogsForReport(); From 0165ff0bc9b2c9c44a400f72d1c1ab1fb7ab574b Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Apr 2020 16:02:49 -0600 Subject: [PATCH 023/749] Allow iframes and Jitsi URLs in /addwidget Fixes https://github.com/vector-im/riot-web/issues/12784 --- package.json | 1 + src/SlashCommands.tsx | 44 ++++++++-- src/widgets/Jitsi.ts | 22 +++++ yarn.lock | 200 ++++-------------------------------------- 4 files changed, 78 insertions(+), 189 deletions(-) diff --git a/package.json b/package.json index 616f3f541e..2bf2b7c5a9 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "minimist": "^1.2.0", "pako": "^1.0.5", + "parse5": "^5.1.1", "png-chunks-extract": "^1.0.0", "project-name-generator": "^2.1.7", "prop-types": "^15.5.8", diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 0afea63a78..ff9ebbc70a 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -36,6 +36,8 @@ import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from './utils/I import {isPermalinkHost, parsePermalink} from "./utils/permalinks/Permalinks"; import {inviteUsersToRoom} from "./RoomInvite"; import { WidgetType } from "./widgets/WidgetType"; +import { Jitsi } from "./widgets/Jitsi"; +import { parseFragment as parseHtml } from "parse5"; // XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816 interface HTMLInputEvent extends Event { @@ -765,18 +767,50 @@ export const Commands = [ }), new Command({ command: 'addwidget', - args: '', + args: '', description: _td('Adds a custom widget by URL to the room'), - runFn: function(roomId, args) { - if (!args || (!args.startsWith("https://") && !args.startsWith("http://"))) { + runFn: function(roomId, widgetUrl) { + if (!widgetUrl) { + return reject(_t("Please supply a widget URL or embed code")); + } + + // Try and parse out a widget URL from iframes + if (widgetUrl.toLowerCase().startsWith("