Prefer testing attachment.waveform to see if it's a voice message

This commit is contained in:
Benoit Marty 2021-07-09 22:17:04 +02:00
parent 984112e83f
commit db80ea6432

View file

@ -290,7 +290,7 @@ internal class LocalEchoEventFactory @Inject constructor(
} }
private fun createAudioEvent(roomId: String, attachment: ContentAttachmentData): Event { private fun createAudioEvent(roomId: String, attachment: ContentAttachmentData): Event {
val isVoiceMessage = attachment.mimeType == "audio/ogg" val isVoiceMessage = attachment.waveform != null
val content = MessageAudioContent( val content = MessageAudioContent(
msgType = MessageType.MSGTYPE_AUDIO, msgType = MessageType.MSGTYPE_AUDIO,
body = attachment.name ?: "audio", body = attachment.name ?: "audio",