properly compare contacts that have no name or organization, just email
This commit is contained in:
parent
b3bd0f182b
commit
ca453ff04d
|
@ -37,12 +37,20 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m
|
|||
}
|
||||
}
|
||||
|
||||
if (firstString.isEmpty() && firstName.isEmpty() && middleName.isEmpty() && surname.isEmpty() && organization.company.isNotEmpty()) {
|
||||
if (firstString.isEmpty() && firstName.isEmpty() && middleName.isEmpty() && surname.isEmpty()) {
|
||||
if (organization.company.isNotEmpty()) {
|
||||
firstString = organization.company.normalizeString()
|
||||
} else if (emails.isNotEmpty()) {
|
||||
firstString = emails.first().value
|
||||
}
|
||||
}
|
||||
|
||||
if (secondString.isEmpty() && other.firstName.isEmpty() && other.middleName.isEmpty() && other.surname.isEmpty() && other.organization.company.isNotEmpty()) {
|
||||
if (secondString.isEmpty() && other.firstName.isEmpty() && other.middleName.isEmpty() && other.surname.isEmpty()) {
|
||||
if (other.organization.company.isNotEmpty()) {
|
||||
secondString = other.organization.company.normalizeString()
|
||||
} else if (other.emails.isNotEmpty()) {
|
||||
secondString = other.emails.first().value
|
||||
}
|
||||
}
|
||||
|
||||
var result = if (firstString.firstOrNull()?.isLetter() == true && secondString.firstOrNull()?.isLetter() == false) {
|
||||
|
|
Loading…
Reference in New Issue