diff options
author | Dellle <39235395+Dellle@users.noreply.github.com> | 2020-09-26 21:32:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-26 21:32:57 +0200 |
commit | a42e488e5839119f55071c6c5ea514c6c74d2cea (patch) | |
tree | f7947e595397d033d415f0c834c77e87517cbd9e /bridge | |
parent | 06eb89b05bc571042b5274eb8adb535902639582 (diff) | |
download | matterbridge-msglm-a42e488e5839119f55071c6c5ea514c6c74d2cea.tar.gz matterbridge-msglm-a42e488e5839119f55071c6c5ea514c6c74d2cea.tar.bz2 matterbridge-msglm-a42e488e5839119f55071c6c5ea514c6c74d2cea.zip |
Add username for images from WhatsApp (#1232)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/whatsapp/handlers.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go index f58b30f8..4d1c9a13 100644 --- a/bridge/whatsapp/handlers.go +++ b/bridge/whatsapp/handlers.go @@ -143,10 +143,12 @@ func (b *Bwhatsapp) HandleImageMessage(message whatsapp.ImageMessage) { groupJID := message.Info.RemoteJid senderJID := message.Info.SenderJid - // if len(senderJid) == 0 { - // // TODO workaround till https://github.com/Rhymen/go-whatsapp/issues/86 resolved - // senderJid = *message.Info.Source.Participant - // } + if len(senderJID) == 0 { + // TODO workaround till https://github.com/Rhymen/go-whatsapp/issues/86 resolved + if message.Info.Source != nil && message.Info.Source.Participant != nil { + senderJID = *message.Info.Source.Participant + } + } // translate sender's Jid to the nicest username we can get senderName := b.getSenderName(senderJID) |