Don't group timeline items if more than 5 minutes has passed. (#4138)

Matches the behaviour on web.
This commit is contained in:
Doug
2025-05-21 10:34:22 +01:00
committed by GitHub
parent de5dbdcdf8
commit d76b76d041
@@ -840,8 +840,9 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
return false
}
// can be improved by adding a date threshold
return eventTimelineItem.properties.reactions.isEmpty && eventTimelineItem.sender == otherEventTimelineItem.sender
return eventTimelineItem.sender == otherEventTimelineItem.sender
&& eventTimelineItem.properties.reactions.isEmpty // Reactions break the grouping.
&& otherEventTimelineItem.timestamp.timeIntervalSince(eventTimelineItem.timestamp) < 5 * 60 // As does the passage of time.
}
// MARK: - Direct chats logics