From cc353dbe431f23fe3385b39e6122ddb802f3aa1b Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 15:13:40 +0100 Subject: [PATCH 01/23] Upgrade matrix-js-sdk to 8.3.0-rc.1 --- package.json | 2 +- yarn.lock | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index b85191dc22..09a6dedcfd 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "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", diff --git a/yarn.lock b/yarn.lock index ec099bbf7c..6aa2497a56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2898,15 +2898,6 @@ crc-32@^0.3.0: resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-0.3.0.tgz#6a3d3687f5baec41f7e9b99fe1953a2e5d19775e" integrity sha1-aj02h/W67EH36bmf4ZU6Ll0Zd14= -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.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -3988,7 +3979,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= @@ -5841,7 +5832,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== @@ -5939,9 +5930,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 "8.2.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/c6992e2056901502af19e40ba0d1103c4c1f61ed" +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" From 53ca12a0b2cc7dce4864bb36c27e3a5f132006e1 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 15:53:04 +0100 Subject: [PATCH 02/23] Prepare changelog for v3.4.0-rc.1 --- CHANGELOG.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47bffe432f..6fe6d82b8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,73 @@ +Changes in [3.4.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.4.0-rc.1) (2020-09-09) +============================================================================================================= +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.3.0...v3.4.0-rc.1) + + * Upgrade to JS SDK 8.3.0-rc.1 + * Update from Weblate + [\#5183](https://github.com/matrix-org/matrix-react-sdk/pull/5183) + * Right Panel Room Summary and Widgets + [\#5167](https://github.com/matrix-org/matrix-react-sdk/pull/5167) + * null-guard roomId in RightPanel and pass Room to UserView + [\#5180](https://github.com/matrix-org/matrix-react-sdk/pull/5180) + * Fix create-react-class regression. + [\#5178](https://github.com/matrix-org/matrix-react-sdk/pull/5178) + * Fix WatchManager for global room watchers and tidy widget code a little + [\#5176](https://github.com/matrix-org/matrix-react-sdk/pull/5176) + * Fix permalink local linkification to not strip via servers + [\#5174](https://github.com/matrix-org/matrix-react-sdk/pull/5174) + * Support creation of Jitsi widgets with "openidtoken-jwt" auth + [\#5173](https://github.com/matrix-org/matrix-react-sdk/pull/5173) + * Fix create-react-class regression. + [\#5177](https://github.com/matrix-org/matrix-react-sdk/pull/5177) + * Update openid_credentials Widget API action for MSC1960 updates + [\#5172](https://github.com/matrix-org/matrix-react-sdk/pull/5172) + * Allow persistent resizing of the widget app drawer + [\#5138](https://github.com/matrix-org/matrix-react-sdk/pull/5138) + * add lenny face command + [\#5158](https://github.com/matrix-org/matrix-react-sdk/pull/5158) + * Prep work for Settings changes with cross-signing deferral + [\#5169](https://github.com/matrix-org/matrix-react-sdk/pull/5169) + * Small code clean ups and tweaks + [\#5168](https://github.com/matrix-org/matrix-react-sdk/pull/5168) + * Fix soft crash from TruncatedList in the createReactClass conversion + [\#5170](https://github.com/matrix-org/matrix-react-sdk/pull/5170) + * Remove create-react-class + [\#5157](https://github.com/matrix-org/matrix-react-sdk/pull/5157) + * Consolidate Lodash files in bundle + [\#5162](https://github.com/matrix-org/matrix-react-sdk/pull/5162) + * Communities v2 prototype: "In community" view + [\#5161](https://github.com/matrix-org/matrix-react-sdk/pull/5161) + * Respect user preference for whether pills should have an avatar or not + [\#5165](https://github.com/matrix-org/matrix-react-sdk/pull/5165) + * Communities v2 prototype: DM copy updates + [\#5153](https://github.com/matrix-org/matrix-react-sdk/pull/5153) + * Only wait for public keys during verification + [\#5164](https://github.com/matrix-org/matrix-react-sdk/pull/5164) + * Fix eslint ts override tsx matching and delint + [\#5155](https://github.com/matrix-org/matrix-react-sdk/pull/5155) + * Fix react error about functional components can't take refs + [\#5159](https://github.com/matrix-org/matrix-react-sdk/pull/5159) + * Remove redundant components and devDependencies + [\#5156](https://github.com/matrix-org/matrix-react-sdk/pull/5156) + * Add display-capture to iframe allow for widgets + [\#5154](https://github.com/matrix-org/matrix-react-sdk/pull/5154) + * Update create room dialog copy & community prototype home icon + [\#5151](https://github.com/matrix-org/matrix-react-sdk/pull/5151) + * Migrate to new, separate APIs for cross-signing and secret storage + [\#5149](https://github.com/matrix-org/matrix-react-sdk/pull/5149) + * Fix clicking the background of the tag panel not clearing the filter + [\#5152](https://github.com/matrix-org/matrix-react-sdk/pull/5152) + * Communities v2 prototype: Associate created rooms with the selected + community + [\#5147](https://github.com/matrix-org/matrix-react-sdk/pull/5147) + * Communities v2 prototype: Tag panel selection changes + [\#5145](https://github.com/matrix-org/matrix-react-sdk/pull/5145) + * Communities v2 prototype: Create community flow + [\#5144](https://github.com/matrix-org/matrix-react-sdk/pull/5144) + * Communities v2 prototype: Override invite aesthetics for community-as-room + invites + [\#5143](https://github.com/matrix-org/matrix-react-sdk/pull/5143) + Changes in [3.3.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.3.0) (2020-09-01) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.3.0-rc.1...v3.3.0) From c5e033d81a144bab3a7aff508036b8cd59b2c9d8 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 9 Sep 2020 15:53:04 +0100 Subject: [PATCH 03/23] v3.4.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 09a6dedcfd..46b211dbe2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.3.0", + "version": "3.4.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 3973efeed33942b796f4fe9cfb8bdfaef20ad3f2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 9 Sep 2020 14:35:17 -0600 Subject: [PATCH 04/23] [Release] Account for via in pill matching regex https://github.com/matrix-org/matrix-react-sdk/pull/5188 to the release branch --- src/components/views/elements/Pill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 8247225a2b..3094f17fb7 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -29,7 +29,7 @@ import {Action} from "../../../dispatcher/actions"; // For URLs of matrix.to links in the timeline which have been reformatted by // HttpUtils transformTags to relative links. This excludes event URLs (with `[^\/]*`) -const REGEX_LOCAL_PERMALINK = /^#\/(?:user|room|group)\/(([#!@+])[^/]*)$/; +const REGEX_LOCAL_PERMALINK = /^#\/(?:user|room|group)\/(([#!@+]).*?)(?=\/|\?|$)/; class Pill extends React.Component { static isPillUrl(url) { From 96080f2ccce68c67d33cc1416f1c71c074cb9321 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 10 Sep 2020 14:06:13 +0100 Subject: [PATCH 05/23] Prompt to remove the jitsi widget when pressing the call button If there's already one in the room. We threw up an error message anyway telling you there was already a jitsi widget, so just add a button to end the call. --- src/CallHandler.js | 17 ++++++++++++----- src/i18n/strings/en_EN.json | 5 +++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index 27e8e34e16..e6552c13fd 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -69,6 +69,8 @@ import {WidgetType} from "./widgets/WidgetType"; import {SettingLevel} from "./settings/SettingLevel"; import {base32} from "rfc4648"; +import QuestionDialog from "./components/views/dialogs/QuestionDialog"; + global.mxCalls = { //room_id: MatrixCall }; @@ -202,7 +204,6 @@ function _setCallState(call, roomId, status) { function _showICEFallbackPrompt() { const cli = MatrixClientPeg.get(); - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); const code = sub => {sub}; Modal.createTrackedDialog('No TURN servers', '', QuestionDialog, { title: _t("Call failed due to misconfigured server"), @@ -380,11 +381,17 @@ async function _startCallApp(roomId, type) { "Refusing to start conference call widget in " + roomId + " a conference call widget is already present", ); - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Already have Jitsi Widget', '', ErrorDialog, { - title: _t('Call in Progress'), - description: _t('A call is already in progress!'), + Modal.createTrackedDialog('Already have Jitsi Widget', '', QuestionDialog, { + title: _t('End Call'), + description: _t('Remove the group call from the room?'), + button: _t('End Call'), + cancelButton: _t('Cancel'), + onFinished: (endCall) => { + if (endCall) { + WidgetUtils.setRoomWidget(roomId, currentJitsiWidgets[0].getContent()['id']); + } + }, }); return; } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 77cd8ef661..53f1850925 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -50,7 +50,9 @@ "You cannot place a call with yourself.": "You cannot place a call with yourself.", "Call in Progress": "Call in Progress", "A call is currently being placed!": "A call is currently being placed!", - "A call is already in progress!": "A call is already in progress!", + "End Call": "End Call", + "Remove the group call from the room?": "Remove the group call from the room?", + "Cancel": "Cancel", "Permission Required": "Permission Required", "You do not have permission to start a conference call in this room": "You do not have permission to start a conference call in this room", "Replying With Files": "Replying With Files", @@ -140,7 +142,6 @@ "Cancel entering passphrase?": "Cancel entering passphrase?", "Are you sure you want to cancel entering passphrase?": "Are you sure you want to cancel entering passphrase?", "Go Back": "Go Back", - "Cancel": "Cancel", "Setting up keys": "Setting up keys", "Messages": "Messages", "Actions": "Actions", From 14f6d9e79feb900518286c5f9a2e214126691974 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 10 Sep 2020 13:48:28 -0600 Subject: [PATCH 06/23] [Release] Show verification status in the room summary card https://github.com/matrix-org/matrix-react-sdk/pull/5195 to release - see https://github.com/matrix-org/matrix-react-sdk/pull/5195 for details. --- .../views/right_panel/_RoomSummaryCard.scss | 18 ++++++++++++++++-- .../views/right_panel/RoomSummaryCard.tsx | 12 +++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/res/css/views/right_panel/_RoomSummaryCard.scss b/res/css/views/right_panel/_RoomSummaryCard.scss index 78324c5e89..0031d3a64c 100644 --- a/res/css/views/right_panel/_RoomSummaryCard.scss +++ b/res/css/views/right_panel/_RoomSummaryCard.scss @@ -67,12 +67,26 @@ limitations under the License. } } - .mx_RoomSummaryCard_e2ee_secure { - background-color: #5abff2; + .mx_RoomSummaryCard_e2ee_normal { + background-color: #424446; &::before { mask-image: url('$(res)/img/e2e/normal.svg'); } } + + .mx_RoomSummaryCard_e2ee_verified { + background-color: #0dbd8b; + &::before { + mask-image: url('$(res)/img/e2e/verified.svg'); + } + } + + .mx_RoomSummaryCard_e2ee_warning { + background-color: #ff4b55; + &::before { + mask-image: url('$(res)/img/e2e/warning.svg'); + } + } } } diff --git a/src/components/views/right_panel/RoomSummaryCard.tsx b/src/components/views/right_panel/RoomSummaryCard.tsx index 9f803d1185..dd4c281090 100644 --- a/src/components/views/right_panel/RoomSummaryCard.tsx +++ b/src/components/views/right_panel/RoomSummaryCard.tsx @@ -40,6 +40,7 @@ import TextWithTooltip from "../elements/TextWithTooltip"; import BaseAvatar from "../avatars/BaseAvatar"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import WidgetStore, {IApp} from "../../../stores/WidgetStore"; +import { E2EStatus, shieldStatusForRoom } from "../../../utils/ShieldUtils"; interface IProps { room: Room; @@ -200,6 +201,13 @@ const RoomSummaryCard: React.FC = ({ room, onClose }) => { const isRoomEncrypted = useIsEncrypted(cli, room); + const [e2eStatus, setE2eStatus] = useState(); + useEffect(() => { + if (isRoomEncrypted) { + shieldStatusForRoom(cli, room).then(e => setE2eStatus(e)); + } + }); + const alias = room.getCanonicalAlias() || room.getAltAliases()[0] || ""; const header =
@@ -207,7 +215,9 @@ const RoomSummaryCard: React.FC = ({ room, onClose }) => {
From cd360ba92fbb0b8c7254aab71692bf72b78ec90c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 10 Sep 2020 13:59:22 -0600 Subject: [PATCH 07/23] Fix for release --- src/components/views/right_panel/RoomSummaryCard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/right_panel/RoomSummaryCard.tsx b/src/components/views/right_panel/RoomSummaryCard.tsx index dd4c281090..e475b0486a 100644 --- a/src/components/views/right_panel/RoomSummaryCard.tsx +++ b/src/components/views/right_panel/RoomSummaryCard.tsx @@ -40,7 +40,7 @@ import TextWithTooltip from "../elements/TextWithTooltip"; import BaseAvatar from "../avatars/BaseAvatar"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import WidgetStore, {IApp} from "../../../stores/WidgetStore"; -import { E2EStatus, shieldStatusForRoom } from "../../../utils/ShieldUtils"; +import { shieldStatusForRoom } from "../../../utils/ShieldUtils"; interface IProps { room: Room; @@ -201,7 +201,7 @@ const RoomSummaryCard: React.FC = ({ room, onClose }) => { const isRoomEncrypted = useIsEncrypted(cli, room); - const [e2eStatus, setE2eStatus] = useState(); + const [e2eStatus, setE2eStatus] = useState(); useEffect(() => { if (isRoomEncrypted) { shieldStatusForRoom(cli, room).then(e => setE2eStatus(e)); @@ -216,8 +216,8 @@ const RoomSummaryCard: React.FC = ({ room, onClose }) => { tooltip={isRoomEncrypted ? _t("Encrypted") : _t("Not encrypted")} class={classNames("mx_RoomSummaryCard_e2ee", { mx_RoomSummaryCard_e2ee_normal: isRoomEncrypted, - mx_RoomSummaryCard_e2ee_warning: isRoomEncrypted && e2eStatus === E2EStatus.Warning, - mx_RoomSummaryCard_e2ee_verified: isRoomEncrypted && e2eStatus === E2EStatus.Verified, + mx_RoomSummaryCard_e2ee_warning: isRoomEncrypted && e2eStatus === "warning", + mx_RoomSummaryCard_e2ee_verified: isRoomEncrypted && e2eStatus === "verified", })} /> From be3a8613ecdd1e1e210e6f2cf1fc3899414c6553 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 11 Sep 2020 11:12:56 +0100 Subject: [PATCH 08/23] Fix sticker picker height Fixes https://github.com/vector-im/element-web/issues/15152 --- res/css/views/rooms/_Stickers.scss | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/res/css/views/rooms/_Stickers.scss b/res/css/views/rooms/_Stickers.scss index 4bd45631cc..d99276b70a 100644 --- a/res/css/views/rooms/_Stickers.scss +++ b/res/css/views/rooms/_Stickers.scss @@ -7,12 +7,19 @@ height: 300px; } -#mx_persistedElement_stickerPicker .mx_AppTileFullWidth { - height: unset; - box-sizing: border-box; - border-left: none; - border-right: none; - border-bottom: none; +#mx_persistedElement_stickerPicker { + .mx_AppTileFullWidth { + height: unset; + box-sizing: border-box; + border-left: none; + border-right: none; + border-bottom: none; + } + + iframe { + // Sticker picker depends on the fixed height previously used for all tiles + height: 273px; + } } .mx_Stickers_contentPlaceholder { From e54d4e665fd89430408bd9751486fbc747d9f9bb Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 11 Sep 2020 12:20:32 +0100 Subject: [PATCH 09/23] Don't prompt to remove jitsi widget if the user don't have permission --- src/CallHandler.js | 40 ++++++++++++++++++------------------- src/i18n/strings/en_EN.json | 1 + 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index e6552c13fd..b8635ed899 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -70,6 +70,7 @@ import {SettingLevel} from "./settings/SettingLevel"; import {base32} from "rfc4648"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; +import ErrorDialog from "./components/views/dialogs/ErrorDialog"; global.mxCalls = { //room_id: MatrixCall @@ -133,7 +134,6 @@ function _setCallListeners(call) { return; } - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call Failed', '', ErrorDialog, { title: _t('Call Failed'), description: err.message, @@ -162,7 +162,6 @@ function _setCallListeners(call) { _setCallState(call, call.roomId, "busy"); pause("ringbackAudio"); play("busyAudio"); - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call Handler', 'Call Timeout', ErrorDialog, { title: _t('Call Timeout'), description: _t('The remote side failed to pick up') + '.', @@ -246,7 +245,6 @@ function _onAction(payload) { if (screenCapErrorString) { _setCallState(undefined, newCall.roomId, "ended"); console.log("Can't capture screen: " + screenCapErrorString); - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call Handler', 'Unable to capture screen', ErrorDialog, { title: _t('Unable to capture screen'), description: screenCapErrorString, @@ -266,7 +264,6 @@ function _onAction(payload) { case 'place_call': { if (callHandler.getAnyActiveCall()) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call Handler', 'Existing Call', ErrorDialog, { title: _t('Existing Call'), description: _t('You are already in a call.'), @@ -276,7 +273,6 @@ function _onAction(payload) { // if the runtime env doesn't do VoIP, whine. if (!MatrixClientPeg.get().supportsVoip()) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call Handler', 'VoIP is unsupported', ErrorDialog, { title: _t('VoIP is unsupported'), description: _t('You cannot place VoIP calls in this browser.'), @@ -292,7 +288,6 @@ function _onAction(payload) { const members = room.getJoinedMembers(); if (members.length <= 1) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Call Handler', 'Cannot place call with self', ErrorDialog, { description: _t('You cannot place a call with yourself.'), }); @@ -367,8 +362,6 @@ async function _startCallApp(roomId, type) { const currentJitsiWidgets = WidgetUtils.getRoomWidgetsOfType(room, WidgetType.JITSI); if (WidgetEchoStore.roomHasPendingWidgetsOfType(roomId, currentJitsiWidgets, WidgetType.JITSI)) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Call already in progress', '', ErrorDialog, { title: _t('Call in Progress'), description: _t('A call is currently being placed!'), @@ -382,17 +375,24 @@ async function _startCallApp(roomId, type) { " a conference call widget is already present", ); - Modal.createTrackedDialog('Already have Jitsi Widget', '', QuestionDialog, { - title: _t('End Call'), - description: _t('Remove the group call from the room?'), - button: _t('End Call'), - cancelButton: _t('Cancel'), - onFinished: (endCall) => { - if (endCall) { - WidgetUtils.setRoomWidget(roomId, currentJitsiWidgets[0].getContent()['id']); - } - }, - }); + if (WidgetUtils.canUserModifyWidgets(roomId)) { + Modal.createTrackedDialog('Already have Jitsi Widget', '', QuestionDialog, { + title: _t('End Call'), + description: _t('Remove the group call from the room?'), + button: _t('End Call'), + cancelButton: _t('Cancel'), + onFinished: (endCall) => { + if (endCall) { + WidgetUtils.setRoomWidget(roomId, currentJitsiWidgets[0].getContent()['id']); + } + }, + }); + } else { + Modal.createTrackedDialog('Already have Jitsi Widget', '', ErrorDialog, { + title: _t('Call in Progress'), + description: _t("You don't have permission to remove the call from the room"), + }); + } return; } @@ -436,8 +436,6 @@ async function _startCallApp(roomId, type) { console.log('Jitsi widget added'); }).catch((e) => { if (e.errcode === 'M_FORBIDDEN') { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Call Failed', '', ErrorDialog, { title: _t('Permission Required'), description: _t("You do not have permission to start a conference call in this room"), diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 53f1850925..aa2ed03987 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -53,6 +53,7 @@ "End Call": "End Call", "Remove the group call from the room?": "Remove the group call from the room?", "Cancel": "Cancel", + "You don't have permission to remove the call from the room": "You don't have permission to remove the call from the room", "Permission Required": "Permission Required", "You do not have permission to start a conference call in this room": "You do not have permission to start a conference call in this room", "Replying With Files": "Replying With Files", From b633564bea369d657830b7c1ae35b513a46f37f7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 11 Sep 2020 13:02:02 +0100 Subject: [PATCH 10/23] unused import --- src/CallHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index b8635ed899..ad40332af5 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -56,7 +56,6 @@ limitations under the License. import {MatrixClientPeg} from './MatrixClientPeg'; import PlatformPeg from './PlatformPeg'; import Modal from './Modal'; -import * as sdk from './index'; import { _t } from './languageHandler'; import Matrix from 'matrix-js-sdk'; import dis from './dispatcher/dispatcher'; From acdabe3ca07acade26405e4174486112dbdf1768 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 11 Sep 2020 11:39:58 +0100 Subject: [PATCH 11/23] Fix user info scrolling in new card view Fixes https://github.com/vector-im/element-web/issues/15148 --- res/css/views/right_panel/_UserInfo.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/res/css/views/right_panel/_UserInfo.scss b/res/css/views/right_panel/_UserInfo.scss index 9fcf06e5d0..f20c9b7868 100644 --- a/res/css/views/right_panel/_UserInfo.scss +++ b/res/css/views/right_panel/_UserInfo.scss @@ -219,9 +219,8 @@ limitations under the License. text-overflow: clip; } - .mx_UserInfo_scrollContainer { + .mx_AutoHideScrollbar { flex: 1 1 0; - padding-bottom: 16px; } .mx_UserInfo_container:not(.mx_UserInfo_separator) { From 652c0373806c1f6691f4338ae73f56fb3749190f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 11 Sep 2020 09:06:17 -0600 Subject: [PATCH 12/23] Use hooks better (from develop) --- src/components/views/right_panel/RoomSummaryCard.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/views/right_panel/RoomSummaryCard.tsx b/src/components/views/right_panel/RoomSummaryCard.tsx index e475b0486a..39b255db8e 100644 --- a/src/components/views/right_panel/RoomSummaryCard.tsx +++ b/src/components/views/right_panel/RoomSummaryCard.tsx @@ -40,7 +40,7 @@ import TextWithTooltip from "../elements/TextWithTooltip"; import BaseAvatar from "../avatars/BaseAvatar"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import WidgetStore, {IApp} from "../../../stores/WidgetStore"; -import { shieldStatusForRoom } from "../../../utils/ShieldUtils"; +import RoomContext from "../../../contexts/RoomContext"; interface IProps { room: Room; @@ -200,13 +200,8 @@ const RoomSummaryCard: React.FC = ({ room, onClose }) => { }; const isRoomEncrypted = useIsEncrypted(cli, room); - - const [e2eStatus, setE2eStatus] = useState(); - useEffect(() => { - if (isRoomEncrypted) { - shieldStatusForRoom(cli, room).then(e => setE2eStatus(e)); - } - }); + const roomContext = useContext(RoomContext); + const e2eStatus = roomContext['e2eStatus']; const alias = room.getCanonicalAlias() || room.getAltAliases()[0] || ""; const header = From ba738472968c7e4be4e1ebf2e5d3d1abb40944dd Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:31:41 +0100 Subject: [PATCH 13/23] Upgrade matrix-js-sdk to 8.3.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 46b211dbe2..d780e222cf 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "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", diff --git a/yarn.lock b/yarn.lock index 6aa2497a56..ad478a271a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5930,10 +5930,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@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== +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" From c6eda819f032561b6695b2aacd4197587de536de Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:36:31 +0100 Subject: [PATCH 14/23] Prepare changelog for v3.4.0 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe6d82b8b..f0275d25a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +Changes in [3.4.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.4.0) (2020-09-14) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.4.0-rc.1...v3.4.0) + + * Upgrade to JS SDK 8.3.0 + * [Release] Show verification status in the room summary card + [\#5196](https://github.com/matrix-org/matrix-react-sdk/pull/5196) + * Fix user info scrolling in new card view + [\#5200](https://github.com/matrix-org/matrix-react-sdk/pull/5200) + * Fix sticker picker height + [\#5199](https://github.com/matrix-org/matrix-react-sdk/pull/5199) + * [Release] Account for via in pill matching regex + [\#5190](https://github.com/matrix-org/matrix-react-sdk/pull/5190) + Changes in [3.4.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.4.0-rc.1) (2020-09-09) ============================================================================================================= [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.3.0...v3.4.0-rc.1) From 099f50b10e881745673223d395f2f25b60d37374 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:36:32 +0100 Subject: [PATCH 15/23] v3.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d780e222cf..99d2e42d8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.4.0-rc.1", + "version": "3.4.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 148cad6ea2daecee3dc799616dc102698b0751f8 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 13:42:34 +0100 Subject: [PATCH 16/23] Reset matrix-js-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 99d2e42d8f..52bced7a46 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "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", diff --git a/yarn.lock b/yarn.lock index ad478a271a..515ddddfc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5930,10 +5930,9 @@ 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@8.3.0: +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": 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== + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/b9886d4f3479c041fc6d91ebc88c4a998e9d2e7c" dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From 73608c4aa9db90bba569fea605527ffb52d513ef Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Sep 2020 14:03:51 +0100 Subject: [PATCH 17/23] Don't count widgets which no longer exist towards pinned count --- src/stores/WidgetStore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index 377512223a..10327ce4e9 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -167,7 +167,9 @@ export default class WidgetStore extends AsyncStoreWithClient { // the only case it will go to three is if you have two and then a Jitsi gets added const roomId = this.getRoomId(widgetId); const roomInfo = this.getRoom(roomId); - return roomInfo && Object.keys(roomInfo.pinned).length < 2; + return roomInfo && Object.keys(roomInfo.pinned).filter(k => { + return roomInfo.widgets.some(app => app.id === k); + }).length < 2; } public pinWidget(widgetId: string) { From fa50b31fd2291cdd3654449a0bd464f32e2c90dd Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Sep 2020 15:20:06 +0100 Subject: [PATCH 18/23] Fix crashes with cannot read isResizing of undefined --- src/components/structures/ScrollPanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index b4f5195803..99a3da2565 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -198,7 +198,8 @@ export default class ScrollPanel extends React.Component { } onScroll = ev => { - if (this.props.resizeNotifier.isResizing) return; // skip scroll events caused by resizing + // skip scroll events caused by resizing + if (this.props.resizeNotifier && this.props.resizeNotifier.isResizing) return; debuglog("onScroll", this._getScrollNode().scrollTop); this._scrollTimeout.restart(); this._saveScrollState(); From ca0ad0b7ed4603d7b7b0d46c892343fda3856af7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Sep 2020 14:03:51 +0100 Subject: [PATCH 19/23] Don't count widgets which no longer exist towards pinned count --- src/stores/WidgetStore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index 377512223a..10327ce4e9 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -167,7 +167,9 @@ export default class WidgetStore extends AsyncStoreWithClient { // the only case it will go to three is if you have two and then a Jitsi gets added const roomId = this.getRoomId(widgetId); const roomInfo = this.getRoom(roomId); - return roomInfo && Object.keys(roomInfo.pinned).length < 2; + return roomInfo && Object.keys(roomInfo.pinned).filter(k => { + return roomInfo.widgets.some(app => app.id === k); + }).length < 2; } public pinWidget(widgetId: string) { From e6e77633ad41ad2297fd85cf19c5cb8b534c4ed1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Sep 2020 15:20:06 +0100 Subject: [PATCH 20/23] Fix crashes with cannot read isResizing of undefined --- src/components/structures/ScrollPanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index b4f5195803..99a3da2565 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -198,7 +198,8 @@ export default class ScrollPanel extends React.Component { } onScroll = ev => { - if (this.props.resizeNotifier.isResizing) return; // skip scroll events caused by resizing + // skip scroll events caused by resizing + if (this.props.resizeNotifier && this.props.resizeNotifier.isResizing) return; debuglog("onScroll", this._getScrollNode().scrollTop); this._scrollTimeout.restart(); this._saveScrollState(); From e32cb175cb24b7f43c0f1bc8cf9ae2814b03870b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Sep 2020 15:44:00 +0100 Subject: [PATCH 21/23] Fix Bridges tab crashing when the room does not have bridges --- .../views/settings/tabs/room/BridgeSettingsTab.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx b/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx index 8638105cd9..3c74bd4c1a 100644 --- a/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx @@ -46,9 +46,10 @@ export default class BridgeSettingsTab extends React.Component { const client = MatrixClientPeg.get(); const roomState = client.getRoom(roomId).currentState; - return [].concat(...BRIDGE_EVENT_TYPES.map((typeName) => - Array.from(roomState.events.get(typeName).values()), - )); + return BRIDGE_EVENT_TYPES.map(typeName => { + const events = roomState.events.get(typeName); + return events ? Array.from(events.values()) : []; + }).flat(1); } render() { From a5d42d1e2af0c90801e11a892ff8dc7a03a1a56b Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 15:49:09 +0100 Subject: [PATCH 22/23] Prepare changelog for v3.4.1 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0275d25a1..6fa9cc29f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +Changes in [3.4.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.4.1) (2020-09-14) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.4.0...v3.4.1) + + * Don't count widgets which no longer exist towards pinned count + [\#5202](https://github.com/matrix-org/matrix-react-sdk/pull/5202) + * Fix crashes with cannot read isResizing of undefined + [\#5205](https://github.com/matrix-org/matrix-react-sdk/pull/5205) + Changes in [3.4.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.4.0) (2020-09-14) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.4.0-rc.1...v3.4.0) From 4f930ac50cb114d6233424fcb502fa273ca9636f Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 14 Sep 2020 15:49:09 +0100 Subject: [PATCH 23/23] v3.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99d2e42d8f..2dd3e32077 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.4.0", + "version": "3.4.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {