Skip to content

Commit

Permalink
feat: add support for locked/encrypted accounts to jsonrpc api
Browse files Browse the repository at this point in the history
api!: jsonrpc new variant of `Account` enum: `Account::Locked`.
  • Loading branch information
Simon-Laux committed Nov 1, 2024
1 parent ded8c02 commit ff8c498
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deltachat-jsonrpc/src/api/types/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ pub enum Account {
},
#[serde(rename_all = "camelCase")]
Unconfigured { id: u32 },
#[serde(rename_all = "camelCase")]
Locked { id: u32 },
}

impl Account {
pub async fn from_context(ctx: &deltachat::context::Context, id: u32) -> Result<Self> {
if !ctx.is_open().await {
return Ok(Account::Locked { id });
}
if ctx.is_configured().await? {
let display_name = ctx.get_config(Config::Displayname).await?;
let addr = ctx.get_config(Config::Addr).await?;
Expand Down

0 comments on commit ff8c498

Please sign in to comment.