use only contact name at merging duplicates, not email

This commit is contained in:
tibbi 2019-09-16 19:25:19 +02:00
parent 0160f48711
commit f11f23b8e1
2 changed files with 2 additions and 5 deletions

View File

@ -67,7 +67,7 @@ class ContactsHelper(val context: Context) {
}
if (ignoredContactSources.isEmpty() && !getAll) {
tempContacts.filter { displayContactSources.contains(it.source) }.groupBy { "${it.getNameToDisplay().toLowerCase()}${it.emails}" }.values.forEach { it ->
tempContacts.filter { displayContactSources.contains(it.source) }.groupBy { it.getNameToDisplay().toLowerCase()}.values.forEach { it ->
if (it.size == 1) {
resultContacts.add(it.first())
} else {

View File

@ -108,11 +108,8 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m
}
fun getStringToCompare(): String {
val newEmails = ArrayList<Email>()
emails.mapTo(newEmails) { Email(it.value, 0, "") }
return copy(id = 0, prefix = "", firstName = getNameToDisplay().toLowerCase(), middleName = "", surname = "", suffix = "", nickname = "", photoUri = "",
phoneNumbers = ArrayList(), events = ArrayList(), source = "", addresses = ArrayList(), emails = newEmails, starred = 0, contactId = 0,
phoneNumbers = ArrayList(), emails = ArrayList(), events = ArrayList(), source = "", addresses = ArrayList(), starred = 0, contactId = 0,
thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", ""), IMs = ArrayList()).toString()
}