mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-22 13:47:18 +02:00
use only contact name at merging duplicates, not email
This commit is contained in:
parent
0160f48711
commit
f11f23b8e1
@ -67,7 +67,7 @@ class ContactsHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ignoredContactSources.isEmpty() && !getAll) {
|
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) {
|
if (it.size == 1) {
|
||||||
resultContacts.add(it.first())
|
resultContacts.add(it.first())
|
||||||
} else {
|
} else {
|
||||||
|
@ -108,11 +108,8 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getStringToCompare(): String {
|
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 = "",
|
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()
|
thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", ""), IMs = ArrayList()).toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user