Automatically silence ringing calls after 15 seconds of inactivity

This commit is contained in:
Stefan Ceriu
2024-05-27 12:49:47 +03:00
committed by Stefan Ceriu
parent f6c476eeca
commit e76fabf18c
@@ -124,6 +124,13 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
completion()
}
Task { [weak self, callProvider, callID] in
try? await Task.sleep(for: .seconds(15))
if let ongoingCallID = self?.ongoingCallID, ongoingCallID == callID {
callProvider.reportCall(with: callID, endedAt: .now, reason: .unanswered)
}
}
}
// MARK: - CXProviderDelegate