mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
refine example
This commit is contained in:
@@ -24,11 +24,8 @@ pub enum ServerSocket {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Server {
|
pub struct Server {
|
||||||
pub stype: ServerType,
|
pub stype: u16,
|
||||||
pub socket: ServerSocket,
|
// more fields are needed, just to keep the example short
|
||||||
pub port: u16,
|
|
||||||
pub server: &'static str,
|
|
||||||
pub username: &'static str,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
@@ -37,28 +34,39 @@ pub struct Provider {
|
|||||||
pub status: Status,
|
pub status: Status,
|
||||||
pub before_login_hint: &'static str,
|
pub before_login_hint: &'static str,
|
||||||
pub overview_page: &'static str,
|
pub overview_page: &'static str,
|
||||||
|
pub server: [Server], // this seems to be okay
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: the database will be auto-generated from the provider-db
|
// TODO: the database will be auto-generated from the provider-db
|
||||||
const DATABASE: [Provider; 3] = [
|
const DATABASE: [Provider; 1] = [
|
||||||
Provider {
|
Provider {
|
||||||
domains: "nauta.cu",
|
domains: "nauta.cu",
|
||||||
status: Status::OK,
|
status: Status::OK,
|
||||||
before_login_hint: "",
|
before_login_hint: "",
|
||||||
overview_page: "",
|
overview_page: "",
|
||||||
|
server: [Server; 2] = [Server { stype: 123 }, Server { stype: 456 }],
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
Provider {
|
Provider {
|
||||||
domains: "outlook.com live.com",
|
domains: "outlook.com hotmail.com live.com",
|
||||||
status: Status::BROKEN,
|
status: Status::BROKEN,
|
||||||
before_login_hint: "this provider is broken, sorry :(",
|
before_login_hint: "Outlook-e-mail-addresses will not work as expected \
|
||||||
|
as these servers remove some important transport information.\n\n\
|
||||||
|
Hopefully sooner or later there will be a fix; \
|
||||||
|
for now, we suggest to use another e-mail-address \
|
||||||
|
or try Delta Chat again when the issue is fixed.",
|
||||||
overview_page: "https://provider.delta.chat/outlook.com",
|
overview_page: "https://provider.delta.chat/outlook.com",
|
||||||
},
|
},
|
||||||
Provider {
|
Provider {
|
||||||
domains: "gmail.com",
|
domains: "gmail.com googlemail.com",
|
||||||
status: Status::PREPARATION,
|
status: Status::PREPARATION,
|
||||||
before_login_hint: "please enable less-secure-apps",
|
before_login_hint: "For Gmail Accounts, you need to create an App-Password \
|
||||||
|
if you have \"2-Step Verification\" enabled. \
|
||||||
|
If this setting is not available, \
|
||||||
|
you need to enable \"Less secure apps\".",
|
||||||
overview_page: "https://provider.delta.chat/gmail.com",
|
overview_page: "https://provider.delta.chat/gmail.com",
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
];
|
];
|
||||||
|
|
||||||
pub fn get_provider_info(addr: &str) -> Option<&Provider> {
|
pub fn get_provider_info(addr: &str) -> Option<&Provider> {
|
||||||
|
|||||||
Reference in New Issue
Block a user