mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
avoid showing the same contact multiple times at Suggestions
This commit is contained in:
@@ -371,8 +371,10 @@ fun Context.getSuggestedContacts(): ArrayList<Contact> {
|
||||
val senderName = namePhoto.name
|
||||
val photoUri = namePhoto.photoUri ?: ""
|
||||
val contact = Contact(0, senderName, photoUri, senderNumber)
|
||||
if (!contacts.map { it.phoneNumber.trimToComparableNumber() }.contains(senderNumber.trimToComparableNumber())) {
|
||||
contacts.add(contact)
|
||||
}
|
||||
}
|
||||
|
||||
return contacts
|
||||
}
|
||||
|
Reference in New Issue
Block a user