Fix unread messages marker being hidden in collapsed membership item

Scenario: the last read event in a chat is a membership change. After
that, at least two new membership changes were added, followed by normal
messages. Due to the membership changes being collapsed by default, in
this scenario the read marker would not show, since in the loop, we
would overwrite the appendReadMarker with the value for the last eventId
of the merged item, instead of showing it if any of the items matched.

Change-Id: I791627df6776ebf791310eb082b648701936d565
This commit is contained in:
SpiritCroc 2021-07-10 10:45:37 +02:00
parent 7d377ea418
commit 00c2f271b3

View file

@ -73,7 +73,7 @@ class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMut
}
epoxyModel.getEventIds().forEach { eventId ->
adapterPositionMapping[eventId] = index
appendReadMarker = epoxyModel.canAppendReadMarker() && eventId == firstUnreadEventId && atLeastOneVisibleItemsBeforeReadMarker
appendReadMarker = appendReadMarker || (epoxyModel.canAppendReadMarker() && eventId == firstUnreadEventId && atLeastOneVisibleItemsBeforeReadMarker)
}
}
if (epoxyModel is DaySeparatorItem) {