Skip to content

Commit

Permalink
invoke on-new-remote-conversation in addMembers
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwire committed Jan 18, 2023
1 parent bf72229 commit e62b2a4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion services/galley/src/Galley/API/MLS/Message.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,23 @@ addMembers qusr con lconvOrSub users = case tUnqualified lconvOrSub of
. filter (flip Set.notMember (existingMembers lconv))
. toList
$ users
SubConv _ _ -> pure []
SubConv mlsConv subConv -> do
-- call `on-new-remote-conversation` on backends that are seeing this
-- conversation for the first time
let newDomains =
Set.difference
(Set.fromList (map void (snd (partitionQualified lconvOrSub users))))
(Set.fromList (map (void . rmId) (mcRemoteMembers mlsConv)))
let nrc =
NewRemoteConversation
{ nrcConvId = mcId mlsConv,
nrcSubConvId = Just . scSubConvId $ subConv,
nrcProtocol = ProtocolMLS (mcMLSData mlsConv)
}
runFederatedConcurrently_ (toList newDomains) $ \_ -> do
void $ fedClient @'Galley @"on-new-remote-conversation" nrc

pure []

removeMembers ::
HasProposalActionEffects r =>
Expand Down

0 comments on commit e62b2a4

Please sign in to comment.