From f86c9dc99cf74cba1315c33ab3ca98e85cccfad0 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 3 Mar 2022 13:47:51 +0100 Subject: [PATCH] Trying to speed up process contacts filtering by using nativeid & friends' refkey --- app/src/main/java/org/linphone/contact/ContactsManager.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/linphone/contact/ContactsManager.kt b/app/src/main/java/org/linphone/contact/ContactsManager.kt index 52c1265fa..ca345b5fb 100644 --- a/app/src/main/java/org/linphone/contact/ContactsManager.kt +++ b/app/src/main/java/org/linphone/contact/ContactsManager.kt @@ -226,6 +226,12 @@ class ContactsManager(private val context: Context) { @Synchronized fun findContactByFriend(friend: Friend): Contact? { + val refKey = friend.refKey + if (refKey != null) { + val contact = findContactById(refKey) + if (contact != null) return contact + } + val address = friend.address if (address != null) { val friends = coreContext.core.findFriends(address)