From 2ca0a99dce732dafbd986373378de067783517d8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 9 Jul 2021 21:49:37 +0200 Subject: [PATCH] Follow the spec https://github.com/matrix-org/matrix-doc/blob/travis/msc/voice-messages/proposals/3245-voice-messages.md#unstable-prefix --- .../sdk/api/session/room/model/message/MessageAudioContent.kt | 3 ++- .../sdk/internal/session/room/send/LocalEchoEventFactory.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageAudioContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageAudioContent.kt index 3ce4cd6932..cc73ffa127 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageAudioContent.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageAudioContent.kt @@ -20,6 +20,7 @@ import com.squareup.moshi.Json import com.squareup.moshi.JsonClass import org.matrix.android.sdk.api.session.events.model.Content import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent +import org.matrix.android.sdk.api.util.JsonDict import org.matrix.android.sdk.internal.crypto.model.rest.AudioWaveformInfo import org.matrix.android.sdk.internal.crypto.model.rest.EncryptedFileInfo @@ -61,7 +62,7 @@ data class MessageAudioContent( /** * Indicates that is a voice message. */ - @Json(name = "org.matrix.msc2516.voice") val voiceMessageIndicator: Any? = null + @Json(name = "org.matrix.msc3245.voice") val voiceMessageIndicator: JsonDict? = null ) : MessageWithAttachmentContent { override val mimeType: String? diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt index 4b9f69501e..4e18b68823 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt @@ -303,7 +303,7 @@ internal class LocalEchoEventFactory @Inject constructor( duration = attachment.duration?.toInt(), waveform = attachment.waveform ), - voiceMessageIndicator = if (!isVoiceMessage) null else Any() + voiceMessageIndicator = if (!isVoiceMessage) null else emptyMap() ) return createMessageEvent(roomId, content) }