Fix bug in the busy logic.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-02-03 16:40:33 -05:00
parent ef3df49fd2
commit 8f6483e9b4
5 changed files with 7 additions and 7 deletions

View File

@ -355,7 +355,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
return NO;
}
if ([Environment getCurrent].phoneManager.hasOngoingCall) {
if ([Environment getCurrent].phoneManager.hasOngoingRedphoneCall) {
DDLogWarn(@"%@ ignoring INStartVideoCallIntent due to ongoing RedPhone call.", self.tag);
return NO;
}
@ -406,7 +406,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
return NO;
}
if ([Environment getCurrent].phoneManager.hasOngoingCall) {
if ([Environment getCurrent].phoneManager.hasOngoingRedphoneCall) {
DDLogWarn(@"%@ ignoring INStartAudioCallIntent due to ongoing RedPhone call.", self.tag);
return NO;
}

View File

@ -414,7 +414,7 @@ protocol CallServiceObserver: class {
Logger.verbose("\(TAG) receivedCallOffer for thread:\(thread)")
let newCall = SignalCall.incomingCall(localId: UUID(), remotePhoneNumber: thread.contactIdentifier(), signalingId: callId)
guard call == nil || Environment.getCurrent().phoneManager.hasOngoingCall() else {
guard call == nil && !Environment.getCurrent().phoneManager.hasOngoingRedphoneCall() else {
// TODO on iOS10+ we can use CallKit to swap calls rather than just returning busy immediately.
Logger.verbose("\(TAG) receivedCallOffer for thread: \(thread) but we're already in call: \(call)")

View File

@ -53,7 +53,7 @@ import Foundation
self.contactsUpdater.lookupIdentifier(recipientId,
success: { recipient in
guard !Environment.getCurrent().phoneManager.hasOngoingCall() else {
guard !Environment.getCurrent().phoneManager.hasOngoingRedphoneCall() else {
Logger.error("\(self.TAG) OutboundCallInitiator aborting due to ongoing RedPhone call.")
return
}

View File

@ -41,7 +41,7 @@
- (void)backgroundTimeExpired;
// Returns YES IFF there is an ongoing RedPhone call.
- (BOOL)hasOngoingCall;
- (BOOL)hasOngoingRedphoneCall;
- (ObservableValue *)currentCallObservable;

View File

@ -93,7 +93,7 @@
int64_t prevSession = lastIncomingSessionId;
lastIncomingSessionId = session.sessionId;
if ([currentCallControllerObservable.currentValue callState].futureTermination.isIncomplete || [self hasOngoingWebRTCCall]) {
if ([self hasOngoingRedphoneCall] || [self hasOngoingWebRTCCall]) {
if (session.sessionId == prevSession) {
Environment.errorNoter(@"Ignoring duplicate incoming call signal.", session, false);
return;
@ -139,7 +139,7 @@
incoming:YES];
}
- (BOOL)hasOngoingCall
- (BOOL)hasOngoingRedphoneCall
{
if (!self.curCallController) {
return NO;