From d7e434eb03cc119f3a8592f1f3cc75f08cc05167 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Feb 2017 11:37:57 -0500 Subject: [PATCH] Modify OutboundCallInitiator to abort if there is an ongoing RedPhone or WebRTC call. // FREEBIE --- Signal/src/call/OutboundCallInitiator.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Signal/src/call/OutboundCallInitiator.swift b/Signal/src/call/OutboundCallInitiator.swift index 547357ab5..f62854bb0 100644 --- a/Signal/src/call/OutboundCallInitiator.swift +++ b/Signal/src/call/OutboundCallInitiator.swift @@ -52,6 +52,16 @@ import Foundation // SignalRecipient *recipient = [SignalRecipient recipientWithTextSecureIdentifier:self.thread.contactIdentifier]; self.contactsUpdater.lookupIdentifier(recipientId, success: { recipient in + + guard !Environment.getCurrent().phoneManager.hasOngoingCall() else { + Logger.error("\(self.TAG) OutboundCallInitiator aborting due to ongoing RedPhone call.") + return + } + guard Environment.getCurrent().callService.call != nil else { + Logger.error("\(self.TAG) OutboundCallInitiator aborting due to ongoing WebRTC call.") + return + } + let remoteWantsWebRTC = recipient.supportsWebRTC Logger.debug("\(self.TAG) localWantsWebRTC: \(localWantsWebRTC), remoteWantsWebRTC: \(remoteWantsWebRTC)")