Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to share contact as vCard #3830

Closed
2 tasks
adbenitez opened this issue May 17, 2024 · 6 comments
Closed
2 tasks

Allow to share contact as vCard #3830

adbenitez opened this issue May 17, 2024 · 6 comments
Assignees

Comments

@adbenitez
Copy link
Member

adbenitez commented May 17, 2024

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

@nicodh nicodh self-assigned this May 17, 2024
@nicodh
Copy link
Contributor

nicodh commented Jun 5, 2024

@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?

@adbenitez
Copy link
Member Author

  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

@adbenitez
Copy link
Member Author

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

this was already added in #3840

@adbenitez
Copy link
Member Author

adbenitez commented Jun 5, 2024

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

@iequidoo
Copy link

iequidoo commented Jun 5, 2024

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)

nicodh added a commit that referenced this issue Jun 6, 2024
resolves #3830
Simon-Laux pushed a commit that referenced this issue Jun 7, 2024
@Hocuri
Copy link

Hocuri commented Jun 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants