mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
api(jsonrpc): add id to ProviderInfo
This commit is contained in:
@@ -6,6 +6,8 @@ use typescript_type_def::TypeDef;
|
|||||||
#[derive(Serialize, TypeDef, schemars::JsonSchema)]
|
#[derive(Serialize, TypeDef, schemars::JsonSchema)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct ProviderInfo {
|
pub struct ProviderInfo {
|
||||||
|
/// Unique ID, corresponding to provider database filename.
|
||||||
|
pub id: String,
|
||||||
pub before_login_hint: String,
|
pub before_login_hint: String,
|
||||||
pub overview_page: String,
|
pub overview_page: String,
|
||||||
pub status: u32, // in reality this is an enum, but for simplicity and because it gets converted into a number anyway, we use an u32 here.
|
pub status: u32, // in reality this is an enum, but for simplicity and because it gets converted into a number anyway, we use an u32 here.
|
||||||
@@ -14,6 +16,7 @@ pub struct ProviderInfo {
|
|||||||
impl ProviderInfo {
|
impl ProviderInfo {
|
||||||
pub fn from_dc_type(provider: Option<&Provider>) -> Option<Self> {
|
pub fn from_dc_type(provider: Option<&Provider>) -> Option<Self> {
|
||||||
provider.map(|p| ProviderInfo {
|
provider.map(|p| ProviderInfo {
|
||||||
|
id: p.id.to_owned(),
|
||||||
before_login_hint: p.before_login_hint.to_owned(),
|
before_login_hint: p.before_login_hint.to_owned(),
|
||||||
overview_page: p.overview_page.to_owned(),
|
overview_page: p.overview_page.to_owned(),
|
||||||
status: p.status.to_u32().unwrap(),
|
status: p.status.to_u32().unwrap(),
|
||||||
|
|||||||
Reference in New Issue
Block a user