From 7466e1d014054fda5d47b9261f29811ffc599dc1 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 20 Mar 2021 23:12:59 +0100 Subject: Set ogg as default audiomessage when none found (whatsapp). Fixes #1427 (#1431) --- bridge/whatsapp/handlers.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bridge/whatsapp/handlers.go') 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) -- cgit v1.2.3