Ignore conversation events where DM turns into group

Google seems to randomly send group chat info with a DM ID, then revert
back to the correct DM data in the next update. Since DMs should never
turn into groups, just ignore those events entirely.
This commit is contained in:
Tulir Asokan 2023-08-21 12:11:56 +03:00
parent 8140abedd5
commit fdce256a03

View file

@ -810,6 +810,9 @@ func (user *User) syncConversation(v *gmproto.Conversation, source string) {
if v.Participants == nil { if v.Participants == nil {
log.Debug().Msg("Not syncing conversation with nil participants") log.Debug().Msg("Not syncing conversation with nil participants")
return return
} else if portal.IsPrivateChat() && v.IsGroupChat {
log.Warn().Msg("Ignoring group chat update for private chat")
return
} }
log.Debug().Msg("Syncing existing portal") log.Debug().Msg("Syncing existing portal")
portal.UpdateMetadata(user, v) portal.UpdateMetadata(user, v)