deltachat / deltachat-android

Email-based instant messaging for Android.
GNU General Public License v3.0
1.1k stars 144 forks source link

add contacts from the system address book to internal contact database #557

Closed r10s closed 5 years ago

r10s commented 5 years ago

each time the contact list is opened, the system address book should be read and all names+email addresses should be added using dc_add_address_book() resp. DcContext.addAddressBook().

this should be done in a thread, currently, currently, it is not needed to remove addresses added; the contact list is more a text-completion tool than an fully-functional address book.

the old code is here: https://github.com/deltachat/deltachat-android/blob/master/MessengerProj/src/main/java/com/b44t/messenger/ContactsActivity.java#L196

Boehrsi commented 5 years ago

Will look into that one next week. :+1:

r10s commented 5 years ago

great - maybe we can also have little a/v next week. have a nice weekend in between :)

Boehrsi commented 5 years ago

@r10s sounds great, lets chat on Monday regarding date / time. And also a nice weekend for you. :)

Boehrsi commented 5 years ago

Added the requested changes.

r10s commented 5 years ago

great :)

as mentioned, however, there is a funny screen appearing under some circumstances (see attached image).

i think, this screen can be removed at all. there is no need at all to show that contacts are being loaded, not even a special refresh-list is required as DC_EVENT_CONTACTS_CHANGED will be emitted when dc_add_address_book() adds sth. (i am about to add this to the core, currently, should be there tomorrow)

image

Boehrsi commented 5 years ago

Okay, I will adjust this today. @r10s would you ping me if the core update is ready? Thanks. :)

r10s commented 5 years ago

@Boehrsi updated, DcContext.addAddressBook() results in a DC_EVENT_CONTACTS_CHANGED event which is already handled in the activity.

Boehrsi commented 5 years ago

Great will integrate this now :).

Boehrsi commented 5 years ago

Adjusted the loading in regards to the updated core and removed the "loading screen". If the user grants the permission the address book is loaded + delta contacts and if not, just the available delta contacts are loaded from the core. The user is ask for permission when entering the contact screen.

r10s commented 5 years ago

great - also that the permission can be denied and the app just uses the internal contacts then.

i think this issue can be closed :)