From 0079e70006dd0f72238c3b664155f0b11f8cdbd1 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 14 Aug 2017 15:40:49 +0100 Subject: [PATCH] Display RM when it = a standalone member event Standalone = not next to any member events in the timeline. fixes vector-im/riot-web#4694 --- src/components/structures/MessagePanel.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 6f4a5460f6..02f224e942 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -307,13 +307,13 @@ module.exports = React.createClass({ for (i = 0; i < this.props.events.length; i++) { let mxEv = this.props.events[i]; let eventId = mxEv.getId(); - let readMarkerInMels = false; let last = (mxEv === lastShownEvent); const wantTile = this._shouldShowEvent(mxEv); // Wrap consecutive member events in a ListSummary, ignore if redacted if (isMembershipChange(mxEv) && wantTile) { + let readMarkerInMels = false; let ts1 = mxEv.getTs(); // Ensure that the key of the MemberEventListSummary does not change with new // member events. This will prevent it from being re-created unnecessarily, and @@ -330,6 +330,11 @@ module.exports = React.createClass({ ret.push(dateSeparator); } + // If RM event is the first in the MELS, append the RM after MELS + if (mxEv.getId() === this.props.readMarkerEventId) { + readMarkerInMels = true; + } + let summarisedEvents = [mxEv]; for (;i + 1 < this.props.events.length; i++) { const collapsedMxEv = this.props.events[i + 1];