diff --git a/changelog.d/3-bug-fixes/wpb-6144-messaging-blocked-user b/changelog.d/3-bug-fixes/wpb-6144-messaging-blocked-user index 44b986f57ed..70d315f9e42 100644 --- a/changelog.d/3-bug-fixes/wpb-6144-messaging-blocked-user +++ b/changelog.d/3-bug-fixes/wpb-6144-messaging-blocked-user @@ -1 +1 @@ -Do not deliver MLS one-to-one conversation messages to a user that blocked the sender +Do not deliver MLS one-to-one conversation messages to a user that blocked the sender (#3889, #3906) diff --git a/services/galley/src/Galley/API/One2One.hs b/services/galley/src/Galley/API/One2One.hs index 031a4dd81d3..05b1d16b9c4 100644 --- a/services/galley/src/Galley/API/One2One.hs +++ b/services/galley/src/Galley/API/One2One.hs @@ -35,7 +35,6 @@ import Galley.Types.UserList import Imports import Polysemy import Wire.API.Conversation hiding (Member) -import Wire.API.Conversation.Protocol import Wire.API.Routes.Internal.Galley.ConversationsIntra import Wire.API.User @@ -86,11 +85,6 @@ iUpsertOne2OneConversation UpsertOne2OneConversationRequest {..} = do deleteMembers (tUnqualified lconvId) (UserList [tUnqualified uooLocalUser] []) - let mGroupId = case convProtocol conv of - ProtocolProteus -> Nothing - ProtocolMLS meta -> Just . cnvmlsGroupId $ meta - ProtocolMixed meta -> Just . cnvmlsGroupId $ meta - for_ mGroupId $ flip removeAllMLSClientsOfUser (tUntagged uooLocalUser) (RemoteActor, Included) -> do void $ createMembers (tUnqualified lconvId) (UserList [] [uooRemoteUser]) unless (null (convLocalMembers conv)) $ diff --git a/services/galley/src/Galley/Cassandra/Conversation/Members.hs b/services/galley/src/Galley/Cassandra/Conversation/Members.hs index f4a043cd11e..abd3a0139e6 100644 --- a/services/galley/src/Galley/Cassandra/Conversation/Members.hs +++ b/services/galley/src/Galley/Cassandra/Conversation/Members.hs @@ -384,11 +384,6 @@ removeMLSClients groupId (Qualified usr domain) cs = retry x5 . batch $ do for_ cs $ \c -> addPrepQuery Cql.removeMLSClient (groupId, domain, usr, c) -removeAllMLSClientsOfUser :: GroupId -> Qualified UserId -> Client () -removeAllMLSClientsOfUser groupId (Qualified usr domain) = - retry x5 $ - write Cql.removeAllMLSClientsOfUser (params LocalQuorum (groupId, domain, usr)) - removeAllMLSClients :: GroupId -> Client () removeAllMLSClients groupId = do retry x5 $ write Cql.removeAllMLSClients (params LocalQuorum (Identity groupId)) @@ -421,7 +416,6 @@ interpretMemberStoreToCassandra = interpret $ \case AddMLSClients lcnv quid cs -> embedClient $ addMLSClients lcnv quid cs PlanClientRemoval lcnv cids -> embedClient $ planMLSClientRemoval lcnv cids RemoveMLSClients lcnv quid cs -> embedClient $ removeMLSClients lcnv quid cs - RemoveAllMLSClientsOfUser lcnv quid -> embedClient $ removeAllMLSClientsOfUser lcnv quid RemoveAllMLSClients gid -> embedClient $ removeAllMLSClients gid LookupMLSClients lcnv -> embedClient $ lookupMLSClients lcnv LookupMLSClientLeafIndices lcnv -> embedClient $ lookupMLSClientLeafIndices lcnv diff --git a/services/galley/src/Galley/Cassandra/Queries.hs b/services/galley/src/Galley/Cassandra/Queries.hs index df52a52571b..560d8d9a19f 100644 --- a/services/galley/src/Galley/Cassandra/Queries.hs +++ b/services/galley/src/Galley/Cassandra/Queries.hs @@ -493,9 +493,6 @@ planMLSClientRemoval = "update mls_group_member_client set removal_pending = tru removeMLSClient :: PrepQuery W (GroupId, Domain, UserId, ClientId) () removeMLSClient = "delete from mls_group_member_client where group_id = ? and user_domain = ? and user = ? and client = ?" -removeAllMLSClientsOfUser :: PrepQuery W (GroupId, Domain, UserId) () -removeAllMLSClientsOfUser = "delete from mls_group_member_client where group_id = ? and user_domain = ? and user = ?" - removeAllMLSClients :: PrepQuery W (Identity GroupId) () removeAllMLSClients = "DELETE FROM mls_group_member_client WHERE group_id = ?" diff --git a/services/galley/src/Galley/Effects/MemberStore.hs b/services/galley/src/Galley/Effects/MemberStore.hs index 56cd4fe9740..0513cc6570e 100644 --- a/services/galley/src/Galley/Effects/MemberStore.hs +++ b/services/galley/src/Galley/Effects/MemberStore.hs @@ -44,7 +44,6 @@ module Galley.Effects.MemberStore addMLSClients, planClientRemoval, removeMLSClients, - removeAllMLSClientsOfUser, removeAllMLSClients, lookupMLSClients, lookupMLSClientLeafIndices, @@ -89,7 +88,6 @@ data MemberStore m a where AddMLSClients :: GroupId -> Qualified UserId -> Set (ClientId, LeafIndex) -> MemberStore m () PlanClientRemoval :: Foldable f => GroupId -> f ClientIdentity -> MemberStore m () RemoveMLSClients :: GroupId -> Qualified UserId -> Set ClientId -> MemberStore m () - RemoveAllMLSClientsOfUser :: GroupId -> Qualified UserId -> MemberStore m () RemoveAllMLSClients :: GroupId -> MemberStore m () LookupMLSClients :: GroupId -> MemberStore m ClientMap LookupMLSClientLeafIndices :: GroupId -> MemberStore m (ClientMap, IndexMap)