From b978930c88fe366622866b3fc316a1c2036a142f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 27 Aug 2018 01:06:27 +0300 Subject: [PATCH] Improve handling of weird potentially non-corner case in GetMessageIntent() --- portal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/portal.go b/portal.go index 00403e6..1e81ca4 100644 --- a/portal.go +++ b/portal.go @@ -396,7 +396,11 @@ func (portal *Portal) GetMessageIntent(info whatsapp.MessageInfo) *appservice.In } else if portal.IsPrivateChat() { return portal.MainIntent() } else if len(info.SenderJid) == 0 { - return nil + if len(info.Source.GetParticipant()) != 0 { + info.SenderJid = info.Source.GetParticipant() + } else { + return nil + } } return portal.user.GetPuppetByJID(info.SenderJid).Intent() }