mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 03:06:37 +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:
@@ -5,6 +5,7 @@
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import CallKit
|
||||
import Combine
|
||||
import ElementCall
|
||||
|
||||
@@ -55,8 +56,19 @@ final class NativeCallSystem: ElementCallSystemProvidingProtocol {
|
||||
service?.reportCallSessionConnected(roomID: roomID)
|
||||
}
|
||||
|
||||
func endCall(roomID: String) {
|
||||
service?.tearDownCallSession(roomID: roomID)
|
||||
/// Only our own hang-up is an end call action; the rest the system hears as the call ending on
|
||||
/// its own, so the call log does not show a declined or unanswered call as one we ended.
|
||||
func endCall(roomID: String, reason: ElementCallEndReason) {
|
||||
switch reason {
|
||||
case .local:
|
||||
service?.tearDownCallSession(roomID: roomID)
|
||||
case .remoteEnded:
|
||||
service?.reportCallSessionEnded(roomID: roomID, reason: .remoteEnded)
|
||||
case .unanswered:
|
||||
service?.reportCallSessionEnded(roomID: roomID, reason: .unanswered)
|
||||
case .failed:
|
||||
service?.reportCallSessionEnded(roomID: roomID, reason: .failed)
|
||||
}
|
||||
}
|
||||
|
||||
func setMicrophoneEnabled(_ enabled: Bool, roomID: String) {
|
||||
|
||||
Reference in New Issue
Block a user