api: add API to reset contact encryption

This commit is contained in:
link2xt
2024-11-02 20:45:47 +00:00
committed by l
parent c627d2fcc8
commit 92c6dd483c
4 changed files with 106 additions and 0 deletions

View File

@@ -1419,6 +1419,15 @@ impl CommandApi {
Ok(())
}
/// Resets contact encryption.
async fn reset_contact_encryption(&self, account_id: u32, contact_id: u32) -> Result<()> {
let ctx = self.get_context(account_id).await?;
let contact_id = ContactId::new(contact_id);
contact_id.reset_encryption(&ctx).await?;
Ok(())
}
async fn change_contact_name(
&self,
account_id: u32,