From 4b12f162a07904061a645b40589385dfd98e1287 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 9 Mar 2022 10:22:25 +0100 Subject: [PATCH] View displayIndex in timeline to debug chunks if developer info enabled Change-Id: Id52e6f69b6fbe18cb78a3bdeca220fa58b4e7a82 --- .../timeline/helper/MessageInformationDataFactory.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt index d7be186f85..1999f6ee56 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt @@ -54,6 +54,7 @@ import javax.inject.Inject * This class compute if data of an event (such has avatar, display name, ...) should be displayed, depending on the previous event in the timeline */ class MessageInformationDataFactory @Inject constructor(private val session: Session, + private val vectorPreferences: VectorPreferences, private val dateFormatter: VectorDateFormatter, private val messageLayoutFactory: TimelineMessageLayoutFactory, private val reactionsSummaryFactory: ReactionsSummaryFactory) { @@ -74,7 +75,13 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId || prevDisplayableEvent?.root?.localDateTime()?.toLocalDate() != date.toLocalDate() - val time = dateFormatter.format(event.root.originServerTs, DateFormatKind.MESSAGE_SIMPLE) + val time = dateFormatter.format(event.root.originServerTs, DateFormatKind.MESSAGE_SIMPLE).let { + if (vectorPreferences.developerShowDebugInfo()) { + "$it | ${event.displayIndex}" + } else { + it + } + } val e2eDecoration = getE2EDecoration(roomSummary, event) // Sometimes, member information is not available at this point yet, so let's completely rely on the DM flag for now.