api: Add make_vcard() (#5203)

Add a function returning a vCard containing contacts with the given ids.
This commit is contained in:
iequidoo
2024-05-14 04:25:39 -03:00
committed by iequidoo
parent a38f0ba09e
commit 6290ed8752
3 changed files with 109 additions and 2 deletions

View File

@@ -1437,6 +1437,13 @@ impl CommandApi {
.collect())
}
/// Returns a vCard containing contacts with the given ids.
async fn make_vcard(&self, account_id: u32, contacts: Vec<u32>) -> Result<String> {
let ctx = self.get_context(account_id).await?;
let contacts: Vec<_> = contacts.iter().map(|&c| ContactId::new(c)).collect();
deltachat::contact::make_vcard(&ctx, &contacts).await
}
// ---------------------------------------------
// chat
// ---------------------------------------------