updating commons, handle SimpleContact having multiple numbers

This commit is contained in:
tibbi
2020-07-12 15:50:57 +02:00
parent ae9eb4f320
commit cdd9efe4e9
8 changed files with 9 additions and 9 deletions

View File

@ -71,7 +71,7 @@ class RecentsHelper(private val context: Context) {
val normalizedNumber = number.normalizePhoneNumber()
if (normalizedNumber!!.length >= COMPARABLE_PHONE_NUMBER_LENGTH) {
name = contacts.firstOrNull { contact ->
val curNumber = contact.phoneNumber.normalizePhoneNumber()
val curNumber = contact.phoneNumbers.first().normalizePhoneNumber()
if (curNumber!!.length >= COMPARABLE_PHONE_NUMBER_LENGTH) {
if (curNumber.substring(curNumber.length - COMPARABLE_PHONE_NUMBER_LENGTH) == normalizedNumber.substring(normalizedNumber.length - COMPARABLE_PHONE_NUMBER_LENGTH)) {
contactsNumbersMap[number] = contact.name