diff --git a/deltachat-jsonrpc/src/api.rs b/deltachat-jsonrpc/src/api.rs index ff1337caa..fae0196fa 100644 --- a/deltachat-jsonrpc/src/api.rs +++ b/deltachat-jsonrpc/src/api.rs @@ -1518,6 +1518,18 @@ impl CommandApi { .collect()) } + /// Imports contacts from a vCard. + /// + /// Returns the ids of created/modified contacts in the order they appear in the vCard. + async fn import_vcard_contents(&self, account_id: u32, vcard: String) -> Result> { + let ctx = self.get_context(account_id).await?; + Ok(deltachat::contact::import_vcard(&ctx, &vcard) + .await? + .into_iter() + .map(|c| c.to_u32()) + .collect()) + } + /// Returns a vCard containing contacts with the given ids. async fn make_vcard(&self, account_id: u32, contacts: Vec) -> Result { let ctx = self.get_context(account_id).await?;