mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Report native calls that end without us to CallKit
The call package now says why a call ended. Only our own hang-up is an end call action; a call the other side declined or left, that nobody answered, or that failed is reported to CallKit with that reason, so the call log no longer shows it as one we ended, and no end action comes back to hang up a call that is already over. Also adopts the package's other host changes: the voice call icon beside "Calling…", and the call's large avatar rendered at the 140 pt it is drawn at. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -295,6 +295,26 @@ final class ElementCallServiceTests {
|
||||
#expect(service.ongoingCallRoomIDPublisher.value == nil)
|
||||
}
|
||||
|
||||
/// A declined or unanswered call is the system's to log as such: reported with its reason, and
|
||||
/// never as an end call action, which would log it as one we hung up.
|
||||
@Test
|
||||
func aCallThatEndedWithoutUsIsReportedRatherThanEnded() async throws {
|
||||
enableNativeCalls()
|
||||
await service.setupCallSession(roomID: "!room:example.com", roomDisplayName: "welcome", isVideo: true)
|
||||
let callID = try #require(callProvider.reportCallWithUpdatedReceivedArguments?.uuid)
|
||||
let requestsBeforeTheEnd = callController.requestCompletionCallsCount
|
||||
|
||||
service.reportCallSessionEnded(roomID: "!other:example.com", reason: .unanswered)
|
||||
#expect(!callProvider.reportCallWithEndedAtReasonCalled, "Another room's end is not this call's")
|
||||
|
||||
service.reportCallSessionEnded(roomID: "!room:example.com", reason: .unanswered)
|
||||
|
||||
#expect(callProvider.reportCallWithEndedAtReasonReceivedArguments?.uuid == callID)
|
||||
#expect(callProvider.reportCallWithEndedAtReasonReceivedArguments?.reason == .unanswered)
|
||||
#expect(callController.requestCompletionCallsCount == requestsBeforeTheEnd)
|
||||
#expect(service.ongoingCallRoomIDPublisher.value == nil)
|
||||
}
|
||||
|
||||
@Test
|
||||
func tearingDownAnotherRoomLeavesTheOngoingCallUp() async {
|
||||
// A call screen that is dismissed after another room's call replaced it must not take the
|
||||
|
||||
Reference in New Issue
Block a user