mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
feat: jsonrpc: add private_tag to Account::Configured Object (#6107)
Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,9 @@ pub enum Account {
|
|||||||
// size: u32,
|
// size: u32,
|
||||||
profile_image: Option<String>, // TODO: This needs to be converted to work with blob http server.
|
profile_image: Option<String>, // TODO: This needs to be converted to work with blob http server.
|
||||||
color: String,
|
color: String,
|
||||||
|
/// Optional tag as "Work", "Family".
|
||||||
|
/// Meant to help profile owner to differ between profiles with similar names.
|
||||||
|
private_tag: Option<String>,
|
||||||
},
|
},
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
Unconfigured { id: u32 },
|
Unconfigured { id: u32 },
|
||||||
@@ -31,12 +34,14 @@ impl Account {
|
|||||||
let color = color_int_to_hex_string(
|
let color = color_int_to_hex_string(
|
||||||
Contact::get_by_id(ctx, ContactId::SELF).await?.get_color(),
|
Contact::get_by_id(ctx, ContactId::SELF).await?.get_color(),
|
||||||
);
|
);
|
||||||
|
let private_tag = ctx.get_config(Config::PrivateTag).await?;
|
||||||
Ok(Account::Configured {
|
Ok(Account::Configured {
|
||||||
id,
|
id,
|
||||||
display_name,
|
display_name,
|
||||||
addr,
|
addr,
|
||||||
profile_image,
|
profile_image,
|
||||||
color,
|
color,
|
||||||
|
private_tag,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Ok(Account::Unconfigured { id })
|
Ok(Account::Unconfigured { id })
|
||||||
|
|||||||
Reference in New Issue
Block a user