From e8a348ada22ce021cd38d4eaadcbd378a40b404f Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Thu, 16 Sep 2021 10:27:52 +0200 Subject: [PATCH] - Notify LinphoneCallUpdate on call back thread - Fix "no more call" detection to dismiss call views within call call back itself. --- Classes/CallManager.swift | 12 +++++------- Classes/PhoneMainView.m | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Classes/CallManager.swift b/Classes/CallManager.swift index f6458e9cc..e535f7ba2 100644 --- a/Classes/CallManager.swift +++ b/Classes/CallManager.swift @@ -642,13 +642,11 @@ import AVFoundation } } // post Notification kLinphoneCallUpdate - DispatchQueue.main.async { - NotificationCenter.default.post(name: Notification.Name("LinphoneCallUpdate"), object: self, userInfo: [ - AnyHashable("call"): NSValue.init(pointer:UnsafeRawPointer(call.getCobject)), - AnyHashable("state"): NSNumber(value: cstate.rawValue), - AnyHashable("message"): message - ]) - } + NotificationCenter.default.post(name: Notification.Name("LinphoneCallUpdate"), object: self, userInfo: [ + AnyHashable("call"): NSValue.init(pointer:UnsafeRawPointer(call.getCobject)), + AnyHashable("state"): NSNumber(value: cstate.rawValue), + AnyHashable("message"): message + ]) } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index c8d78cd4f..6d9a05a7e 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -403,7 +403,7 @@ static RootViewManager *rootViewManagerInstance = nil; } case LinphoneCallEnd: { const MSList *calls = linphone_core_get_calls(LC); - if (!calls) { + if (!calls || calls->data == call) { while ((currentView == CallView.compositeViewDescription) || (currentView == CallIncomingView.compositeViewDescription) || (currentView == CallOutgoingView.compositeViewDescription)) {