Send audio messages with captions as document messages

This commit is contained in:
Tulir Asokan 2023-05-11 22:10:01 +03:00
parent e3174a7bd7
commit b65ec753cf

View file

@ -3846,6 +3846,10 @@ func (portal *Portal) convertMatrixMessage(ctx context.Context, sender *User, ev
if content.MsgType == event.MsgImage && content.GetInfo().MimeType == "image/gif" {
content.MsgType = event.MsgVideo
}
if content.MsgType == event.MsgAudio && content.FileName != "" && content.Body != content.FileName {
// Send audio messages with captions as files since WhatsApp doesn't support captions on audio messages
content.MsgType = event.MsgFile
}
switch content.MsgType {
case event.MsgText, event.MsgEmote, event.MsgNotice: