Skip to content

Commit d76b76d

Browse files
authored
Don't group timeline items if more than 5 minutes has passed. (#4138)
Matches the behaviour on web.
1 parent de5dbdc commit d76b76d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ElementX/Sources/Screens/Timeline/TimelineViewModel.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,9 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
840840
return false
841841
}
842842

843-
// can be improved by adding a date threshold
844-
return eventTimelineItem.properties.reactions.isEmpty && eventTimelineItem.sender == otherEventTimelineItem.sender
843+
return eventTimelineItem.sender == otherEventTimelineItem.sender
844+
&& eventTimelineItem.properties.reactions.isEmpty // Reactions break the grouping.
845+
&& otherEventTimelineItem.timestamp.timeIntervalSince(eventTimelineItem.timestamp) < 5 * 60 // As does the passage of time.
845846
}
846847

847848
// MARK: - Direct chats logics

0 commit comments

Comments
 (0)