diff options
author | Avinash Reddy <cassilasreddythemostwanted3108@gmail.com> | 2021-05-26 03:36:45 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 00:06:45 +0200 |
commit | 4fcad8e04befeec2c7e468b36500fa33eb22af51 (patch) | |
tree | a4945b0ffb2f5328822bcf1fe35ebc6284b83e83 /bridge/whatsapp/handlers.go | |
parent | 4b4b2d790e935aeb5b3bf2bb7d1729ff12bd6ff8 (diff) | |
download | matterbridge-msglm-4fcad8e04befeec2c7e468b36500fa33eb22af51.tar.gz matterbridge-msglm-4fcad8e04befeec2c7e468b36500fa33eb22af51.tar.bz2 matterbridge-msglm-4fcad8e04befeec2c7e468b36500fa33eb22af51.zip |
Make DocumentMessage handler use FileName attribute (whatsapp) (#1488)
* [whatsapp] make DocumentMessage handler use FileName attribute.
referenced: https://github.com/Rhymen/go-whatsapp/blob/master/message.go#L582
* fix lint
Diffstat (limited to 'bridge/whatsapp/handlers.go')
-rw-r--r-- | bridge/whatsapp/handlers.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go index 04e44693..1be9b5e3 100644 --- a/bridge/whatsapp/handlers.go +++ b/bridge/whatsapp/handlers.go @@ -359,9 +359,9 @@ func (b *Bwhatsapp) HandleDocumentMessage(message whatsapp.DocumentMessage) { return } - filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0]) + filename := fmt.Sprintf("%v", message.FileName) - b.Log.Debugf("Trying to download %s with type %s", filename, message.Type) + b.Log.Debugf("Trying to download %s with extension %s and type %s", filename, fileExt, message.Type) data, err := message.Download() if err != nil { |