Trying to speed up process contacts filtering by using nativeid & friends' refkey
This commit is contained in:
parent
cc632d89f3
commit
f86c9dc99c
1 changed files with 6 additions and 0 deletions
|
@ -226,6 +226,12 @@ class ContactsManager(private val context: Context) {
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
fun findContactByFriend(friend: Friend): Contact? {
|
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
|
val address = friend.address
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
val friends = coreContext.core.findFriends(address)
|
val friends = coreContext.core.findFriends(address)
|
||||||
|
|
Loading…
Reference in a new issue