mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +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:
@@ -244,6 +244,21 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
|
||||
MXLog.info("Not tearing down the call session, no call for room \(roomID)")
|
||||
}
|
||||
|
||||
func reportCallSessionEnded(roomID: String, reason: CXCallEndedReason) {
|
||||
guard let ongoingCallID, ongoingCallID.roomID == roomID else {
|
||||
MXLog.info("Not reporting the end of a call for \(roomID), it isn't the ongoing call")
|
||||
return
|
||||
}
|
||||
|
||||
// A web view call is not tracked by CallKit, as in `reportCallSessionConnected`.
|
||||
if ongoingCallID.isNative {
|
||||
MXLog.info("Reporting the call as ended without us: \(reason.rawValue)")
|
||||
callProvider.reportCall(with: ongoingCallID.callKitID, endedAt: nil, reason: reason)
|
||||
}
|
||||
|
||||
self.ongoingCallID = nil
|
||||
}
|
||||
|
||||
func setAudioEnabled(_ enabled: Bool, roomID: String) {
|
||||
guard let ongoingCallID else {
|
||||
MXLog.error("Failed toggling call microphone, no calls running")
|
||||
|
||||
Reference in New Issue
Block a user