From 4a1ba01f44df7bbe7a7d7812b9c359701edb0e6c Mon Sep 17 00:00:00 2001 From: MTRNord Date: Sun, 13 Aug 2017 00:56:37 +0000 Subject: [PATCH 01/37] fix deprecation warning --- src/languageHandler.js | 47 +++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/src/languageHandler.js b/src/languageHandler.js index e956d4f8bd..54a8596d5d 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -231,35 +231,30 @@ export function getCurrentLanguage() { } function getLangsJson() { - const deferred = Promise.defer(); - - request( - { method: "GET", url: i18nFolder + 'languages.json' }, - (err, response, body) => { - if (err || response.status < 200 || response.status >= 300) { - deferred.reject({err: err, response: response}); - return; + return new Promise((resolve, reject) => { + request( + { method: "GET", url: i18nFolder + 'languages.json' }, + (err, response, body) => { + if (err || response.status < 200 || response.status >= 300) { + reject({err: err, response: response}); + } + resolve(JSON.parse(body)); } - deferred.resolve(JSON.parse(body)); - } - ); - return deferred.promise; + ); + }); } function getLanguage(langPath) { - const deferred = Promise.defer(); - - let response_return = {}; - request( - { method: "GET", url: langPath }, - (err, response, body) => { - if (err || response.status < 200 || response.status >= 300) { - deferred.reject({err: err, response: response}); - return; + return new Promise((resolve, reject) => { + let response_return = {}; + request( + { method: "GET", url: langPath }, + (err, response, body) => { + if (err || response.status < 200 || response.status >= 300) { + reject({err: err, response: response}); + } + resolve(JSON.parse(body)); } - - deferred.resolve(JSON.parse(body)); - } - ); - return deferred.promise; + ); + }); } From 3939d948bf5071d16c2baa14d918446c15e17af2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 22 Aug 2017 18:43:33 +0100 Subject: [PATCH 02/37] js-sdk v0.10.1-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 661db4b6bc..39a8984d33 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "isomorphic-fetch": "^2.2.1", "linkifyjs": "^2.1.3", "lodash": "^4.13.1", - "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "0.8.1-rc.1", "optimist": "^0.6.1", "prop-types": "^15.5.8", "react": "^15.4.0", From 8312cf6ab23f693971ad2d9b2fbadea4955df22f Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 22 Aug 2017 18:50:33 +0100 Subject: [PATCH 03/37] Temporarily bump version so we compare to 0.10.0-rc.2 rather than 0.9.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39a8984d33..05b4db0d39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.9.7", + "version": "0.10.0-rc.2", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From f4fb502fc3398aa0d59a901b451180896e629575 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 22 Aug 2017 18:53:11 +0100 Subject: [PATCH 04/37] Prepare changelog for v0.10.1-rc.1 --- CHANGELOG.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc4bbcfce..84ec9e754d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,55 @@ +Changes in [0.10.1-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.10.1-rc.1) (2017-08-22) +=============================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.10.0-rc.2...v0.10.1-rc.1) + + * Matthew/multiple widgets + [\#1327](https://github.com/matrix-org/matrix-react-sdk/pull/1327) + * Fix proptypes on UserPickerDialog + [\#1326](https://github.com/matrix-org/matrix-react-sdk/pull/1326) + * AppsDrawer: Remove unnecessary bind + [\#1325](https://github.com/matrix-org/matrix-react-sdk/pull/1325) + * Position add app widget link + [\#1322](https://github.com/matrix-org/matrix-react-sdk/pull/1322) + * Remove app tile beta tag. + [\#1323](https://github.com/matrix-org/matrix-react-sdk/pull/1323) + * Add missing translation. + [\#1324](https://github.com/matrix-org/matrix-react-sdk/pull/1324) + * Note that apps are not E2EE + [\#1319](https://github.com/matrix-org/matrix-react-sdk/pull/1319) + * Only render appTile body (including warnings) if drawer shown. + [\#1321](https://github.com/matrix-org/matrix-react-sdk/pull/1321) + * Timeline improvements + [\#1320](https://github.com/matrix-org/matrix-react-sdk/pull/1320) + * Add a space between widget name and "widget" in widget event tiles + [\#1318](https://github.com/matrix-org/matrix-react-sdk/pull/1318) + * Move manage integrations button from settings page to room header as a + stand-alone component + [\#1286](https://github.com/matrix-org/matrix-react-sdk/pull/1286) + * Don't apply case logic to app names + [\#1316](https://github.com/matrix-org/matrix-react-sdk/pull/1316) + * Stop integ manager opening on every room switch + [\#1315](https://github.com/matrix-org/matrix-react-sdk/pull/1315) + * Add behaviour to toggle app draw on app tile header click + [\#1313](https://github.com/matrix-org/matrix-react-sdk/pull/1313) + * Change OOO so that MELS generation will continue over hidden events + [\#1308](https://github.com/matrix-org/matrix-react-sdk/pull/1308) + * Implement TextualEvent tiles for im.vector.modular.widgets + [\#1312](https://github.com/matrix-org/matrix-react-sdk/pull/1312) + * Don't show widget security warning to the person that added it to the room + [\#1314](https://github.com/matrix-org/matrix-react-sdk/pull/1314) + * remove unused strings introduced by string change + [\#1311](https://github.com/matrix-org/matrix-react-sdk/pull/1311) + * hotfix bad fn signature regression + [\#1310](https://github.com/matrix-org/matrix-react-sdk/pull/1310) + * Show a dialog if the maximum number of widgets allowed has been reached. + [\#1291](https://github.com/matrix-org/matrix-react-sdk/pull/1291) + * Fix Robot translation + [\#1309](https://github.com/matrix-org/matrix-react-sdk/pull/1309) + * Refactor ChatInviteDialog to be UserPickerDialog + [\#1300](https://github.com/matrix-org/matrix-react-sdk/pull/1300) + * Update Link to Translation status + [\#1302](https://github.com/matrix-org/matrix-react-sdk/pull/1302) + Changes in [0.9.7](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.9.7) (2017-06-22) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.9.6...v0.9.7) From 85b609608ee4c0400ea989861daf8b7eea981ae0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 22 Aug 2017 18:53:11 +0100 Subject: [PATCH 05/37] v0.10.1-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 05b4db0d39..b3d5b86a47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.10.0-rc.2", + "version": "0.10.1-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From b8e351f489dcd2483b68094254570584498c3860 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Aug 2017 15:54:06 +0100 Subject: [PATCH 06/37] Released js-sdk --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b3d5b86a47..a5b41a2f9b 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "isomorphic-fetch": "^2.2.1", "linkifyjs": "^2.1.3", "lodash": "^4.13.1", - "matrix-js-sdk": "0.8.1-rc.1", + "matrix-js-sdk": "0.8.1", "optimist": "^0.6.1", "prop-types": "^15.5.8", "react": "^15.4.0", From 878417d0e6df527829239e2b01b6a9148baf0ff7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Aug 2017 15:56:08 +0100 Subject: [PATCH 07/37] Prepare changelog for v0.10.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84ec9e754d..931afaceb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [0.10.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.10.1) (2017-08-23) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.10.1-rc.1...v0.10.1) + + * [No changes] + Changes in [0.10.1-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.10.1-rc.1) (2017-08-22) =============================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.10.0-rc.2...v0.10.1-rc.1) From 3581f6edaa52d20c28a4fa9c6d7ead6e0eafce18 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Aug 2017 15:56:09 +0100 Subject: [PATCH 08/37] v0.10.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5b41a2f9b..3eca722fad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.10.1-rc.1", + "version": "0.10.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 8ed5422a452cee3f98cdb8f901c5579a88a7332d Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 23 Aug 2017 16:22:14 +0100 Subject: [PATCH 09/37] Fix click to insert completion And remedy weird API in the process. Autocomplete now exposes `onSelectionChange` to indicate that the user has selected another completion, rather than returning the chosen completion via onUpArrow etc. Fixes vector-im/riot-web#4835 --- src/components/views/rooms/Autocomplete.js | 5 +++-- src/components/views/rooms/MessageComposerInput.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/views/rooms/Autocomplete.js b/src/components/views/rooms/Autocomplete.js index cdd57801a5..7706cc7ebd 100644 --- a/src/components/views/rooms/Autocomplete.js +++ b/src/components/views/rooms/Autocomplete.js @@ -143,7 +143,6 @@ export default class Autocomplete extends React.Component { return null; } this.setSelection(selectionOffset); - return selectionOffset === COMPOSER_SELECTED ? null : this.state.completionList[selectionOffset - 1]; } // called from MessageComposerInput @@ -155,7 +154,6 @@ export default class Autocomplete extends React.Component { return null; } this.setSelection(selectionOffset); - return selectionOffset === COMPOSER_SELECTED ? null : this.state.completionList[selectionOffset - 1]; } onEscape(e): boolean { @@ -201,6 +199,9 @@ export default class Autocomplete extends React.Component { setSelection(selectionOffset: number) { this.setState({selectionOffset, hide: false}); + if (this.props.onSelectionChange) { + this.props.onSelectionChange(this.state.completionList[selectionOffset - 1]); + } } componentDidUpdate() { diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 6d6cc0f3f4..37602a94ca 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -949,8 +949,7 @@ export default class MessageComposerInput extends React.Component { }; moveAutocompleteSelection = (up) => { - const completion = up ? this.autocomplete.onUpArrow() : this.autocomplete.onDownArrow(); - return this.setDisplayedCompletion(completion); + up ? this.autocomplete.onUpArrow() : this.autocomplete.onDownArrow(); }; onEscape = async (e) => { @@ -1133,6 +1132,7 @@ export default class MessageComposerInput extends React.Component { this.autocomplete = e} onConfirm={this.setDisplayedCompletion} + onSelectionChange={this.setDisplayedCompletion} query={this.getAutocompleteQuery(content)} selection={selection}/> From c11432c3e3b48dbe68e596351653f42f6ee4490c Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Aug 2017 19:35:33 +0100 Subject: [PATCH 10/37] Catch the promise rejection if scalar fails Otherwise this is incredibly annoying when developing if you don't have a scalar that will allow you to register (ie. if you're testing against an HS on your dev box) --- src/components/views/rooms/AppsDrawer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 824a719245..536259ae91 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -53,14 +53,14 @@ module.exports = React.createClass({ this.scalarClient = null; if (SdkConfig.get().integrations_ui_url && SdkConfig.get().integrations_rest_url) { this.scalarClient = new ScalarAuthClient(); - this.scalarClient.connect().done(() => { + this.scalarClient.connect().then(() => { this.forceUpdate(); - // TODO -- Handle Scalar errors - // }, - // (err) => { - // this.setState({ - // scalar_error: err, - // }); + }).catch((e) => { + console.log("Failed to connect to integrations server"); + // TODO -- Handle Scalar errors + // this.setState({ + // scalar_error: err, + // }); }); } From 67824e9accffacc08e6209fc87f4dd99144f07f0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 11:35:01 +0100 Subject: [PATCH 11/37] Force update on timelinepanel when event decrypted Partially fixes https://github.com/vector-im/riot-web/issues/4865 (the part about messages not appearing in the timeline until you move the cursor over the window). Requires https://github.com/matrix-org/matrix-js-sdk/pull/529 --- src/components/structures/TimelinePanel.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 6be31361dd..2840fd4579 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -197,6 +197,7 @@ var TimelinePanel = React.createClass({ MatrixClientPeg.get().on("Room.receipt", this.onRoomReceipt); MatrixClientPeg.get().on("Room.localEchoUpdated", this.onLocalEchoUpdated); MatrixClientPeg.get().on("Room.accountData", this.onAccountData); + MatrixClientPeg.get().on("Event.decrypted", this.onEventDecrypted); MatrixClientPeg.get().on("sync", this.onSync); this._initTimeline(this.props); @@ -266,6 +267,7 @@ var TimelinePanel = React.createClass({ client.removeListener("Room.receipt", this.onRoomReceipt); client.removeListener("Room.localEchoUpdated", this.onLocalEchoUpdated); client.removeListener("Room.accountData", this.onAccountData); + client.removeListener("Event.decrypted", this.onEventDecrypted); client.removeListener("sync", this.onSync); } }, @@ -503,6 +505,16 @@ var TimelinePanel = React.createClass({ }, this.props.onReadMarkerUpdated); }, + onEventDecrypted: function(ev) { + // Need to update as we don't display event tiles for events that + // haven't yet been decrypted. The event will have just been updated + // in place so we just need to re-render. + // TODO: We should restrict this to only events in our timeline, + // but possibly the event tile itself should just update when this + // happens to save us re-rendering the whole timeline. + this.forceUpdate(); + }, + onSync: function(state, prevState, data) { this.setState({clientSyncState: state}); }, From a2943ac3485a4ab90e63ed4216ba30ed37bf6666 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 11:55:39 +0100 Subject: [PATCH 12/37] Check room ID matches --- src/components/structures/TimelinePanel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 2840fd4579..6f72fcc767 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -512,7 +512,9 @@ var TimelinePanel = React.createClass({ // TODO: We should restrict this to only events in our timeline, // but possibly the event tile itself should just update when this // happens to save us re-rendering the whole timeline. - this.forceUpdate(); + if (ev.getRoomId() === this.props.timelineSet.room.roomId) { + this.forceUpdate(); + } }, onSync: function(state, prevState, data) { From ec6867dc8b364c84d6c88273a379f004ac158005 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 24 Aug 2017 12:31:29 +0100 Subject: [PATCH 13/37] Fix React crying on machines without internet due to return undefined --- src/components/views/elements/ManageIntegsButton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/ManageIntegsButton.js b/src/components/views/elements/ManageIntegsButton.js index a5f6eb7982..ac562a7c20 100644 --- a/src/components/views/elements/ManageIntegsButton.js +++ b/src/components/views/elements/ManageIntegsButton.js @@ -75,7 +75,7 @@ export default class ManageIntegsButton extends React.Component { } render() { - let integrationsButton; + let integrationsButton =
; let integrationsError; if (this.scalarClient !== null) { if (this.state.showIntegrationsError && this.state.scalarError) { From b65e1769d7407520f68f225423536bd69ce4cc42 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 24 Aug 2017 13:05:17 +0100 Subject: [PATCH 14/37] Dispatch incoming_call synchronously - this should fix a race where if the 'hangup' arrives hard on the tail of the Call.incoming, we don't ignore it. (We still have a problem in that we blip the hangup tone and UI, but that is arguably a separate problem) --- src/components/structures/MatrixChat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 4d671d9cad..bbe345933e 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1068,10 +1068,13 @@ module.exports = React.createClass({ self.setState({ready: true}); }); cli.on('Call.incoming', function(call) { + // we dispatch this synchronously to make sure that the event + // handlers on the call are set up immediately (so that if + // we get an immediate hangup, we don't get a stuck call) dis.dispatch({ action: 'incoming_call', call: call, - }); + }, true); }); cli.on('Session.logged_out', function(call) { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); From 939889705ed81209e81abcea1b17095e33ad2330 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 14:27:38 +0100 Subject: [PATCH 15/37] Fix notifications for encrypted events (#1336) Remember events that we may need to notify for once decrypted and evaluate them in an Event.decrypted listener. --- src/Notifier.js | 50 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/src/Notifier.js b/src/Notifier.js index 1bb435307d..d3b54a6cca 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -33,9 +33,16 @@ import Modal from './Modal'; * } */ +const MAX_PENDING_ENCRYPTED = 20; + const Notifier = { notifsByRoom: {}, + // A list of event IDs that we've received but need to wait until + // they're decrypted until we decide whether to notify for them + // or not + pendingEncryptedEventIds: [], + notificationMessageForEvent: function(ev) { return TextForEvent.textForEvent(ev); }, @@ -98,8 +105,10 @@ const Notifier = { this.boundOnRoomTimeline = this.onRoomTimeline.bind(this); this.boundOnSyncStateChange = this.onSyncStateChange.bind(this); this.boundOnRoomReceipt = this.onRoomReceipt.bind(this); + this.boundOnEventDecrypted = this.onEventDecrypted.bind(this); MatrixClientPeg.get().on('Room.timeline', this.boundOnRoomTimeline); MatrixClientPeg.get().on('Room.receipt', this.boundOnRoomReceipt); + MatrixClientPeg.get().on('Event.decrypted', this.boundOnEventDecrypted); MatrixClientPeg.get().on("sync", this.boundOnSyncStateChange); this.toolbarHidden = false; this.isSyncing = false; @@ -109,6 +118,7 @@ const Notifier = { if (MatrixClientPeg.get() && this.boundOnRoomTimeline) { MatrixClientPeg.get().removeListener('Room.timeline', this.boundOnRoomTimeline); MatrixClientPeg.get().removeListener('Room.receipt', this.boundOnRoomReceipt); + MatrixClientPeg.get().removeListener('Event.decrypted', this.boundOnEventDecrypted); MatrixClientPeg.get().removeListener('sync', this.boundOnSyncStateChange); } this.isSyncing = false; @@ -244,16 +254,26 @@ const Notifier = { if (ev.sender && ev.sender.userId === MatrixClientPeg.get().credentials.userId) return; if (data.timeline.getTimelineSet() !== room.getUnfilteredTimelineSet()) return; - const actions = MatrixClientPeg.get().getPushActionsForEvent(ev); - if (actions && actions.notify) { - if (this.isEnabled()) { - this._displayPopupNotification(ev, room); - } - if (actions.tweaks.sound && this.isAudioEnabled()) { - PlatformPeg.get().loudNotification(ev, room); - this._playAudioNotification(ev, room); + // If it's an encrypted event and the type is still 'm.room.encrypted', + // it hasn't yet been decrypted, so wait until it is. + if (event.isBeingDecrypted() || event.isDecryptionFailure()) { + this.pendingEncryptedEventIds.push(ev.getId()); + // don't let the list fill up indefinitely + while (this.pendingEncryptedEventIds.length > MAX_PENDING_ENCRYPTED) { + this.pendingEncryptedEventIds.shift(); } + return; } + + this._evaluateEvent(ev); + }, + + onEventDecrypted: function(ev) { + const idx = this.pendingEncryptedEventIds.indexOf(ev.getId()); + if (idx === -1) return; + + this.pendingEncryptedEventIds.splice(idx, 1); + this._evaluateEvent(ev); }, onRoomReceipt: function(ev, room) { @@ -273,6 +293,20 @@ const Notifier = { delete this.notifsByRoom[room.roomId]; } }, + + _evaluateEvent: function(ev) { + const room = MatrixClientPeg.get().getRoom(ev.getRoomId()); + const actions = MatrixClientPeg.get().getPushActionsForEvent(ev); + if (actions && actions.notify) { + if (this.isEnabled()) { + this._displayPopupNotification(ev, room); + } + if (actions.tweaks.sound && this.isAudioEnabled()) { + PlatformPeg.get().loudNotification(ev, room); + this._playAudioNotification(ev, room); + } + } + } }; if (!global.mxNotifier) { From 88a0d34c2b9a5c0365c994a438a904470fcf24df Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 24 Aug 2017 15:40:52 +0200 Subject: [PATCH 16/37] Remove unused response_return variable --- src/languageHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/languageHandler.js b/src/languageHandler.js index 54a8596d5d..a5697da1d0 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -246,7 +246,6 @@ function getLangsJson() { function getLanguage(langPath) { return new Promise((resolve, reject) => { - let response_return = {}; request( { method: "GET", url: langPath }, (err, response, body) => { From db011e7065b4df25af098e697bb6f5698f89703a Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 14:42:38 +0100 Subject: [PATCH 17/37] Get variable name right --- src/Notifier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Notifier.js b/src/Notifier.js index d3b54a6cca..0a3b346cf4 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -256,7 +256,7 @@ const Notifier = { // If it's an encrypted event and the type is still 'm.room.encrypted', // it hasn't yet been decrypted, so wait until it is. - if (event.isBeingDecrypted() || event.isDecryptionFailure()) { + if (ev.isBeingDecrypted() || ev.isDecryptionFailure()) { this.pendingEncryptedEventIds.push(ev.getId()); // don't let the list fill up indefinitely while (this.pendingEncryptedEventIds.length > MAX_PENDING_ENCRYPTED) { From 1b75470597e03767ec895be2a4432563de40efcb Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 14:48:22 +0100 Subject: [PATCH 18/37] Released js-sdk --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3eca722fad..39cfad7589 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "isomorphic-fetch": "^2.2.1", "linkifyjs": "^2.1.3", "lodash": "^4.13.1", - "matrix-js-sdk": "0.8.1", + "matrix-js-sdk": "0.8.2", "optimist": "^0.6.1", "prop-types": "^15.5.8", "react": "^15.4.0", From 662e2b8b4c2e3c9a796428202bf263aabd09ce53 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 14:49:40 +0100 Subject: [PATCH 19/37] Prepare changelog for v0.10.2 --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 931afaceb1..b5e596144e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +Changes in [0.10.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.10.2) (2017-08-24) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.10.1...v0.10.2) + + * Force update on timelinepanel when event decrypted + [\#1334](https://github.com/matrix-org/matrix-react-sdk/pull/1334) + * Dispatch incoming_call synchronously + [\#1337](https://github.com/matrix-org/matrix-react-sdk/pull/1337) + * Fix React crying on machines without internet due to return undefined + [\#1335](https://github.com/matrix-org/matrix-react-sdk/pull/1335) + * Catch the promise rejection if scalar fails + [\#1333](https://github.com/matrix-org/matrix-react-sdk/pull/1333) + * Update from Weblate. + [\#1329](https://github.com/matrix-org/matrix-react-sdk/pull/1329) + Changes in [0.10.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.10.1) (2017-08-23) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.10.1-rc.1...v0.10.1) From 0e3ae2fa4ffc690897f82f1d32c2cd8a1c4e2b63 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Aug 2017 14:49:41 +0100 Subject: [PATCH 20/37] v0.10.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39cfad7589..cc352cb8db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.10.1", + "version": "0.10.2", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From d34ba57adbed79d0a29333326aefcaed7fd13de9 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 24 Aug 2017 16:42:32 +0200 Subject: [PATCH 21/37] Add missing returns --- src/languageHandler.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/languageHandler.js b/src/languageHandler.js index a5697da1d0..a19c796f39 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -237,6 +237,7 @@ function getLangsJson() { (err, response, body) => { if (err || response.status < 200 || response.status >= 300) { reject({err: err, response: response}); + return; } resolve(JSON.parse(body)); } @@ -251,6 +252,7 @@ function getLanguage(langPath) { (err, response, body) => { if (err || response.status < 200 || response.status >= 300) { reject({err: err, response: response}); + return; } resolve(JSON.parse(body)); } From d63a0d30c8de47ca1acc3886b7f6aab13976ff2c Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 25 Aug 2017 13:18:01 +0100 Subject: [PATCH 22/37] Fix spurious notifications When loading new content whilst scrolling down the timeline . Use the Event event which only fire for events received in a sync, rather than Room.timeline which fires for events from pagination too. --- src/Notifier.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Notifier.js b/src/Notifier.js index 0a3b346cf4..5be162e0e3 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -102,11 +102,11 @@ const Notifier = { }, start: function() { - this.boundOnRoomTimeline = this.onRoomTimeline.bind(this); + this.boundOnEvent = this.onEvent.bind(this); this.boundOnSyncStateChange = this.onSyncStateChange.bind(this); this.boundOnRoomReceipt = this.onRoomReceipt.bind(this); this.boundOnEventDecrypted = this.onEventDecrypted.bind(this); - MatrixClientPeg.get().on('Room.timeline', this.boundOnRoomTimeline); + MatrixClientPeg.get().on('event', this.boundOnEvent); MatrixClientPeg.get().on('Room.receipt', this.boundOnRoomReceipt); MatrixClientPeg.get().on('Event.decrypted', this.boundOnEventDecrypted); MatrixClientPeg.get().on("sync", this.boundOnSyncStateChange); @@ -116,7 +116,7 @@ const Notifier = { stop: function() { if (MatrixClientPeg.get() && this.boundOnRoomTimeline) { - MatrixClientPeg.get().removeListener('Room.timeline', this.boundOnRoomTimeline); + MatrixClientPeg.get().removeListener('Event', this.boundOnEvent); MatrixClientPeg.get().removeListener('Room.receipt', this.boundOnRoomReceipt); MatrixClientPeg.get().removeListener('Event.decrypted', this.boundOnEventDecrypted); MatrixClientPeg.get().removeListener('sync', this.boundOnSyncStateChange); @@ -247,12 +247,9 @@ const Notifier = { } }, - onRoomTimeline: function(ev, room, toStartOfTimeline, removed, data) { - if (toStartOfTimeline) return; - if (!room) return; + onEvent: function(ev) { if (!this.isSyncing) return; // don't alert for any messages initially if (ev.sender && ev.sender.userId === MatrixClientPeg.get().credentials.userId) return; - if (data.timeline.getTimelineSet() !== room.getUnfilteredTimelineSet()) return; // If it's an encrypted event and the type is still 'm.room.encrypted', // it hasn't yet been decrypted, so wait until it is. From b15bbc8f9dddfcbe5a1a6c529cfc79c4c1eb9e95 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 25 Aug 2017 13:35:04 +0100 Subject: [PATCH 23/37] copyright --- src/Notifier.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Notifier.js b/src/Notifier.js index 5be162e0e3..fdfdfd045d 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -1,6 +1,7 @@ /* Copyright 2015, 2016 OpenMarket Ltd Copyright 2017 Vector Creations Ltd +Copyright 2017 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From cd1e58cb618f30fa3449ebb90b471baeafb9f2c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 26 Aug 2017 08:18:07 +0100 Subject: [PATCH 24/37] _tJsx returns a React Object, the sub fn must return a React Object not a string --- src/components/views/login/CaptchaForm.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/views/login/CaptchaForm.js b/src/components/views/login/CaptchaForm.js index 8f9c0391ae..d24990f94d 100644 --- a/src/components/views/login/CaptchaForm.js +++ b/src/components/views/login/CaptchaForm.js @@ -17,6 +17,7 @@ limitations under the License. 'use strict'; import React from 'react'; +import ReactDOM from 'react-dom'; import { _t, _tJsx } from '../../../languageHandler'; var DIV_ID = 'mx_recaptcha'; @@ -66,11 +67,10 @@ module.exports = React.createClass({ // * jumping straight to a hosted captcha page (but we don't support that yet) // * embedding the captcha in an iframe (if that works) // * using a better captcha lib - warning.innerHTML = _tJsx( - "Robot check is currently unavailable on desktop - please use a web browser", - /(.*?)<\/a>/, - (sub) => { return "{ sub }"; } - ); + ReactDOM.render(_tJsx( + "Robot check is currently unavailable on desktop - please use a web browser", + /(.*?)<\/a>/, + (sub) => { return { sub }; }), warning); this.refs.recaptchaContainer.appendChild(warning); } else { From acbcc00016f46dfdd6720ce5fb92d5e951f5e150 Mon Sep 17 00:00:00 2001 From: David Baker Date: Sat, 26 Aug 2017 15:15:51 +0100 Subject: [PATCH 25/37] Remove unnecessary 'load' on notif audio element It's not necessary to explicitly load and it throws an exception if you call it while the element is playing, so better to just remove it. --- src/Notifier.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Notifier.js b/src/Notifier.js index 0a3b346cf4..2f8e708d88 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -96,7 +96,6 @@ const Notifier = { _playAudioNotification: function(ev, room) { const e = document.getElementById("messageAudio"); if (e) { - e.load(); e.play(); } }, From edb449dfe587d8a4edf36933046cf8b0303b1f47 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 27 Aug 2017 23:32:16 +0100 Subject: [PATCH 26/37] we need to pass whether it is an invite RoomSubList explicitly (i18n) --- src/components/views/rooms/RoomList.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 9f9f030c27..27001ac954 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -555,6 +555,7 @@ module.exports = React.createClass({ label={ _t('Invites') } editable={ false } order="recent" + isInvite={true} selectedRoom={ self.props.selectedRoom } incomingCall={ self.state.incomingCall } collapsed={ self.props.collapsed } From 6127727267465db104ce35b5347a7115f1359d8a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 28 Aug 2017 08:19:39 +0100 Subject: [PATCH 27/37] text4event widget modified, used to show widget added each time. --- src/TextForEvent.js | 21 ++++++++++++++------- src/i18n/strings/en_EN.json | 1 + 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 95066912ac..36b8b538a7 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -244,15 +244,16 @@ function textForPowerEvent(event) { } return _t('%(senderName)s changed the power level of %(powerLevelDiffText)s.', { senderName: senderName, - powerLevelDiffText: diff.join(", ") + powerLevelDiffText: diff.join(", "), }); } function textForWidgetEvent(event) { - const senderName = event.sender ? event.sender.name : event.getSender(); - const previousContent = event.getPrevContent() || {}; + const senderName = event.getSender(); + const {name: prevName, type: prevType, url: prevUrl} = event.getPrevContent(); const {name, type, url} = event.getContent() || {}; - let widgetName = name || previousContent.name || type || previousContent.type || ''; + + let widgetName = name || prevName || type || prevType || ''; // Apply sentence case to widget name if (widgetName && widgetName.length > 0) { widgetName = widgetName[0].toUpperCase() + widgetName.slice(1) + ' '; @@ -261,9 +262,15 @@ function textForWidgetEvent(event) { // If the widget was removed, its content should be {}, but this is sufficiently // equivalent to that condition. if (url) { - return _t('%(widgetName)s widget added by %(senderName)s', { - widgetName, senderName, - }); + if (prevUrl) { + return _t('%(widgetName)s widget modified by %(senderName)s', { + widgetName, senderName, + }); + } else { + return _t('%(widgetName)s widget added by %(senderName)s', { + widgetName, senderName, + }); + } } else { return _t('%(widgetName)s widget removed by %(senderName)s', { widgetName, senderName, diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index c1ba1d0c74..0c477c2367 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -977,5 +977,6 @@ "Hide avatars in user and room mentions": "Hide avatars in user and room mentions", "%(widgetName)s widget added by %(senderName)s": "%(widgetName)s widget added by %(senderName)s", "%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s", + "%(widgetName)s widget modified by %(senderName)s": "%(widgetName)s widget modified by %(senderName)s", "Robot check is currently unavailable on desktop - please use a web browser": "Robot check is currently unavailable on desktop - please use a web browser" } From 315f7a3ae7917d4bf0ebe32ce286cc17937e6b2c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 28 Aug 2017 13:46:09 +0100 Subject: [PATCH 28/37] apply shouldHideEvent fn to onRoomTimeline for RoomStatusBar prevents N new message(s) when a hidden message comes in. --- src/components/structures/RoomView.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index f825d1efbb..d9fc7a4e9a 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -20,6 +20,8 @@ limitations under the License. // - Drag and drop // - File uploading - uploadFile() +import shouldHideEvent from "../../shouldHideEvent"; + var React = require("react"); var ReactDOM = require("react-dom"); import Promise from 'bluebird'; @@ -143,6 +145,8 @@ module.exports = React.createClass({ MatrixClientPeg.get().on("RoomMember.membership", this.onRoomMemberMembership); MatrixClientPeg.get().on("accountData", this.onAccountData); + this._syncedSettings = UserSettingsStore.getSyncedSettings(); + // Start listening for RoomViewStore updates this._roomStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdate); this._onRoomViewStoreUpdate(true); @@ -497,8 +501,7 @@ module.exports = React.createClass({ // update unread count when scrolled up if (!this.state.searchResults && this.state.atEndOfLiveTimeline) { // no change - } - else { + } else if (!shouldHideEvent(ev, this._syncedSettings)) { this.setState((state, props) => { return {numUnreadMessages: state.numUnreadMessages + 1}; }); From ec983b838a3a1486cbde2c0733552b3d5ade14de Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 29 Aug 2017 14:07:43 +0100 Subject: [PATCH 29/37] Unbreak password reset with a non-default HS Broken by the change from onHsUrlChanged to onServerConfigChanged in https://github.com/matrix-org/matrix-react-sdk/pull/811 where ForgotPassword got missed. --- .../structures/login/ForgotPassword.js | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index 320d21f5b4..4a03ff155e 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -136,16 +136,15 @@ module.exports = React.createClass({ }); }, - onHsUrlChanged: function(newHsUrl) { - this.setState({ - enteredHomeserverUrl: newHsUrl - }); - }, - - onIsUrlChanged: function(newIsUrl) { - this.setState({ - enteredIdentityServerUrl: newIsUrl - }); + onServerConfigChange: function(config) { + const newState = {}; + if (config.hsUrl !== undefined) { + newState.enteredHomeserverUrl = config.hsUrl; + } + if (config.isUrl !== undefined) { + newState.enteredIdentityServerUrl = config.isUrl; + } + this.setState(newState); }, showErrorDialog: function(body, title) { @@ -221,8 +220,7 @@ module.exports = React.createClass({ defaultIsUrl={this.props.defaultIsUrl} customHsUrl={this.props.customHsUrl} customIsUrl={this.props.customIsUrl} - onHsUrlChanged={this.onHsUrlChanged} - onIsUrlChanged={this.onIsUrlChanged} + onServerConfigChange={this.onServerConfigChange} delayTimeMs={0}/>
From 6d5b1b7a5595317b512480915b75bcdd0c3e9cbf Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 29 Aug 2017 14:18:24 +0100 Subject: [PATCH 30/37] Percent encoding isn't a valid thing within _t Just use a plain apostrophe --- src/components/structures/login/ForgotPassword.js | 3 ++- src/i18n/strings/de_DE.json | 2 +- src/i18n/strings/el.json | 2 +- src/i18n/strings/en_EN.json | 2 +- src/i18n/strings/en_US.json | 2 +- src/i18n/strings/es.json | 2 +- src/i18n/strings/eu.json | 2 +- src/i18n/strings/fa.json | 2 +- src/i18n/strings/fr.json | 2 +- src/i18n/strings/hu.json | 2 +- src/i18n/strings/ko.json | 2 +- src/i18n/strings/lv.json | 2 +- src/i18n/strings/nb_NO.json | 2 +- src/i18n/strings/nl.json | 2 +- src/i18n/strings/pt.json | 2 +- src/i18n/strings/pt_BR.json | 2 +- src/i18n/strings/ru.json | 2 +- src/i18n/strings/sv.json | 2 +- src/i18n/strings/th.json | 2 +- src/i18n/strings/tr.json | 2 +- src/i18n/strings/zh_Hant.json | 2 +- 21 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index 320d21f5b4..4612a59b80 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2017 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -170,7 +171,7 @@ module.exports = React.createClass({ else if (this.state.progress === "sent_email") { resetPasswordJsx = (
- { _t('An email has been sent to') } {this.state.email}. { _t('Once you've followed the link it contains, click below') }. + { _t('An email has been sent to') } {this.state.email}. { _t("Once you've followed the link it contains, click below") }.
diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 2fbee2717d..ad10f6f04e 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -179,7 +179,7 @@ "Profile": "Profil", "Refer a friend to Riot:": "Freunde zu Riot einladen:", "rejected": "abgelehnt", - "Once you've followed the link it contains, click below": "Nachdem du dem darin enthaltenen Link gefolgt bist, klicke unten", + "Once you've followed the link it contains, click below": "Nachdem du dem darin enthaltenen Link gefolgt bist, klicke unten", "rejected the invitation.": "lehnte die Einladung ab.", "Reject invitation": "Einladung ablehnen", "Remove Contact Information?": "Kontakt-Informationen entfernen?", diff --git a/src/i18n/strings/el.json b/src/i18n/strings/el.json index 3ea83a322c..b1b676b505 100644 --- a/src/i18n/strings/el.json +++ b/src/i18n/strings/el.json @@ -688,7 +688,7 @@ "No display name": "Χωρίς όνομα", "No users have specific privileges in this room": "Κανένας χρήστης δεν έχει συγκεκριμένα δικαιώματα σε αυτό το δωμάτιο", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Μόλις ενεργοποιηθεί η κρυπτογράφηση για ένα δωμάτιο, δεν μπορεί να απενεργοποιηθεί ξανά (για τώρα)", - "Once you've followed the link it contains, click below": "Μόλις ακολουθήσετε τον σύνδεσμο που περιέχει, κάντε κλικ παρακάτω", + "Once you've followed the link it contains, click below": "Μόλις ακολουθήσετε τον σύνδεσμο που περιέχει, κάντε κλικ παρακάτω", "Only people who have been invited": "Μόνο άτομα που έχουν προσκληθεί", "Otherwise, click here to send a bug report.": "Διαφορετικά, κάντε κλικ εδώ για να αποστείλετε μια αναφορά σφάλματος.", "%(senderName)s placed a %(callType)s call.": "Ο %(senderName)s πραγματοποίησε μια %(callType)s κλήση.", diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index c1ba1d0c74..8fecd28f10 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -444,7 +444,7 @@ "OK": "OK", "olm version:": "olm version:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Once encryption is enabled for a room it cannot be turned off again (for now)", - "Once you've followed the link it contains, click below": "Once you've followed the link it contains, click below", + "Once you've followed the link it contains, click below": "Once you've followed the link it contains, click below", "Only people who have been invited": "Only people who have been invited", "Operation failed": "Operation failed", "Otherwise, click here to send a bug report.": "Otherwise, click here to send a bug report.", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index a68ce5d982..4b0342372e 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -404,7 +404,7 @@ "OK": "OK", "olm version:": "olm version:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Once encryption is enabled for a room it cannot be turned off again (for now)", - "Once you've followed the link it contains, click below": "Once you've followed the link it contains, click below", + "Once you've followed the link it contains, click below": "Once you've followed the link it contains, click below", "Only people who have been invited": "Only people who have been invited", "Operation failed": "Operation failed", "Password": "Password", diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index 96a986decc..0a604e31c4 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -660,7 +660,7 @@ "Hide join/leave messages (invites/kicks/bans unaffected)": "Ocultar mensajes de entrada/salida (no afecta invitaciones/kicks/bans)", "Hide avatar and display name changes": "Ocultar cambios de avatar y nombre visible", "Matrix Apps": "Aplicaciones Matrix", - "Once you've followed the link it contains, click below": "Cuando haya seguido el enlace que contiene, haga click debajo", + "Once you've followed the link it contains, click below": "Cuando haya seguido el enlace que contiene, haga click debajo", "Sets the room topic": "Configura el tema de la sala", "Show Apps": "Mostrar aplicaciones", "To get started, please pick a username!": "Para empezar, ¡por favor elija un nombre de usuario!", diff --git a/src/i18n/strings/eu.json b/src/i18n/strings/eu.json index 308fa36900..8efc3410c3 100644 --- a/src/i18n/strings/eu.json +++ b/src/i18n/strings/eu.json @@ -495,7 +495,7 @@ "No users have specific privileges in this room": "Ez dago gela honetan baimen zehatzik duen erabiltzailerik", "olm version:": "olm bertsioa:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Behin gela batean zifratzea gaituta ezin da gero desgaitu (oraingoz)", - "Once you've followed the link it contains, click below": "Behin dakarren esteka jarraitu duzula, egin klik azpian", + "Once you've followed the link it contains, click below": "Behin dakarren esteka jarraitu duzula, egin klik azpian", "Otherwise, click here to send a bug report.": "Bestela, bidali arazte-txosten bat.", "Server may be unavailable, overloaded, or you hit a bug.": "Agian zerbitzaria ez dago eskuragarri, edo gainezka dago, edo akats bat aurkitu duzu.", "Changing password will currently reset any end-to-end encryption keys on all devices, making encrypted chat history unreadable, unless you first export your room keys and re-import them afterwards. In future this will be improved.": "Oraingoz pasahitza aldatzeak gailu guztietako muturretik muturrerako zifratze-gakoak berrezarriko ditu, eta ezin izango dituzu zifratutako txatetako historialak irakurri ez badituzu aurretik zure gelako gakoak esportatzen eta aldaketa eta gero berriro inportatzen. Etorkizunean hau hobetuko da.", diff --git a/src/i18n/strings/fa.json b/src/i18n/strings/fa.json index 9e26dfeeb6..0967ef424b 100644 --- a/src/i18n/strings/fa.json +++ b/src/i18n/strings/fa.json @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 50d9113245..00a0817d89 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -395,7 +395,7 @@ "Mute": "Couper le son", "No users have specific privileges in this room": "Aucun utilisateur n’a de privilège spécifique dans ce salon", "olm version:": "version de olm :", - "Once you've followed the link it contains, click below": "Une fois que vous aurez suivi le lien qu’il contient, cliquez ci-dessous", + "Once you've followed the link it contains, click below": "Une fois que vous aurez suivi le lien qu’il contient, cliquez ci-dessous", "%(senderName)s placed a %(callType)s call.": "%(senderName)s a placé un appel %(callType)s.", "Please check your email and click on the link it contains. Once this is done, click continue.": "Veuillez vérifier vos e-mails et cliquer sur le lien que vous avez reçu. Puis cliquez sur continuer.", "Power level must be positive integer.": "Le niveau d'autorité doit être un entier positif.", diff --git a/src/i18n/strings/hu.json b/src/i18n/strings/hu.json index 7c38e41c9b..8175a8636c 100644 --- a/src/i18n/strings/hu.json +++ b/src/i18n/strings/hu.json @@ -443,7 +443,7 @@ "No users have specific privileges in this room": "Egy felhasználónak sincsenek specifikus jogosultságai ebben a szobában", "olm version:": "olm verzió:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Ha egyszer bekapcsolod a titkosítást a szobába utána nem lehet kikapcsolni (egyenlőre)", - "Once you've followed the link it contains, click below": "Miután a linket követted, kattints alulra", + "Once you've followed the link it contains, click below": "Miután a linket követted, kattints alulra", "Only people who have been invited": "Csak akiket meghívtak", "Otherwise, click here to send a bug report.": "Különben hiba jelentés küldéséhez kattints ide.", "Password": "Jelszó", diff --git a/src/i18n/strings/ko.json b/src/i18n/strings/ko.json index 411d1ccfe1..b76dd40c5e 100644 --- a/src/i18n/strings/ko.json +++ b/src/i18n/strings/ko.json @@ -452,7 +452,7 @@ "People": "사람들", "Phone": "전화", "Once encryption is enabled for a room it cannot be turned off again (for now)": "방을 암호화하면 암호화를 도중에 끌 수 없어요. (현재로서는)", - "Once you've followed the link it contains, click below": "포함된 주소를 따라가서, 아래를 누르세요", + "Once you've followed the link it contains, click below": "포함된 주소를 따라가서, 아래를 누르세요", "Only people who have been invited": "초대받은 사람만", "Otherwise, click here to send a bug report.": "그 밖에는, 여기를 눌러 오류 보고서를 보내주세요.", "%(senderName)s placed a %(callType)s call.": "%(senderName)s님이 %(callType)s 전화를 걸었어요.", diff --git a/src/i18n/strings/lv.json b/src/i18n/strings/lv.json index c2a55b3fc2..21cc3fc292 100644 --- a/src/i18n/strings/lv.json +++ b/src/i18n/strings/lv.json @@ -427,7 +427,7 @@ "OK": "LABI", "olm version:": "olm versija:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Tiklīdz istabai tiks iespējota šifrēšana, tā vairs nebūs atslēdzama (pašlaik)", - "Once you've followed the link it contains, click below": "Tiklīdz sekoji saturā esošajai saitei, noklikšķini zemāk", + "Once you've followed the link it contains, click below": "Tiklīdz sekoji saturā esošajai saitei, noklikšķini zemāk", "Only people who have been invited": "Vienīgi personas, kuras ir tikušas uzaicinātas", "Operation failed": "Darbība neizdevās", "Otherwise, click here to send a bug report.": "pretējā gadījumā, klikšķini šeit, lai nosūtītu paziņojumu par kļūdu.", diff --git a/src/i18n/strings/nb_NO.json b/src/i18n/strings/nb_NO.json index 9e26dfeeb6..0967ef424b 100644 --- a/src/i18n/strings/nb_NO.json +++ b/src/i18n/strings/nb_NO.json @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/src/i18n/strings/nl.json b/src/i18n/strings/nl.json index 234fc8c03a..360c38396b 100644 --- a/src/i18n/strings/nl.json +++ b/src/i18n/strings/nl.json @@ -504,7 +504,7 @@ "New passwords don't match": "Nieuwe wachtwoorden komen niet overeen", "New passwords must match each other.": "Nieuwe wachtwoorden moeten overeenkomen.", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Zodra versleuteling in een kamer is ingeschakeld kan het niet meer worden uitgeschakeld (voor nu)", - "Once you've followed the link it contains, click below": "Zodra je de link dat het bevat hebt gevolgd, klik hieronder", + "Once you've followed the link it contains, click below": "Zodra je de link dat het bevat hebt gevolgd, klik hieronder", "Only people who have been invited": "Alleen personen die zijn uitgenodigd", "Otherwise, click here to send a bug report.": "Klik anders hier om een foutmelding te versturen.", "Please check your email and click on the link it contains. Once this is done, click continue.": "Bekijk je e-mail en klik op de link die het bevat. Zodra dit klaar is, klik op verder gaan.", diff --git a/src/i18n/strings/pt.json b/src/i18n/strings/pt.json index 827efeb16a..2f00a87d2d 100644 --- a/src/i18n/strings/pt.json +++ b/src/i18n/strings/pt.json @@ -149,7 +149,7 @@ "No users have specific privileges in this room": "Nenhum/a usuário/a possui privilégios específicos nesta sala", "olm version: ": "Versão do olm: ", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Assim que a criptografia é ativada para uma sala, ela não poderá ser desativada novamente (ainda)", - "Once you've followed the link it contains, click below": "Quando você tiver clicado no link que está no email, clique o botão abaixo", + "Once you've followed the link it contains, click below": "Quando você tiver clicado no link que está no email, clique o botão abaixo", "Only people who have been invited": "Apenas pessoas que tenham sido convidadas", "or": "ou", "other": "outro", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 7e7ca123b9..63efda25d9 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -149,7 +149,7 @@ "No users have specific privileges in this room": "Nenhum/a usuário/a possui privilégios específicos nesta sala", "olm version: ": "Versão do olm: ", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Assim que a criptografia é ativada para uma sala, ela não poderá ser desativada novamente (ainda)", - "Once you've followed the link it contains, click below": "Quando você tiver clicado no link que está no email, clique o botão abaixo", + "Once you've followed the link it contains, click below": "Quando você tiver clicado no link que está no email, clique o botão abaixo", "Only people who have been invited": "Apenas pessoas que tenham sido convidadas", "or": "ou", "other": "outro", diff --git a/src/i18n/strings/ru.json b/src/i18n/strings/ru.json index 3f3403d716..217dac6215 100644 --- a/src/i18n/strings/ru.json +++ b/src/i18n/strings/ru.json @@ -704,7 +704,7 @@ "Jump to first unread message.": "Перейти к первому непрочитанному сообщению.", "Message not sent due to unknown devices being present": "Сообщение не отправлено из-за присутствия неизвестных устройств", "Mobile phone number (optional)": "Номер мобильного телефона (не обязательно)", - "Once you've followed the link it contains, click below": "После перехода по ссылке, нажмите на кнопку ниже", + "Once you've followed the link it contains, click below": "После перехода по ссылке, нажмите на кнопку ниже", "Password:": "Пароль:", "Privacy warning": "Предупреждение о конфиденциальности", "Privileged Users": "Привилегированные пользователи", diff --git a/src/i18n/strings/sv.json b/src/i18n/strings/sv.json index d3b512900c..f748abc131 100644 --- a/src/i18n/strings/sv.json +++ b/src/i18n/strings/sv.json @@ -429,7 +429,7 @@ "OK": "OK", "olm version:": "olm-version:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "När kryptering aktiveras i ett rum kan det inte deaktiveras (tills vidare)", - "Once you've followed the link it contains, click below": "När du har följt länken i meddelandet, klicka här", + "Once you've followed the link it contains, click below": "När du har följt länken i meddelandet, klicka här", "Only people who have been invited": "Endast inbjudna", "Operation failed": "Handlingen misslyckades", "Otherwise, click here to send a bug report.": "Annars kan du klicka här för att skicka en buggrapport.", diff --git a/src/i18n/strings/th.json b/src/i18n/strings/th.json index 01ffa729d7..f5471db7cf 100644 --- a/src/i18n/strings/th.json +++ b/src/i18n/strings/th.json @@ -251,7 +251,7 @@ "NOT verified": "ยังไม่ได้ยืนยัน", "No more results": "ไม่มีผลลัพธ์อื่น", "No results": "ไม่มีผลลัพธ์", - "Once you've followed the link it contains, click below": "หลังจากคุณเปิดลิงก์ข้างในแล้ว คลิกข้างล่าง", + "Once you've followed the link it contains, click below": "หลังจากคุณเปิดลิงก์ข้างในแล้ว คลิกข้างล่าง", "Passwords can't be empty": "รหัสผ่านต้องไม่ว่าง", "People": "บุคคล", "Permissions": "สิทธิ์", diff --git a/src/i18n/strings/tr.json b/src/i18n/strings/tr.json index 2933e2433b..035fd69e8a 100644 --- a/src/i18n/strings/tr.json +++ b/src/i18n/strings/tr.json @@ -424,7 +424,7 @@ "OK": "Tamam", "olm version:": "olm versiyon:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "Bu oda için şifreleme etkinleştirildikten sonra tekrar kapatılamaz (şimdilik)", - "Once you've followed the link it contains, click below": "Bir kere ' içerdiği bağlantıyı takip ettikten sonra , aşağıya tıklayın", + "Once you've followed the link it contains, click below": "Bir kere ' içerdiği bağlantıyı takip ettikten sonra , aşağıya tıklayın", "Only people who have been invited": "Sadece davet edilmiş insanlar", "Operation failed": "Operasyon başarısız oldu", "Otherwise, click here to send a bug report.": "Aksi taktirde , bir hata raporu göndermek için buraya tıklayın .", diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index 93ac57330a..277a11ffbe 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -556,7 +556,7 @@ "No users have specific privileges in this room": "此房間中沒有使用者有指定的權限", "olm version:": "olm 版本:", "Once encryption is enabled for a room it cannot be turned off again (for now)": "這個房間只要啟用加密就不能再關掉了(從現在開始)", - "Once you've followed the link it contains, click below": "一旦您跟著它所包含的連結,點選下方", + "Once you've followed the link it contains, click below": "一旦您跟著它所包含的連結,點選下方", "Only people who have been invited": "僅有被邀請的夥伴", "Otherwise, click here to send a bug report.": "否則,請點選此處來傳送錯誤報告。", "Password": "密碼", From b9e047f0fff5458f90318c7b32338603f23704a7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 30 Aug 2017 09:59:02 +0100 Subject: [PATCH 31/37] Avoid breaking /sync with uncaught exceptions For reasons I don't fully understand, it appears that sometimes the ReadReceiptMarker has no offsetParent. Rather than dying with an uncaught exception when that happens (and taking out half of React as well as the /sync handler), log a warning and suppress the animation. --- .../views/rooms/ReadReceiptMarker.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/views/rooms/ReadReceiptMarker.js b/src/components/views/rooms/ReadReceiptMarker.js index 64b54fe1e1..44d1e651d7 100644 --- a/src/components/views/rooms/ReadReceiptMarker.js +++ b/src/components/views/rooms/ReadReceiptMarker.js @@ -123,7 +123,19 @@ module.exports = React.createClass({ } var newElement = ReactDOM.findDOMNode(this); - var startTopOffset = oldTop - newElement.offsetParent.getBoundingClientRect().top; + let startTopOffset; + if (!newElement.offsetParent) { + // this seems to happen sometimes for reasons I don't understand + // the docs for `offsetParent` say it may be null if `display` is + // `none`, but I can't see why that would happen. + console.warn( + `ReadReceiptMarker for ${this.props.member.userId} in ` + + `${this.props.member.roomId} has no offsetParent`, + ); + startTopOffset = 0; + } else { + startTopOffset = oldTop - newElement.offsetParent.getBoundingClientRect().top; + } var startStyles = []; var enterTransitionOpts = []; @@ -131,13 +143,12 @@ module.exports = React.createClass({ if (oldInfo && oldInfo.left) { // start at the old height and in the old h pos - var leftOffset = oldInfo.left; startStyles.push({ top: startTopOffset+"px", left: oldInfo.left+"px" }); var reorderTransitionOpts = { duration: 100, - easing: 'easeOut' + easing: 'easeOut', }; enterTransitionOpts.push(reorderTransitionOpts); @@ -175,7 +186,7 @@ module.exports = React.createClass({ if (this.props.timestamp) { title = _t( "Seen by %(userName)s at %(dateTime)s", - {userName: this.props.member.userId, dateTime: DateUtils.formatDate(new Date(this.props.timestamp), this.props.showTwelveHour)} + {userName: this.props.member.userId, dateTime: DateUtils.formatDate(new Date(this.props.timestamp), this.props.showTwelveHour)}, ); } From 2ff18880546e21078ed8de53bfd251ac137b68d4 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 30 Aug 2017 10:36:22 +0100 Subject: [PATCH 32/37] Make staging widgets work with live and vice versa. --- src/components/views/elements/AppTile.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 06a1829b75..7436f84f69 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -72,8 +72,17 @@ export default React.createClass({ // Returns true if props.url is a scalar URL, typically https://scalar.vector.im/api isScalarUrl: function() { - const scalarUrl = SdkConfig.get().integrations_rest_url; - return scalarUrl && this.props.url.startsWith(scalarUrl); + let scalarUrls = SdkConfig.get().integrations_widgets_urls; + if (!scalarUrls || scalarUrls.length == 0) { + scalarUrls = [SdkConfig.get().integrations_rest_url]; + } + + for (let i = 0; i < scalarUrls.length; i++) { + if (this.props.url.startsWith(scalarUrls[i])) { + return true; + } + } + return false; }, isMixedContent: function() { From e800c29e8099c86c77e6d889c432f56767c76fc7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 30 Aug 2017 11:28:01 +0100 Subject: [PATCH 33/37] Update .eslintignore.errorfiles We seem to have fixed the lint in a bunch of files. --- .eslintignore.errorfiles | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.eslintignore.errorfiles b/.eslintignore.errorfiles index 498dfb8818..28e56e6e32 100644 --- a/.eslintignore.errorfiles +++ b/.eslintignore.errorfiles @@ -6,7 +6,6 @@ src/autocomplete/Autocompleter.js src/autocomplete/Components.js src/autocomplete/DuckDuckGoProvider.js src/autocomplete/EmojiProvider.js -src/autocomplete/RoomProvider.js src/autocomplete/UserProvider.js src/CallHandler.js src/component-index.js @@ -35,7 +34,6 @@ src/components/views/create_room/RoomAlias.js src/components/views/dialogs/ChatCreateOrReuseDialog.js src/components/views/dialogs/DeactivateAccountDialog.js src/components/views/dialogs/InteractiveAuthDialog.js -src/components/views/dialogs/SetMxIdDialog.js src/components/views/dialogs/UnknownDeviceDialog.js src/components/views/elements/AccessibleButton.js src/components/views/elements/ActionButton.js @@ -89,7 +87,6 @@ src/components/views/rooms/MemberList.js src/components/views/rooms/MemberTile.js src/components/views/rooms/MessageComposer.js src/components/views/rooms/MessageComposerInput.js -src/components/views/rooms/MessageComposerInputOld.js src/components/views/rooms/PresenceLabel.js src/components/views/rooms/ReadReceiptMarker.js src/components/views/rooms/RoomList.js @@ -100,7 +97,6 @@ src/components/views/rooms/RoomTile.js src/components/views/rooms/RoomTopicEditor.js src/components/views/rooms/SearchableEntityList.js src/components/views/rooms/SearchResultTile.js -src/components/views/rooms/TabCompleteBar.js src/components/views/rooms/TopUnreadMessagesBar.js src/components/views/rooms/UserTile.js src/components/views/settings/AddPhoneNumber.js @@ -128,8 +124,6 @@ src/Roles.js src/Rooms.js src/ScalarAuthClient.js src/ScalarMessaging.js -src/TabComplete.js -src/TabCompleteEntries.js src/TextForEvent.js src/Tinter.js src/UiEffects.js @@ -142,7 +136,7 @@ src/utils/Receipt.js src/Velociraptor.js src/VelocityBounce.js src/WhoIsTyping.js -src/wrappers/WithMatrixClient.js +src/wrappers/withMatrixClient.js test/all-tests.js test/components/structures/login/Registration-test.js test/components/structures/MessagePanel-test.js From 282618d5a10fe7e5b9f47560cb8353ce67ac51f2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Aug 2017 13:18:14 +0100 Subject: [PATCH 34/37] separate concepts of showing and managing RRs to fix regression --- src/components/structures/MessagePanel.js | 4 ++-- src/components/structures/RoomView.js | 25 +++++++++++----------- src/components/structures/TimelinePanel.js | 5 +++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 460ed43e82..e5884973c6 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -65,7 +65,7 @@ module.exports = React.createClass({ suppressFirstDateSeparator: React.PropTypes.bool, // whether to show read receipts - manageReadReceipts: React.PropTypes.bool, + showReadReceipts: React.PropTypes.bool, // true if updates to the event list should cause the scroll panel to // scroll down when we are at the bottom of the window. See ScrollPanel @@ -491,7 +491,7 @@ module.exports = React.createClass({ var scrollToken = mxEv.status ? undefined : eventId; var readReceipts; - if (this.props.manageReadReceipts) { + if (this.props.showReadReceipts) { readReceipts = this._getReadReceiptsForEvent(mxEv); } ret.push( diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index f825d1efbb..82afef1f8f 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1715,18 +1715,19 @@ module.exports = React.createClass({ // console.log("ShowUrlPreview for %s is %s", this.state.room.roomId, this.state.showUrlPreview); var messagePanel = (