Added logs to help troubleshoot contact matching issue

This commit is contained in:
Sylvain Berfini 2025-10-06 10:28:23 +02:00
parent 2ea38abdfe
commit 1d28ce1846

View file

@ -434,8 +434,10 @@ class ContactsManager
@WorkerThread
fun findContactByAddress(address: Address): Friend? {
Log.i("$TAG Looking for friend matching SIP address [${address.asStringUriOnly()}]")
val found = coreContext.core.findFriend(address)
if (found != null) {
Log.i("$TAG Found friend [${found.name}] matching SIP address [${address.asStringUriOnly()}]")
return found
}
@ -464,8 +466,11 @@ class ContactsManager
}
return if (!username.isNullOrEmpty() && (username.startsWith("+") || username.isDigitsOnly())) {
Log.d("$TAG Looking for friend with phone number [$username]")
Log.i("$TAG Looking for friend using phone number [$username]")
val foundUsingPhoneNumber = coreContext.core.findFriendByPhoneNumber(username)
if (foundUsingPhoneNumber != null) {
Log.i("$TAG Found friend [${foundUsingPhoneNumber.name}] matching phone number [$username]")
}
foundUsingPhoneNumber
} else {
null