mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-17 03:51:03 +01:00
get all contacts without merging duplicates in some cases
This commit is contained in:
parent
c07e70ab1c
commit
523dfc039b
@ -176,7 +176,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
|
|||||||
val positions = getSelectedItemPositions()
|
val positions = getSelectedItemPositions()
|
||||||
contactItems.removeAll(contactsToRemove)
|
contactItems.removeAll(contactsToRemove)
|
||||||
|
|
||||||
ContactsHelper(activity).getContacts { allContacts ->
|
ContactsHelper(activity).getContacts(true) { allContacts ->
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
contactsToRemove.forEach {
|
contactsToRemove.forEach {
|
||||||
val contactToRemove = it
|
val contactToRemove = it
|
||||||
|
@ -1572,7 +1572,7 @@ class ContactsHelper(val context: Context) {
|
|||||||
|
|
||||||
fun getDuplicatesOfContact(contact: Contact, addOriginal: Boolean, callback: (ArrayList<Contact>) -> Unit) {
|
fun getDuplicatesOfContact(contact: Contact, addOriginal: Boolean, callback: (ArrayList<Contact>) -> Unit) {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
getContacts { contacts ->
|
getContacts(true) { contacts ->
|
||||||
val duplicates = contacts.filter { it.id != contact.id && it.getHashToCompare() == contact.getHashToCompare() }.toMutableList() as ArrayList<Contact>
|
val duplicates = contacts.filter { it.id != contact.id && it.getHashToCompare() == contact.getHashToCompare() }.toMutableList() as ArrayList<Contact>
|
||||||
if (addOriginal) {
|
if (addOriginal) {
|
||||||
duplicates.add(contact)
|
duplicates.add(contact)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user