From 9b60ee70c5840c3c1e79a93c3a93d2fe9a2b220e Mon Sep 17 00:00:00 2001 From: networkException Date: Thu, 26 May 2022 17:27:27 +0200 Subject: [PATCH] MessageInformationData: Add messageType field This patch adds the messageType field to MessageInformationData, containing a nullable string representation of the message event's type. Signed-off-by: networkException --- .../detail/timeline/helper/MessageInformationDataFactory.kt | 2 ++ .../home/room/detail/timeline/item/MessageInformationData.kt | 1 + 2 files changed, 3 insertions(+) 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 7874f843e1..7e4ec75783 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 @@ -32,6 +32,7 @@ import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.crypto.verification.VerificationState import org.matrix.android.sdk.api.session.events.model.EventType import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent +import org.matrix.android.sdk.api.session.events.model.getMsgType import org.matrix.android.sdk.api.session.events.model.isAttachmentMessage import org.matrix.android.sdk.api.session.events.model.toModel import org.matrix.android.sdk.api.session.room.model.ReferencesAggregatedContent @@ -119,6 +120,7 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses isLastFromThisSender = isLastFromThisSender, e2eDecoration = e2eDecoration, sendStateDecoration = sendStateDecoration, + messageType = event.root.getMsgType() ) } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt index 258424c7de..554dd0ada8 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt @@ -43,6 +43,7 @@ data class MessageInformationData( val sendStateDecoration: SendStateDecoration = SendStateDecoration.NONE, val isFirstFromThisSender: Boolean = false, val isLastFromThisSender: Boolean = false, + val messageType: String? = null ) : Parcelable { val matrixItem: MatrixItem