Send all ogg audio from WhatsApp as voice messages

For some reason WhatsApp removes the `ptt` flag when a message is
forwarded, but still renders them as voice messages.
This commit is contained in:
Tulir Asokan 2023-07-05 12:09:31 +03:00
parent de5de426cb
commit c00fa4dd24

View file

@ -3014,7 +3014,7 @@ func (portal *Portal) convertMediaMessageContent(intent *appservice.IntentAPI, m
"duration": int(audioMessage.GetSeconds()) * 1000,
"waveform": waveform,
}
if audioMessage.GetPtt() {
if audioMessage.GetPtt() || audioMessage.GetMimetype() == "audio/ogg; codecs/opus" {
extraContent["org.matrix.msc3245.voice"] = map[string]interface{}{}
}
}