Skip to content

Commit

Permalink
allow subconversations for MLS 1-1 conversation (#4133)
Browse files Browse the repository at this point in the history
* allow subconversations for MLS 1-1 conversation

* add changelog entry
  • Loading branch information
stefanwire authored Jul 12, 2024
1 parent 345e1e5 commit 71a30ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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
22 changes: 22 additions & 0 deletions integration/test/Test/MLS/SubConversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ testJoinSubConv = do
$ createExternalCommit alice1 Nothing
>>= sendAndConsumeCommitBundle

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
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 @@ -115,7 +115,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 71a30ab

Please sign in to comment.