View displayIndex in timeline to debug chunks if developer info enabled

Change-Id: Id52e6f69b6fbe18cb78a3bdeca220fa58b4e7a82
This commit is contained in:
SpiritCroc 2022-03-09 10:22:25 +01:00
parent 96d7e4859b
commit 4b12f162a0

View file

@ -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 * 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, class MessageInformationDataFactory @Inject constructor(private val session: Session,
private val vectorPreferences: VectorPreferences,
private val dateFormatter: VectorDateFormatter, private val dateFormatter: VectorDateFormatter,
private val messageLayoutFactory: TimelineMessageLayoutFactory, private val messageLayoutFactory: TimelineMessageLayoutFactory,
private val reactionsSummaryFactory: ReactionsSummaryFactory) { private val reactionsSummaryFactory: ReactionsSummaryFactory) {
@ -74,7 +75,13 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses
val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId || val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId ||
prevDisplayableEvent?.root?.localDateTime()?.toLocalDate() != date.toLocalDate() 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) 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. // Sometimes, member information is not available at this point yet, so let's completely rely on the DM flag for now.