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
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ extension ZMOTRMessage {
return expectsReadConfirmation && readReceiptsEnabled

} else if conversation.conversationType == .group {
return expectsReadConfirmation
return conversation.messageProtocol != .mls && expectsReadConfirmation
}

return false
Expand Down
4 changes: 4 additions & 0 deletions wire-ios-data-model/Tests/MLS/MLSServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ final class MLSServiceTests: ZMConversationTestsBase, MLSServiceDelegate {

func test_EstablishGroupWithMultipleUsers_IsSuccessful() async throws {
// Given
// Serialize key package claims: MockMLSActionsProviderProtocol's generated
// invocation-recording arrays aren't thread-safe, so concurrent claims would race.
createSut(maxConcurrentKeyPackageClaims: 1)

let groupID = MLSGroupID(Data([1, 2, 3]))
let removalKey = Data([1, 2, 3])
let users = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,32 @@ extension ZMMessageTests_Confirmation {
XCTAssertFalse(message.needsReadConfirmation)
}

func testThatMessageDoesntNeedReadConfirmation_InAnMLSGroup_WhenItExpectsReadConfirmation() {
// given
let user = createUser(in: uiMOC)
let conversation = createConversation(in: uiMOC)
conversation.messageProtocol = .mls

let message = insertMessage(conversation, fromSender: user, timestamp: Date()) as! ZMClientMessage
message.expectsReadConfirmation = true

// then
XCTAssertFalse(message.needsReadConfirmation)
}

func testThatMessageNeedsReadConfirmation_InAMixedGroup_WhenItExpectsReadConfirmation() {
// given
let user = createUser(in: uiMOC)
let conversation = createConversation(in: uiMOC)
conversation.messageProtocol = .mixed

let message = insertMessage(conversation, fromSender: user, timestamp: Date()) as! ZMClientMessage
message.expectsReadConfirmation = true

// then
XCTAssertTrue(message.needsReadConfirmation)
}

func testThatMessageDoesntExpectReadConfirmation_InAGroup_ForMessagesSentBySelfUser() {
// given
let conversation = createConversation(in: uiMOC)
Expand Down
Loading