Эх сурвалжийг харах

Improve handling of weird potentially non-corner case in GetMessageIntent()

Tulir Asokan 6 жил өмнө
parent
commit
b978930c88
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      portal.go

+ 5 - 1
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()
 }