diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 31b1f027b..dfe47aa7a 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -118,13 +118,10 @@ [data->timer invalidate]; data->timer = nil; } - if ((floor(NSFoundationVersionNumber) <= - NSFoundationVersionNumber_iOS_9_x_Max)) { - if ([LinphoneManager.instance - lpConfigBoolForKey:@"autoanswer_notif_preference"]) { + if ((floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max)) { + if ([LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"]) { linphone_call_accept(call); - [PhoneMainView.instance - changeCurrentView:CallView.compositeViewDescription]; + [PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription]; } else { [PhoneMainView.instance displayIncomingCall:call]; } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 860c0599a..0a0bfd3d8 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -413,7 +413,7 @@ static RootViewManager *rootViewManagerInstance = nil; } case LinphoneCallEnd: { const MSList *calls = linphone_core_get_calls(LC); - if (calls == NULL) { + if (!calls) { while ((currentView == CallView.compositeViewDescription) || (currentView == CallIncomingView.compositeViewDescription) || (currentView == CallOutgoingView.compositeViewDescription)) { @@ -421,17 +421,6 @@ static RootViewManager *rootViewManagerInstance = nil; } } else { linphone_call_resume((LinphoneCall *)calls->data); - while (calls) { - if (linphone_call_get_state((LinphoneCall *)calls->data) == LinphoneCallIncomingReceived || - linphone_call_get_state((LinphoneCall *)calls->data) == LinphoneCallIncomingEarlyMedia) { - [self displayIncomingCall:(LinphoneCall *)calls->data]; - break; - } - calls = calls->next; - } - if (calls == NULL) { - [self changeCurrentView:CallView.compositeViewDescription]; - } } break; } diff --git a/Classes/ProviderDelegate.m b/Classes/ProviderDelegate.m index b7b531431..a3ee92e9f 100644 --- a/Classes/ProviderDelegate.m +++ b/Classes/ProviderDelegate.m @@ -81,7 +81,6 @@ update.supportsUngrouping = TRUE; update.hasVideo = _pendingCallVideo = video; - linphone_call_ref(call); // Report incoming call to system LOGD(@"CallKit: report new incoming call"); @@ -96,17 +95,13 @@ else linphone_call_decline(call,LinphoneReasonUnknown); } - linphone_call_unref(call); }]; } - (void)setPendingCall:(LinphoneCall *)pendingCall { if (pendingCall) { _pendingCall = pendingCall; - if (_pendingCall) - linphone_call_ref(_pendingCall); } else if (_pendingCall) { - linphone_call_unref(_pendingCall); _pendingCall = NULL; } }