Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow subconversations for MLS 1-1 conversation #4133

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading