From e425d351c72aafb7f29acde22faa53c520fd797a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 30 Jan 2017 15:10:47 -0500 Subject: [PATCH] WIP: incoming non-signal call while in outgoing signal call Marking Signal-Call as started, changes the incoming call screen for subsequent calls to show "Accept & End", "Send to VoiceMail" and "Accept & Hold" instead of just "Accept" & "Decline" Though - we don't support Holding. What we really want to see is just "Accept & End" and "Decline | Send to Voicemail" // FREEBIE --- .../Speakerbox/CallKitCallUIAdaptee.swift | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/Signal/src/call/Speakerbox/CallKitCallUIAdaptee.swift b/Signal/src/call/Speakerbox/CallKitCallUIAdaptee.swift index f427d6032..4cbbc9732 100644 --- a/Signal/src/call/Speakerbox/CallKitCallUIAdaptee.swift +++ b/Signal/src/call/Speakerbox/CallKitCallUIAdaptee.swift @@ -138,8 +138,7 @@ final class CallKitCallUIAdaptee: NSObject, CallUIAdaptee, CXProviderDelegate { func recipientAcceptedCall(_ call: SignalCall) { AssertIsOnMainThread() - // no - op - // TODO provider update call connected? + self.provider.reportOutgoingCall(with: call.localId, connectedAt: nil) } func localHangupCall(_ call: SignalCall) { @@ -213,27 +212,15 @@ final class CallKitCallUIAdaptee: NSObject, CallUIAdaptee, CXProviderDelegate { } CallService.signalingQueue.async { - self.callService.handleOutgoingCall(call).then { + self.callService.handleOutgoingCall(call).then { () -> Void in action.fulfill() + self.provider.reportOutgoingCall(with: call.localId, startedConnectingAt: nil) }.catch { error in Logger.error("\(self.TAG) error \(error) in \(#function)") self.callManager.removeCall(call) action.fail() } } - - // TODO FIXME - // /* - // Set callback blocks for significant events in the call's lifecycle, so that the CXProvider may be updated - // to reflect the updated state. - // */ - // call.hasStartedConnectingDidChange = { [weak self] in - // self?.provider.reportOutgoingCall(with: call.uuid, startedConnectingAt: call.connectingDate) - // } - // call.hasConnectedDidChange = { [weak self] in - // self?.provider.reportOutgoingCall(with: call.uuid, connectedAt: call.connectDate) - // } - } func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {