deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

vCard-based address book export API

Open link2xt opened this issue 5 months ago • 0 comments

This is the next step after #5202 (adding vCard-based address book import API).

Importing address book from a file will need to be an explicit action in the settings. There is also an idea to stop requesting permission for address book import when contact list is opened and move phone address book import action into settings as well for multiple reasons: permission request popup is annoying when you just want to get a list of contacts, users typically don't have emails in phone address book and email alone is not helpful for chatmail accounts which also need a key to send encrypted messages.

In any case, once there is any import action there can be an export action next to it just like for account and key backups. In the UI I imagine a dialog or screen listing all the contacts with checkmarks next to them. All contacts are selected by default and user can deselect all of them, then search and select contacts that need to be exported. To implement it we need a JSON-RPC API that accepts a list of contact IDs and returns a string with a .vcf file contents. Saving the file to disk or sharing it should be done in the UI.

vcard crate may be useful for generating vCard. It was used in #1279 but other crates could be evaluated.

Primary usecase for this API is exporting contacts from one account and importing into a new one, especially exporting the contacts with all keys from existing account and importing into chatmail account so chatmail account can send encrypted messages. This usecase of moving contacts from one Delta Chat account was mentioned in the support forum: https://support.delta.chat/t/better-contact-handling/705 Quotes: "It’s a bit difficult (if not extremely tedious), when we change accounts in DC, export our contacts", "+1 it are very difficult in the Android version you must change the account, copy the contact, go back … Uff it are very tedious process". API does not need any options to select what information about the contacts is exported, exported file is supposed to be used locally. Address book export may still be shared with trusted users, e.g. in a community/company to introduce new members to everyone else, but it is not the primary use case.

Note that this issue is not about "share contact" feature improvements. For sharing a contact we may need a new viewtype, a different API focused on exporting a single contact with the ability to exclude some fields, API to preview sent or received vCard etc. Discussing "share contact" is outside of the scope of this issue.

link2xt avatar Jan 21 '24 10:01 link2xt