summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-03-20 23:12:59 +0100
committerGitHub <noreply@github.com>2021-03-20 23:12:59 +0100
commit7466e1d014054fda5d47b9261f29811ffc599dc1 (patch)
treee1aef020e5e1d0d9f4f619ad42177ff7a8d512ed /bridge
parent2a7f28606c4984a37c89b0c90cfa986a602d1e77 (diff)
downloadmatterbridge-msglm-7466e1d014054fda5d47b9261f29811ffc599dc1.tar.gz
matterbridge-msglm-7466e1d014054fda5d47b9261f29811ffc599dc1.tar.bz2
matterbridge-msglm-7466e1d014054fda5d47b9261f29811ffc599dc1.zip
Set ogg as default audiomessage when none found (whatsapp). Fixes #1427 (#1431)
Diffstat (limited to 'bridge')
-rw-r--r--bridge/whatsapp/handlers.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go
index 54e07075..411676e2 100644
--- a/bridge/whatsapp/handlers.go
+++ b/bridge/whatsapp/handlers.go
@@ -289,6 +289,10 @@ func (b *Bwhatsapp) HandleAudioMessage(message whatsapp.AudioMessage) {
return
}
+ if len(fileExt) == 0 {
+ fileExt = append(fileExt, ".ogg")
+ }
+
filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0])
b.Log.Debugf("Trying to download %s with size %#v and type %s", filename, message.Length, message.Type)