diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d9a01e668..988a85fd43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +Changes in [1.1.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v1.1.1) (2019-05-14) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v1.1.0...v1.1.1) + + * Fix registration with email + [\#2970](https://github.com/matrix-org/matrix-react-sdk/pull/2970) + * Fix bug where email was not required where it shouldn't have been + [\#2969](https://github.com/matrix-org/matrix-react-sdk/pull/2969) + Changes in [1.1.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v1.1.0) (2019-05-07) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v1.1.0-rc.1...v1.1.0) diff --git a/package.json b/package.json index 991080cb7e..bcbf6ea29f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "1.1.0", + "version": "1.1.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { diff --git a/res/css/views/messages/_MessageActionBar.scss b/res/css/views/messages/_MessageActionBar.scss index 419542036e..e66c99e95b 100644 --- a/res/css/views/messages/_MessageActionBar.scss +++ b/res/css/views/messages/_MessageActionBar.scss @@ -23,7 +23,7 @@ limitations under the License. line-height: 24px; border-radius: 4px; background: $message-action-bar-bg-color; - top: -13px; + top: -18px; right: 8px; user-select: none; diff --git a/res/css/views/messages/_ReactionsRowButton.scss b/res/css/views/messages/_ReactionsRowButton.scss index 49e3930979..3c6d019b30 100644 --- a/res/css/views/messages/_ReactionsRowButton.scss +++ b/res/css/views/messages/_ReactionsRowButton.scss @@ -24,6 +24,7 @@ limitations under the License. border-radius: 10px; background-color: $reaction-row-button-bg-color; cursor: pointer; + user-select: none; &:hover { border-color: $reaction-row-button-hover-border-color; diff --git a/src/Lifecycle.js b/src/Lifecycle.js index 527394da4d..0e2389fd1c 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -126,6 +126,15 @@ export function getStoredSessionOwner() { return hsUrl && userId && accessToken ? userId : null; } +/** + * @returns {bool} True if the stored session is for a guest user or false if it is + * for a real user. If there is no stored session, return null. + */ +export function getStoredSessionIsGuest() { + const sessVars = _getLocalStorageSessionVars(); + return sessVars.hsUrl && sessVars.userId && sessVars.accessToken ? sessVars.isGuest : null; +} + /** * @param {Object} queryParams string->string map of the * query-parameters extracted from the real query-string of the starting @@ -235,7 +244,15 @@ function _getLocalStorageSessionVars() { const userId = localStorage.getItem("mx_user_id"); const deviceId = localStorage.getItem("mx_device_id"); - return {hsUrl, isUrl, accessToken, userId, deviceId}; + let isGuest; + if (localStorage.getItem("mx_is_guest") !== null) { + isGuest = localStorage.getItem("mx_is_guest") === "true"; + } else { + // legacy key name + isGuest = localStorage.getItem("matrix-is-guest") === "true"; + } + + return {hsUrl, isUrl, accessToken, userId, deviceId, isGuest}; } // returns a promise which resolves to true if a session is found in @@ -253,15 +270,7 @@ async function _restoreFromLocalStorage() { return false; } - const {hsUrl, isUrl, accessToken, userId, deviceId} = _getLocalStorageSessionVars(); - - let isGuest; - if (localStorage.getItem("mx_is_guest") !== null) { - isGuest = localStorage.getItem("mx_is_guest") === "true"; - } else { - // legacy key name - isGuest = localStorage.getItem("matrix-is-guest") === "true"; - } + const {hsUrl, isUrl, accessToken, userId, deviceId, isGuest} = _getLocalStorageSessionVars(); if (accessToken && userId && hsUrl) { console.log(`Restoring session for ${userId}`); diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 763eddbd5d..cd40c7874e 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -175,6 +175,8 @@ class MatrixClientPeg { } _createClient(creds: MatrixClientCreds) { + const aggregateRelations = SettingsStore.isFeatureEnabled("feature_reactions"); + const opts = { baseUrl: creds.homeserverUrl, idBaseUrl: creds.identityServerUrl, @@ -183,7 +185,8 @@ class MatrixClientPeg { deviceId: creds.deviceId, timelineSupport: true, forceTURN: !SettingsStore.getValue('webRtcAllowPeerToPeer', false), - verificationMethods: [verificationMethods.SAS] + verificationMethods: [verificationMethods.SAS], + unstableClientRelationAggregation: aggregateRelations, }; this.matrixClient = createMatrixClient(opts); diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 277985ba1d..0b52cfa1bc 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1710,14 +1710,15 @@ export default React.createClass({ // returns a promise which resolves to the new MatrixClient onRegistered: function(credentials) { - // XXX: This should be in state or ideally store(s) because we risk not - // rendering the most up-to-date view of state otherwise. - this._is_registered = true; if (this.state.register_session_id) { // The user came in through an email validation link. To avoid overwriting - // their session, check to make sure the session isn't someone else. + // their session, check to make sure the session isn't someone else, and + // isn't a guest user since we'll usually have set a guest user session before + // starting the registration process. This isn't perfect since it's possible + // the user had a separate guest session they didn't actually mean to replace. const sessionOwner = Lifecycle.getStoredSessionOwner(); - if (sessionOwner && sessionOwner !== credentials.userId) { + const sessionIsGuest = Lifecycle.getStoredSessionIsGuest(); + if (sessionOwner && !sessionIsGuest && sessionOwner !== credentials.userId) { console.log( `Found a session for ${sessionOwner} but ${credentials.userId} is trying to verify their ` + `email address. Restoring the session for ${sessionOwner} with warning.`, @@ -1748,6 +1749,9 @@ export default React.createClass({ return MatrixClientPeg.get(); } } + // XXX: This should be in state or ideally store(s) because we risk not + // rendering the most up-to-date view of state otherwise. + this._is_registered = true; return Lifecycle.setLoggedIn(credentials); }, diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index b57b659136..2037217710 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -92,6 +92,9 @@ module.exports = React.createClass({ // show timestamps always alwaysShowTimestamps: PropTypes.bool, + + // helper function to access relations for an event + getRelationsForEvent: PropTypes.func, }, componentWillMount: function() { @@ -511,22 +514,27 @@ module.exports = React.createClass({ readReceipts = this._getReadReceiptsForEvent(mxEv); } ret.push( -
  • - -
  • , +
  • + +
  • , ); return ret; diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index aa278f2349..17a062be98 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -1168,6 +1168,10 @@ const TimelinePanel = React.createClass({ }); }, + getRelationsForEvent(...args) { + return this.props.timelineSet.getRelationsForEvent(...args); + }, + render: function() { const MessagePanel = sdk.getComponent("structures.MessagePanel"); const Loader = sdk.getComponent("elements.Spinner"); @@ -1193,9 +1197,9 @@ const TimelinePanel = React.createClass({ if (this.state.events.length == 0 && !this.state.canBackPaginate && this.props.empty) { return ( -
    -
    { this.props.empty }
    -
    +
    +
    {this.props.empty}
    +
    ); } @@ -1217,28 +1221,29 @@ const TimelinePanel = React.createClass({ ); return (