Skip to content

Commit

Permalink
allow subconversations for MLS 1-1 conversation (#4150)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwire authored Jul 15, 2024
1 parent 1abde2d commit 4a72f4b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/2-features/WPB-9773
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow subconversations for MLS 1-1 conversations
24 changes: 23 additions & 1 deletion integration/test/Test/MLS/SubConversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,29 @@ testJoinSubConv = do
createExternalCommit alice1 Nothing
>>= sendAndConsumeCommitBundle

testDeleteParentOfSubConv :: HasCallStack => Domain -> App ()
testJoinOne2OneSubConv :: App ()
testJoinOne2OneSubConv = do
[alice, bob] <- createAndConnectUsers [OwnDomain, OwnDomain]
[alice1, bob1, bob2] <- traverse (createMLSClient def) [alice, bob, bob]
traverse_ uploadNewKeyPackage [bob1, bob2]
conv <- getMLSOne2OneConversation alice bob >>= getJSON 200
resetGroup alice1 conv

void $ createAddCommit alice1 [bob] >>= sendAndConsumeCommitBundle
createSubConv bob1 "conference"

-- bob adds his first client to the subconversation
sub' <- getSubConversation bob conv "conference" >>= getJSON 200
do
tm <- sub' %. "epoch_timestamp"
assertBool "Epoch timestamp should not be null" (tm /= Null)

-- now alice joins with her own client
void $
createExternalCommit alice1 Nothing
>>= sendAndConsumeCommitBundle

testDeleteParentOfSubConv :: (HasCallStack) => Domain -> App ()
testDeleteParentOfSubConv secondDomain = do
(alice, tid, _) <- createTeam OwnDomain 1
bob <- randomUser secondDomain def
Expand Down
2 changes: 1 addition & 1 deletion services/galley/src/Galley/API/MLS/SubConversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ getLocalSubConversation ::
getLocalSubConversation qusr lconv sconv = do
c <- getConversationAndCheckMembership qusr lconv

unless (Data.convType c == RegularConv) $
unless (Data.convType c == RegularConv || Data.convType c == One2OneConv) $
throwS @'MLSSubConvUnsupportedConvType

msub <- Eff.getSubConversation (tUnqualified lconv) sconv
Expand Down

0 comments on commit 4a72f4b

Please sign in to comment.