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

@ -50,7 +50,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
recents.filter { it.phoneNumber == it.name }.forEach { recent ->
var wasNameFilled = false
if (privateContacts.isNotEmpty()) {
val privateContact = privateContacts.firstOrNull { it.phoneNumber == recent.phoneNumber }
val privateContact = privateContacts.firstOrNull { it.phoneNumbers.first() == recent.phoneNumber }
if (privateContact != null) {
recent.name = privateContact.name
wasNameFilled = true
@ -58,7 +58,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
}
if (!wasNameFilled) {
val contact = contacts.firstOrNull { it.phoneNumber == recent.phoneNumber }
val contact = contacts.firstOrNull { it.phoneNumbers.first() == recent.phoneNumber }
if (contact != null) {
recent.name = contact.name
}