deltachat / deltachat-desktop

Email-based instant messaging for Desktop.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow to share contact as vCard

adbenitez opened this issue · comments

with the new core API it is possible to share contacts as vcard, there should be an option in the attachment button called "Contact" on click the contact list view is opened, user select one contact that gets send as vcard using the make_vcard() JSON-RPC API

  • add "contact" option to attachment menu to select contact
  • on clicking the "contact" button a "contact selection" list appears, to select contact to share as vcard (using deltachat/deltachat-core-rust#5571)

@adbenitez
Do I get it right: the current core implementation would require these steps:

  1. after click on "contact" in attachemnt menu show a dialog to select oner or more contacts
  2. once contacts were selected, get VCard including these contacts by calling rpc.makeVcard
  3. save this VCard as temporary file (!)
  4. attach this file to the draft like a normal file attachement

I would have expected there is a direct way to set draft.vCardContact but it seems that is not supported and that is why step 3 and 4 are neccessary?

  1. after click on "contact" in attachemnt menu show a dialog to select oner or more contacts

it is not select but to click a single one to be selected for sharing, sharing multiple at once (single vcard) is not supported atm

I would have expected there is a direct way to set draft.vCardContact but it seems that is not supported and that is why step 3 and 4 are neccessary?

I think it is not necessary, just setting the file core should be able to recognize that this is a vcard and set the type to vcard, same happens if you attach a webxdc file or a gif image, core takes care to set the proper obvious view type, not sure if this works for draft tho, it would need to be fixed in core then

  • when a shared contact/vcard is clicked, it should be imported and the 1:1 chat

this was already added in #3840

4. attach this file to the draft like a normal file attachement

the main task here is allowing to share a contact as vcard, sending directly would simplify things greatly and avoid ugly or complex stagging, I think it is the best way to go for now and anyways sending vcard + text was already from the beginning a "nice to have", so it could come at a later point and is not strictly necessary for this issue

I think it is not necessary, just setting the file core should be able to recognize that this is a vcard and set the type to vcard, same happens if you attach a webxdc file or a gif image, core takes care to set the proper obvious view type, not sure if this works for draft tho, it would need to be fixed in core then

True, but for drafts recognising vCards doesn't work currently, it's only fixed in not yet merged deltachat/deltachat-core-rust#5619. Though if you know the attachment is a vCard, Viewtype::Vcard may be used directly, this way core shouldn't guess anything, it only checks the vCard has the correct format (personally, i prefer not to rely on various guessing logic)

I think it is not necessary, just setting the file core should be able to recognize that this is a vcard and set the type to vcard, same happens if you attach a webxdc file or a gif image, core takes care to set the proper obvious view type, not sure if this works for draft tho, it would need to be fixed in core then

BTW, note that core does not do this for drafts of all viewtypes. It does do it for webxdcs, but e.g. for images that are sent as files it does not, which is important: We recommend that users can send images as a “file” to preserve the original.