From e61fc1a935c6928b5383b794a39f8b861b93db8d Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Sat, 10 Jul 2021 10:45:37 +0200 Subject: [PATCH] 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. --- .../timeline/helper/TimelineControllerInterceptorHelper.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt index 389dd15413..3121f031e2 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt @@ -73,7 +73,8 @@ 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) {