avoid showing the same contact multiple times at Suggestions
This commit is contained in:
parent
c1652efb2e
commit
06f61b55cb
|
@ -371,8 +371,10 @@ fun Context.getSuggestedContacts(): ArrayList<Contact> {
|
||||||
val senderName = namePhoto.name
|
val senderName = namePhoto.name
|
||||||
val photoUri = namePhoto.photoUri ?: ""
|
val photoUri = namePhoto.photoUri ?: ""
|
||||||
val contact = Contact(0, senderName, photoUri, senderNumber)
|
val contact = Contact(0, senderName, photoUri, senderNumber)
|
||||||
|
if (!contacts.map { it.phoneNumber.trimToComparableNumber() }.contains(senderNumber.trimToComparableNumber())) {
|
||||||
contacts.add(contact)
|
contacts.add(contact)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return contacts
|
return contacts
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue