Skip to content
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
17 changes: 0 additions & 17 deletions wire-ios-sync-engine/Source/Calling/WireCallCenterV3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -895,30 +895,13 @@ public extension WireCallCenterV3 {
snapshot?.mlsConferenceStaleParticipantsRemover?.stopSubscribing()
snapshot?.mlsConferenceStaleParticipantsRemover = nil

guard isGroupConversation(conversationId: conversationId) else { return }

leaveSubconversation(
parentQualifiedID: mlsParentIDs.0,
parentGroupID: mlsParentIDs.1
)
}
}

private func isGroupConversation(conversationId: AVSIdentifier) -> Bool {
guard
let context = uiMOC,
let domain = conversationId.domain ?? localDomain,
let conversation = ZMConversation.fetch(
with: conversationId.identifier,
domain: domain,
in: context
)
else {
return false
}
return conversation.conversationType == .group
}

/// Rejects an incoming call in the conversation.
/// - parameter conversationId: The ID of the conversation where the incoming call is hosted.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,34 +679,6 @@ final class WireCallCenterV3Tests: MessagingTest {
XCTAssert(waitForCustomExpectations(withTimeout: 0.5))
}

func testThatClosingAnMLSOneOnOneCallDoesNotLeaveTheSubconversation() throws {
// Given
let conversationID = try XCTUnwrap(oneOnOneConversationID)
oneOnOneConversation.messageProtocol = .mls
oneOnOneConversation.mlsGroupID = .random()

let mlsService = MockMLSServiceInterface()
syncMOC.performAndWait {
syncMOC.mlsService = mlsService
}

var didLeaveSubconversation = false
mlsService
.leaveSubconversationParentQualifiedIDParentGroupIDSubconversationType_MockMethod = { _, _, _ in
didLeaveSubconversation = true
}

// When
sut.closeCall(conversationId: conversationID)

// Then
XCTAssert(waitForAllGroupsToBeEmpty(withTimeout: 0.5))
XCTAssertFalse(
didLeaveSubconversation,
"leaveSubconversation should not be called for 1-1 MLS calls"
)
}

func testThatItLeavesSubconversationIfNeededOnIncoming() throws {
// Given
groupConversation.messageProtocol = .mls
Expand Down
Loading