From c88187b99fb22c09a04eff26f961672f52b09dc4 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 1 Mar 2024 13:51:36 +0200 Subject: [PATCH] Remove sus conversation data filtering --- user.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/user.go b/user.go index d097e5d..0fece90 100644 --- a/user.go +++ b/user.go @@ -996,30 +996,6 @@ func (user *User) Logout(state status.BridgeState, unpair bool) (logoutOK bool) return } -func conversationDataIsSus(portal *Portal, v *gmproto.Conversation) bool { - if !portal.IsPrivateChat() { - // Group chats hopefully never get bad updates - return false - } else if v.IsGroupChat { - // Group chat update for a DM is always sus - return true - } - count := 0 - mainName := "" - for _, pcp := range v.Participants { - if !pcp.IsMe { - if count == 0 { - mainName = pcp.FullName - count++ - } else if mainName != pcp.FullName { - count++ - } - } - } - // If there are multiple names in a DM, that's sus even if it's not marked as a group - return count > 1 -} - func (user *User) syncConversation(v *gmproto.Conversation, source string) { updateType := v.GetStatus() portal := user.GetPortalByID(v.GetConversationID()) @@ -1057,9 +1033,6 @@ func (user *User) syncConversation(v *gmproto.Conversation, source string) { if v.Participants == nil { log.Debug().Msg("Not syncing conversation with nil participants") return - } else if conversationDataIsSus(portal, v) { - log.Warn().Msg("Ignoring suspicious update for private chat") - return } log.Debug().Msg("Syncing existing portal") portal.UpdateMetadata(ctx, user, v)