2
0
mirror of https://github.com/42wim/matterbridge synced 2024-11-03 15:40:24 +00:00

Add username for images from WhatsApp (#1232)

This commit is contained in:
Dellle 2020-09-26 21:32:57 +02:00 committed by GitHub
parent 06eb89b05b
commit a42e488e58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)