mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
refactor: pass address to moz_autoconfigure() instead of LoginParam
This commit is contained in:
@@ -507,7 +507,7 @@ async fn get_autoconfig(
|
|||||||
&format!(
|
&format!(
|
||||||
"https://autoconfig.{param_domain}/mail/config-v1.1.xml?emailaddress={param_addr_urlencoded}"
|
"https://autoconfig.{param_domain}/mail/config-v1.1.xml?emailaddress={param_addr_urlencoded}"
|
||||||
),
|
),
|
||||||
param,
|
¶m.addr,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -522,7 +522,7 @@ async fn get_autoconfig(
|
|||||||
"https://{}/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress={}",
|
"https://{}/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress={}",
|
||||||
¶m_domain, ¶m_addr_urlencoded
|
¶m_domain, ¶m_addr_urlencoded
|
||||||
),
|
),
|
||||||
param,
|
¶m.addr,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -558,7 +558,7 @@ async fn get_autoconfig(
|
|||||||
if let Ok(res) = moz_autoconfigure(
|
if let Ok(res) = moz_autoconfigure(
|
||||||
ctx,
|
ctx,
|
||||||
&format!("https://autoconfig.thunderbird.net/v1.1/{}", ¶m_domain),
|
&format!("https://autoconfig.thunderbird.net/v1.1/{}", ¶m_domain),
|
||||||
param,
|
¶m.addr,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ use quick_xml::events::{BytesStart, Event};
|
|||||||
|
|
||||||
use super::{Error, ServerParams};
|
use super::{Error, ServerParams};
|
||||||
use crate::context::Context;
|
use crate::context::Context;
|
||||||
use crate::login_param::LoginParam;
|
|
||||||
use crate::net::read_url;
|
use crate::net::read_url;
|
||||||
use crate::provider::{Protocol, Socket};
|
use crate::provider::{Protocol, Socket};
|
||||||
|
|
||||||
@@ -257,11 +256,11 @@ fn parse_serverparams(in_emailaddr: &str, xml_raw: &str) -> Result<Vec<ServerPar
|
|||||||
pub(crate) async fn moz_autoconfigure(
|
pub(crate) async fn moz_autoconfigure(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
url: &str,
|
url: &str,
|
||||||
param_in: &LoginParam,
|
addr: &str,
|
||||||
) -> Result<Vec<ServerParams>, Error> {
|
) -> Result<Vec<ServerParams>, Error> {
|
||||||
let xml_raw = read_url(context, url).await?;
|
let xml_raw = read_url(context, url).await?;
|
||||||
|
|
||||||
let res = parse_serverparams(¶m_in.addr, &xml_raw);
|
let res = parse_serverparams(addr, &xml_raw);
|
||||||
if let Err(err) = &res {
|
if let Err(err) = &res {
|
||||||
warn!(
|
warn!(
|
||||||
context,
|
context,
|
||||||
|
|||||||
Reference in New Issue
Block a user