From b36f220911d2ba357f475e3fb844cfa61ea31a10 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Mon, 15 Sep 2025 15:52:34 +0200 Subject: [PATCH] Update friend list subscriptions on Core queue --- Linphone/Contacts/ContactsManager.swift | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Linphone/Contacts/ContactsManager.swift b/Linphone/Contacts/ContactsManager.swift index 328b0b965..df61fe81c 100644 --- a/Linphone/Contacts/ContactsManager.swift +++ b/Linphone/Contacts/ContactsManager.swift @@ -452,10 +452,12 @@ final class ContactsManager: ObservableObject { } dispatchGroup.notify(queue: .main) { - MagicSearchSingleton.shared.searchForContacts() - if let linphoneFL = self.tempRemoteFriendList { - linphoneFL.updateSubscriptions() - } + self.coreContext.doOnCoreQueue { _ in + MagicSearchSingleton.shared.searchForContacts() + if let linphoneFL = self.tempRemoteFriendList { + linphoneFL.updateSubscriptions() + } + } } } }, @@ -507,9 +509,11 @@ final class ContactsManager: ObservableObject { } dispatchGroup.notify(queue: .main) { - MagicSearchSingleton.shared.searchForContacts() - if let linphoneFL = self.tempRemoteFriendList { - linphoneFL.updateSubscriptions() + self.coreContext.doOnCoreQueue { _ in + MagicSearchSingleton.shared.searchForContacts() + if let linphoneFL = self.tempRemoteFriendList { + linphoneFL.updateSubscriptions() + } } } } @@ -550,6 +554,8 @@ final class ContactsManager: ObservableObject { } ) + self.friendListDelegate = friendListDelegateTmp + CoreContext.shared.mCore.friendsLists.forEach { friendList in friendList.addDelegate(delegate: friendListDelegateTmp) } @@ -593,8 +599,10 @@ final class ContactsManager: ObservableObject { } func updateSubscriptionsLinphoneList() { - if let linphoneFL = self.linphoneFriendList { - linphoneFL.updateSubscriptions() + self.coreContext.doOnCoreQueue { _ in + if let linphoneFL = self.linphoneFriendList { + linphoneFL.updateSubscriptions() + } } } }