Add support for Viewtype::Vcard
adbenitez opened this issue · comments
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):
- display vcard messages in-chat
- display in quotes/replies
- display in draft/staging
- When a vCard is clicked, ask for confirmation and then call
import_vcard()
(depends on deltachat/deltachat-core-rust#5582)
These TODO-items should be postponed:
-
set new core stock string "Contact"(looks like we won't keep this stock string)
@adbenitez what is meant with: set new core stock string "Contact" (used in summary)?
@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.