mirror of
https://github.com/chatmail/core.git
synced 2026-05-17 13:56:30 +03:00
api(jsonrpc): add import_vcard_contents() method
This commit is contained in:
@@ -1518,6 +1518,18 @@ impl CommandApi {
|
|||||||
.collect())
|
.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<Vec<u32>> {
|
||||||
|
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.
|
/// Returns a vCard containing contacts with the given ids.
|
||||||
async fn make_vcard(&self, account_id: u32, contacts: Vec<u32>) -> Result<String> {
|
async fn make_vcard(&self, account_id: u32, contacts: Vec<u32>) -> Result<String> {
|
||||||
let ctx = self.get_context(account_id).await?;
|
let ctx = self.get_context(account_id).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user