From ee22dafbc90732003f5944c95a577bcf75ddb7fb Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Mon, 28 Nov 2022 12:14:31 +0100 Subject: [PATCH] Fix regression when getting last message content for Voice Broadcast state event --- .../main/java/im/vector/app/core/extensions/TimelineEvent.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt b/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt index 63144ca1b3..c94f9cd921 100644 --- a/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt +++ b/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt @@ -19,7 +19,6 @@ package im.vector.app.core.extensions import im.vector.app.features.voicebroadcast.VoiceBroadcastConstants import im.vector.app.features.voicebroadcast.model.MessageVoiceBroadcastInfoContent import org.matrix.android.sdk.api.session.events.model.EventType -import org.matrix.android.sdk.api.session.events.model.toContent import org.matrix.android.sdk.api.session.events.model.toModel import org.matrix.android.sdk.api.session.room.model.message.MessageContent import org.matrix.android.sdk.api.session.room.send.SendState @@ -41,7 +40,7 @@ fun TimelineEvent.getVectorLastMessageContent(): MessageContent? { // Iterate on event types which are not part of the matrix sdk, otherwise fallback to the sdk method return when (root.getClearType()) { VoiceBroadcastConstants.STATE_ROOM_VOICE_BROADCAST_INFO -> { - (annotations?.editSummary?.latestEdit?.getClearContent()?.toModel().toContent().toModel() + (annotations?.editSummary?.latestEdit?.getClearContent()?.toModel() ?: root.getClearContent().toModel()) } else -> getLastMessageContent()