diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/factories/event/TimelineItemEventFactory.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/factories/event/TimelineItemEventFactory.kt index d0aecbb8a0..af3e18e3cc 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/factories/event/TimelineItemEventFactory.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/factories/event/TimelineItemEventFactory.kt @@ -38,7 +38,6 @@ import io.element.android.libraries.matrix.ui.messages.reply.map import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableList -/** Events further apart than this are never grouped together, even when sent by the same person. */ private const val GROUPING_TIMEOUT_MS = 5 * 60 * 1000L @AssistedInject @@ -224,10 +223,6 @@ class TimelineItemEventFactory( val previousSender = prevTimelineItem?.event?.sender val nextSender = nextTimelineItem?.event?.sender - // Two events from the same sender are only grouped together if they were sent within - // GROUPING_TIMEOUT_MS of each other. The delta is symmetric between a pair of neighbours, so - // both items always agree on where the group is split. - // See https://github.com/element-hq/element-x-android/issues/4757 val previousIsGroupable = prevTimelineItem?.let { it.canBeDisplayedInBubbleBlock() && currentTimelineItem.event.timestamp - it.event.timestamp <= GROUPING_TIMEOUT_MS diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/factories/TimelineItemsFactoryTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/factories/TimelineItemsFactoryTest.kt index 0000ea1f07..53c39ee530 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/factories/TimelineItemsFactoryTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/factories/TimelineItemsFactoryTest.kt @@ -106,8 +106,6 @@ class TimelineItemsFactoryTest { roomMembers = emptyList(), renderReadReceipts = false, ) - // The factory emits the timeline newest-first; reverse it so the assertions below read - // in the same chronological order as the timestamps that were fed in. positions = awaitItem() .filterIsInstance() .map { it.groupPosition }