Handle WhatsApp invites. Fixes #120

This commit is contained in:
Tulir Asokan
2020-06-26 00:05:51 +03:00
parent 326293303d
commit 8cfb04a5ed
3 changed files with 24 additions and 2 deletions

View File

@ -47,6 +47,7 @@ const (
ChatActionDemote ChatActionType = "demote"
ChatActionIntroduce ChatActionType = "introduce"
ChatActionRemove ChatActionType = "remove"
ChatActionAdd ChatActionType = "add"
)
type ChatUpdateData struct {
@ -128,7 +129,7 @@ func (cud *ChatUpdateData) UnmarshalJSON(data []byte) error {
unmarshalTo = &cud.Restrict
case ChatActionAnnounce:
unmarshalTo = &cud.Announce
case ChatActionPromote, ChatActionDemote, ChatActionRemove:
case ChatActionPromote, ChatActionDemote, ChatActionRemove, ChatActionAdd:
unmarshalTo = &cud.UserChange
default:
return nil