mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
iequidoo's review
This commit is contained in:
@@ -774,8 +774,8 @@ impl Context {
|
|||||||
/// Returns information about the context as key-value pairs.
|
/// Returns information about the context as key-value pairs.
|
||||||
pub async fn get_info(&self) -> Result<BTreeMap<&'static str, String>> {
|
pub async fn get_info(&self) -> Result<BTreeMap<&'static str, String>> {
|
||||||
let unset = "0";
|
let unset = "0";
|
||||||
let l = self.list_transports().await?;
|
let entered_account_settings = self.list_transports().await?;
|
||||||
let l2 = ConfiguredLoginParam::load(self)
|
let used_account_settings = ConfiguredLoginParam::load(self)
|
||||||
.await?
|
.await?
|
||||||
.map_or_else(|| "Not configured".to_string(), |param| param.to_string());
|
.map_or_else(|| "Not configured".to_string(), |param| param.to_string());
|
||||||
let secondary_addrs = self.get_secondary_self_addrs().await?.join(", ");
|
let secondary_addrs = self.get_secondary_self_addrs().await?.join(", ");
|
||||||
@@ -869,12 +869,13 @@ impl Context {
|
|||||||
res.insert("proxy_enabled", proxy_enabled.to_string());
|
res.insert("proxy_enabled", proxy_enabled.to_string());
|
||||||
res.insert(
|
res.insert(
|
||||||
"entered_account_settings",
|
"entered_account_settings",
|
||||||
l.iter()
|
entered_account_settings
|
||||||
|
.iter()
|
||||||
.map(|l| l.to_string())
|
.map(|l| l.to_string())
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join("; "),
|
.join("; "),
|
||||||
);
|
);
|
||||||
res.insert("used_account_settings", l2);
|
res.insert("used_account_settings", used_account_settings);
|
||||||
|
|
||||||
if let Some(server_id) = &*self.server_id.read().await {
|
if let Some(server_id) = &*self.server_id.read().await {
|
||||||
res.insert("imap_server_id", format!("{server_id:?}"));
|
res.insert("imap_server_id", format!("{server_id:?}"));
|
||||||
|
|||||||
@@ -233,6 +233,11 @@ impl EnteredLoginParam {
|
|||||||
|
|
||||||
/// Saves entered account settings,
|
/// Saves entered account settings,
|
||||||
/// so that they can be prefilled if the user wants to configure the server again.
|
/// so that they can be prefilled if the user wants to configure the server again.
|
||||||
|
///
|
||||||
|
/// This is needed because all the UIs still use `get_config("mail_pw")` etc.
|
||||||
|
/// in order to prefill the entered account settings.
|
||||||
|
/// This will change when the UIs get a screen to list all available transports;
|
||||||
|
/// afterwards, we can then remove `save_legacy()` and the corresponding configs.
|
||||||
pub(crate) async fn save_legacy(&self, context: &Context) -> Result<()> {
|
pub(crate) async fn save_legacy(&self, context: &Context) -> Result<()> {
|
||||||
context.set_config(Config::Addr, Some(&self.addr)).await?;
|
context.set_config(Config::Addr, Some(&self.addr)).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user