get all contacts without merging duplicates in some cases

This commit is contained in:
tibbi 2019-09-14 21:47:01 +02:00
parent c07e70ab1c
commit 523dfc039b
2 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
val positions = getSelectedItemPositions()
contactItems.removeAll(contactsToRemove)
ContactsHelper(activity).getContacts { allContacts ->
ContactsHelper(activity).getContacts(true) { allContacts ->
ensureBackgroundThread {
contactsToRemove.forEach {
val contactToRemove = it

View File

@ -1572,7 +1572,7 @@ class ContactsHelper(val context: Context) {
fun getDuplicatesOfContact(contact: Contact, addOriginal: Boolean, callback: (ArrayList<Contact>) -> Unit) {
ensureBackgroundThread {
getContacts { contacts ->
getContacts(true) { contacts ->
val duplicates = contacts.filter { it.id != contact.id && it.getHashToCompare() == contact.getHashToCompare() }.toMutableList() as ArrayList<Contact>
if (addOriginal) {
duplicates.add(contact)