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() + } } } }