From 3bc73bea2518868548e412244bb992f70b1b0cfc Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 15 Jun 2017 14:17:34 -0400 Subject: [PATCH] Don't return busy signal to untrusted callers. // FREEBIE --- Signal/src/call/CallService.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Signal/src/call/CallService.swift b/Signal/src/call/CallService.swift index e07ea6540..be252faed 100644 --- a/Signal/src/call/CallService.swift +++ b/Signal/src/call/CallService.swift @@ -470,15 +470,6 @@ protocol CallServiceObserver: class { let newCall = SignalCall.incomingCall(localId: UUID(), remotePhoneNumber: thread.contactIdentifier(), signalingId: callId) - guard self.call == nil else { - // TODO on iOS10+ we can use CallKit to swap calls rather than just returning busy immediately. - Logger.info("\(TAG) receivedCallOffer for thread: \(thread) but we're already in call: \(call!)") - - handleLocalBusyCall(newCall, thread: thread) - - return - } - let untrustedIdentity = OWSIdentityManager.shared().untrustedIdentityForSending(toRecipientId: thread.contactIdentifier()) guard untrustedIdentity == nil else { @@ -509,6 +500,15 @@ protocol CallServiceObserver: class { return } + + guard self.call == nil else { + // TODO on iOS10+ we can use CallKit to swap calls rather than just returning busy immediately. + Logger.info("\(TAG) receivedCallOffer for thread: \(thread) but we're already in call: \(call!)") + + handleLocalBusyCall(newCall, thread: thread) + + return + } Logger.info("\(TAG) starting new call: \(newCall)")