From 18820ca5434c99e63ddab97569857e0bb316c06b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 5 Jan 2017 17:04:23 +0100 Subject: [PATCH] Repair autoanswer_notif_preference --- Classes/LinphoneAppDelegate.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index e89541380..2c2682b0e 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -110,10 +110,17 @@ } instance->currentCallContextBeforeGoingBackground.call = 0; } else if (linphone_call_get_state(call) == LinphoneCallIncomingReceived) { - if (linphone_core_get_calls_nb(LC) > 1 || - (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max)) { + if ((floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max)) { + if ([LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"]) { + linphone_core_accept_call(LC, call); + [PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription]; + } else { + [PhoneMainView.instance displayIncomingCall:call]; + } + } else if (linphone_core_get_calls_nb(LC) > 1) { [PhoneMainView.instance displayIncomingCall:call]; } + // in this case, the ringing sound comes from the notification. // To stop it we have to do the iOS7 ring fix... [self fixRing];