Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 08ec55ccc12e339f309e2454ec75d6f5e39fc4c0 Author: Dellle <39235395+Dellle@users.noreply.github.com> Date: Sat Sep 26 21:32:57 2020 +0000 Add username for images from WhatsApp (#1232) diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go index f58b30f..4d1c9a1 100644 --- a/bridge/whatsapp/handlers.go +++ b/bridge/whatsapp/handlers.go @@ -14310 +14312 @@ 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)