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:
parent
473c8abc82
commit
a07286ace9
7 changed files with 76 additions and 55 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue