From d63a0d30c8de47ca1acc3886b7f6aab13976ff2c Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 25 Aug 2017 13:18:01 +0100 Subject: [PATCH 01/12] 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 02/12] 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 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 03/12] 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 04/12] 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 05/12] 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 06/12] 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 07/12] 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 08/12] 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 09/12] 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 10/12] 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 11/12] 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 = (