From caa9e3ca67f22a8c705e55a7fbde5775a5e932a3 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 23 May 2018 14:37:12 -0400 Subject: [PATCH] Show missed call when call times out // FREEBIE --- Signal/src/call/CallService.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Signal/src/call/CallService.swift b/Signal/src/call/CallService.swift index cc32cea1b..3f2c56236 100644 --- a/Signal/src/call/CallService.swift +++ b/Signal/src/call/CallService.swift @@ -876,7 +876,7 @@ private class SignalCallData: NSObject { Logger.info("\(self.logTag) in \(#function): \(call.identifiersForLogs).") switch call.state { - case .remoteRinging: + case .remoteRinging, .localRinging: Logger.debug("\(self.logTag) in \(#function) disconnect while ringing... we'll keep ringing") case .connected: call.state = .reconnecting @@ -1490,12 +1490,15 @@ private class SignalCallData: NSObject { if let failedCall = failedCall { - if failedCall.state == .answering { + switch failedCall.state { + case .answering, .localRinging: assert(failedCall.callRecord == nil) // call failed before any call record could be created, make one now. handleMissedCall(failedCall) + default: + assert(failedCall.callRecord != nil) } - assert(failedCall.callRecord != nil) + // It's essential to set call.state before terminateCall, because terminateCall nils self.call failedCall.error = error