diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index ba67d3cd43..adad8bc060 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -213,7 +213,7 @@ module.exports = React.createClass({ sendReadReceipt: function() { if (!this.refs.messagePanel) return; - var currentReadUpToEventId = this._getCurrentReadReceipt(); + var currentReadUpToEventId = this._getCurrentReadReceipt(true); var currentReadUpToEventIndex = this._indexForEventId(currentReadUpToEventId); // We want to avoid sending out read receipts when we are looking at @@ -396,15 +396,20 @@ module.exports = React.createClass({ /** * get the id of the event corresponding to our user's latest read-receipt. + * + * @param {Boolean} ignoreSynthesized If true, return only receipts that + * have been sent by the server, not + * implicit ones generated by the JS + * SDK. */ - _getCurrentReadReceipt: function() { + _getCurrentReadReceipt: function(ignoreSynthesized) { var client = MatrixClientPeg.get(); // the client can be null on logout if (client == null) return null; var myUserId = client.credentials.userId; - return this.props.room.getEventReadUpTo(myUserId); + return this.props.room.getEventReadUpTo(myUserId, ignoreSynthesized); }, diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index abb51e85d8..7fb043f800 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -114,6 +114,17 @@ matrixLinkify.options = { } }; } + }, + + formatHref: function (href, type) { + switch (type) { + case 'roomalias': + return '#/room/' + href; + case 'userid': + return '#'; + default: + return href; + } } };