Split VoiceMessageType from AudioMessageType (#1664)

Currently, for compatibility reasons, we implement MSC3245v1 which puts the voice data inside an audio message type. Though at times it seems impractical to deal with a single message type which effectively represents 2 different kinds of messages.

This PR creates a new message type called `VoiceMessageType` which is used whenever we receive an event with `"msgtype": "m.audio"` which also has the `"org.matrix.msc3245.voice": {}` field. This makes it easier to process voice messages as different entities throughout the rest of the codebase.
This commit is contained in:
Marco Romano 2023-10-27 16:02:16 +02:00 committed by GitHub
parent 473c8abc82
commit a07286ace9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 76 additions and 55 deletions

View file

@ -48,8 +48,13 @@ data class AudioMessageType(
val body: String,
val source: MediaSource,
val info: AudioInfo?,
) : MessageType
data class VoiceMessageType(
val body: String,
val source: MediaSource,
val info: AudioInfo?,
val details: AudioDetails?,
val isVoiceMessage: Boolean,
) : MessageType
data class VideoMessageType(