api: Add Viewtype::Vcard (#5202)

Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
iequidoo
2024-05-06 03:35:45 -03:00
committed by iequidoo
parent 95238b6e17
commit 22f01a2699
10 changed files with 143 additions and 29 deletions

View File

@@ -1431,7 +1431,7 @@ impl CommandApi {
async fn parse_vcard(&self, path: String) -> Result<Vec<VcardContact>> {
let vcard = tokio::fs::read(Path::new(&path)).await?;
let vcard = str::from_utf8(&vcard)?;
Ok(deltachat_contact_tools::parse_vcard(vcard)?
Ok(deltachat_contact_tools::parse_vcard(vcard)
.into_iter()
.map(|c| c.into())
.collect())