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 <git@nwex.de>
This commit is contained in:
networkException 2022-05-26 17:27:27 +02:00
parent f86362f065
commit 9b60ee70c5
No known key found for this signature in database
GPG Key ID: C1F2658DC370C8FC
2 changed files with 3 additions and 0 deletions

View File

@ -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.crypto.verification.VerificationState
import org.matrix.android.sdk.api.session.events.model.EventType 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.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.isAttachmentMessage
import org.matrix.android.sdk.api.session.events.model.toModel import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.ReferencesAggregatedContent import org.matrix.android.sdk.api.session.room.model.ReferencesAggregatedContent
@ -119,6 +120,7 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses
isLastFromThisSender = isLastFromThisSender, isLastFromThisSender = isLastFromThisSender,
e2eDecoration = e2eDecoration, e2eDecoration = e2eDecoration,
sendStateDecoration = sendStateDecoration, sendStateDecoration = sendStateDecoration,
messageType = event.root.getMsgType()
) )
} }

View File

@ -43,6 +43,7 @@ data class MessageInformationData(
val sendStateDecoration: SendStateDecoration = SendStateDecoration.NONE, val sendStateDecoration: SendStateDecoration = SendStateDecoration.NONE,
val isFirstFromThisSender: Boolean = false, val isFirstFromThisSender: Boolean = false,
val isLastFromThisSender: Boolean = false, val isLastFromThisSender: Boolean = false,
val messageType: String? = null
) : Parcelable { ) : Parcelable {
val matrixItem: MatrixItem val matrixItem: MatrixItem