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
1 changed files with 2 additions and 1 deletions

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()
}
}