diff --git a/portal.go b/portal.go index a538e31..45ef236 100644 --- a/portal.go +++ b/portal.go @@ -316,6 +316,16 @@ func (portal *Portal) UpdateMetadata(user *User) bool { portal.log.Errorln(err) return false } + if metadata.Status != 0 { + // 401: access denied + // 404: group does (no longer) exist + // 500: ??? happens with status@broadcast + + // TODO: update the room, e.g. change priority level + // to send messages to moderator + return false + } + portal.SyncParticipants(metadata) update := false update = portal.UpdateName(metadata.Name, metadata.NameSetBy) || update diff --git a/whatsapp-ext/whatsapp.go b/whatsapp-ext/whatsapp.go index 740a299..2dfe558 100644 --- a/whatsapp-ext/whatsapp.go +++ b/whatsapp-ext/whatsapp.go @@ -61,6 +61,8 @@ type GroupInfo struct { GroupCreated int64 `json:"creation"` + Status int16 `json:"status"` + Participants []struct { JID string `json:"id"` IsAdmin bool `json:"isAdmin"`