make duplicate contact filtering more agressive by ignoring some fields

This commit is contained in:
tibbi 2018-04-30 16:07:45 +02:00
parent f32621c689
commit 23aa17df6f

View file

@ -86,6 +86,7 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m
fun getHashToCompare(): Int {
val newPhoneNumbers = ArrayList<PhoneNumber>()
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()
}
}