From 63329499ac8dd8ec255c0b9603bf87af395ce9bd Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 8 Mar 2021 16:03:48 +0100 Subject: [PATCH] Add comments --- .../android/sdk/api/session/room/timeline/TimelineEvent.kt | 3 +++ .../home/room/detail/timeline/TimelineEventController.kt | 1 + 2 files changed, 4 insertions(+) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt index 7010a80233..32f6b94cd8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt @@ -38,6 +38,9 @@ import org.matrix.android.sdk.api.util.ContentUtils.extractUsefulTextFromReply */ data class TimelineEvent( val root: Event, + /** + * Uniquely identify an event, computed locally by the sdk + */ val localId: Long, val eventId: String, val displayIndex: Int, diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/TimelineEventController.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/TimelineEventController.kt index 9acd34c827..41d9fd6de2 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/TimelineEventController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/TimelineEventController.kt @@ -427,6 +427,7 @@ class TimelineEventController @Inject constructor(private val dateFormatter: Vec val formattedDayModel: DaySeparatorItem? = null ) { fun shouldTriggerBuild(): Boolean { + // Since those items can change when we paginate, force a re-build return mergedHeaderModel != null || formattedDayModel != null } }