From 23aa17df6fd5ff4da9ffb0f40c3d782c49519c81 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Apr 2018 16:07:45 +0200 Subject: [PATCH] make duplicate contact filtering more agressive by ignoring some fields --- .../kotlin/com/simplemobiletools/contacts/models/Contact.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt index 42cc04cd..5e16348a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt @@ -86,6 +86,7 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m fun getHashToCompare(): Int { val newPhoneNumbers = ArrayList() phoneNumbers.mapTo(newPhoneNumbers, { PhoneNumber(it.value.replace(pattern, ""), 0) }) - return copy(id = 0, phoneNumbers = newPhoneNumbers).hashCode() + return copy(id = 0, prefix = "", firstName = getFullName().toLowerCase(), middleName = "", surname = "", suffix = "", photoUri = "", + phoneNumbers = newPhoneNumbers, source = "", starred = 0, contactId = 0, thumbnailUri = "", notes = "").hashCode() } }