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

Add support for Viewtype::Vcard #3829

Closed
3 of 5 tasks
adbenitez opened this issue May 17, 2024 · 2 comments · Fixed by #3840
Closed
3 of 5 tasks

Add support for Viewtype::Vcard #3829

adbenitez opened this issue May 17, 2024 · 2 comments · Fixed by #3840
Assignees

Comments

@adbenitez
Copy link
Member

adbenitez commented May 17, 2024

deltachat/deltachat-core-rust#5536 introduces a new viewtype Vcard (Viewtype::Vcard in JsonRPC, DC_MSG_VCARD in the C FFI). In order to show it, call the JsonRPC function parse_vcard(filePath) where filePath is the path to the message's attachment.

parse_vcard() will return a JSON struct with fields addr, display_name, profile_image, and color (which you can use to create a placeholder image in case there is no profile_image). You can ignore the other returned fields. Note that parse_vcard() returns a list of contacts; simply ignore all except for the first contact.

Android implements viewing Vcards here: deltachat/deltachat-android#3043

Can be done now (depends on deltachat/deltachat-core-rust#5536):

These TODO-items should be postponed:

  • set new core stock string "Contact" (looks like we won't keep this stock string)

Preview from Android:
image

@nicodh nicodh self-assigned this May 18, 2024
nicodh added a commit that referenced this issue May 21, 2024
@nicodh
Copy link
Contributor

nicodh commented May 21, 2024

@adbenitez what is meant with: set new core stock string "Contact" (used in summary)?

@iequidoo
Copy link

iequidoo commented May 22, 2024

@adbenitez what is meant with: set new core stock string "Contact" (used in summary)?

Maybe we're going to remove this stock string at all as the contact name should be displayed instead of "Contact". And if a vCard can't be parsed, the message viewtype is changed to File anyway, so the file name is displayed instead.

EDIT: Currently this stock string is used, but with deltachat/deltachat-core-rust#5619 it isn't anymore.

Simon-Laux pushed a commit that referenced this issue Jun 1, 2024
Simon-Laux added a commit that referenced this issue Jun 1, 2024
* Show vcard in messages

resolves #3829

* Add changelog entry

* Show VCard before content not instead content

- add click handler to start chat

* Use import vcard before creating chat

* Move VCard in own component

* fix changelog entries and add pr number

---------

Co-authored-by: SimonLaux <mobile.info@simonlaux.de>
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

Successfully merging a pull request may close this issue.

3 participants