From 741ae9957bbc334cdc62d2da7e6e8ea7fd9c0faa Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Jul 2019 10:15:09 +0200 Subject: [PATCH 1/3] also put read marker past (like RR) invisible events --- src/components/structures/TimelinePanel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 6eb1599147..7f18589ba0 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -747,6 +747,7 @@ const TimelinePanel = React.createClass({ const lastDisplayedIndex = this._getLastDisplayedEventIndex({ allowPartial: true, ignoreEchoes: true, + allowEventsWithoutTiles: true, }); if (lastDisplayedIndex === null) { From c94715150d96ad1961684743c04157047e713005 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Jul 2019 10:18:51 +0200 Subject: [PATCH 2/3] as both RM and RR move past invisible events, remove the flag --- src/components/structures/TimelinePanel.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 7f18589ba0..e367544492 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -658,7 +658,6 @@ const TimelinePanel = React.createClass({ const lastReadEventIndex = this._getLastDisplayedEventIndex({ ignoreOwn: true, - allowEventsWithoutTiles: true, }); if (lastReadEventIndex === null) { shouldSendRR = false; @@ -747,7 +746,6 @@ const TimelinePanel = React.createClass({ const lastDisplayedIndex = this._getLastDisplayedEventIndex({ allowPartial: true, ignoreEchoes: true, - allowEventsWithoutTiles: true, }); if (lastDisplayedIndex === null) { @@ -1132,7 +1130,6 @@ const TimelinePanel = React.createClass({ const ignoreOwn = opts.ignoreOwn || false; const ignoreEchoes = opts.ignoreEchoes || false; const allowPartial = opts.allowPartial || false; - const allowEventsWithoutTiles = opts.allowEventsWithoutTiles || false; const messagePanel = this.refs.messagePanel; if (messagePanel === undefined) return null; @@ -1153,8 +1150,7 @@ const TimelinePanel = React.createClass({ return false; }; - // if allowEventsWithoutTiles is enabled, we keep track - // of how many of the adjacent events didn't have a tile + // We keep track of how many of the adjacent events didn't have a tile // but should have the read receipt moved past them, so // we can include those once we find the last displayed (visible) event. // The counter is not started for events we don't want @@ -1183,7 +1179,7 @@ const TimelinePanel = React.createClass({ (ignoreOwn && ev.sender && ev.sender.userId == myUserId); // own message const isWithoutTile = !EventTile.haveTileForEvent(ev) || shouldHideEvent(ev); - if (allowEventsWithoutTiles && (isWithoutTile || !node)) { + if (isWithoutTile || !node) { // don't start counting if the event should be ignored, // but continue counting if we were already so the offset // to the previous invisble event that didn't need to be ignored From 3d4cd8aa1c6c8acf9c8d7e83f5fce570ae19a46a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Jul 2019 10:19:44 +0200 Subject: [PATCH 3/3] local echos should always be ignored (for both RM and RR),so remove flag pending events won't be in liveEvents (where we look) anyway --- src/components/structures/TimelinePanel.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index e367544492..5c18267637 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -738,14 +738,8 @@ const TimelinePanel = React.createClass({ // move the RM to *after* the message at the bottom of the screen. This // avoids a problem whereby we never advance the RM if there is a huge // message which doesn't fit on the screen. - // - // But ignore local echoes for this - they have a temporary event ID - // and we'll get confused when their ID changes and we can't figure out - // where the RM is pointing to. The read marker will be invisible for - // now anyway, so this doesn't really matter. const lastDisplayedIndex = this._getLastDisplayedEventIndex({ allowPartial: true, - ignoreEchoes: true, }); if (lastDisplayedIndex === null) { @@ -1128,7 +1122,6 @@ const TimelinePanel = React.createClass({ _getLastDisplayedEventIndex: function(opts) { opts = opts || {}; const ignoreOwn = opts.ignoreOwn || false; - const ignoreEchoes = opts.ignoreEchoes || false; const allowPartial = opts.allowPartial || false; const messagePanel = this.refs.messagePanel; @@ -1175,7 +1168,7 @@ const TimelinePanel = React.createClass({ adjacentInvisibleEventCount = 0; } - const shouldIgnore = (ignoreEchoes && ev.status) || // local echo + const shouldIgnore = !!ev.status || // local echo (ignoreOwn && ev.sender && ev.sender.userId == myUserId); // own message const isWithoutTile = !EventTile.haveTileForEvent(ev) || shouldHideEvent(ev);