mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
resultify fetch and simplify fake_idle
This commit is contained in:
@@ -7,8 +7,6 @@ use crate::constants::*;
|
||||
use crate::context::Context;
|
||||
use crate::dc_tools::*;
|
||||
use crate::e2ee;
|
||||
use crate::error::*;
|
||||
use crate::imap::*;
|
||||
use crate::job::*;
|
||||
use crate::login_param::LoginParam;
|
||||
use crate::oauth2::*;
|
||||
@@ -583,26 +581,6 @@ fn try_smtp_one_param(context: &Context, param: &LoginParam) -> Option<bool> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Connects to the configured account
|
||||
pub fn dc_connect_to_configured_imap(context: &Context, imap: &Imap) -> Result<()> {
|
||||
if async_std::task::block_on(async move { imap.is_connected().await }) {
|
||||
return Ok(());
|
||||
}
|
||||
if !context.sql.get_raw_config_bool(context, "configured") {
|
||||
return Err(Error::ConnectWithoutConfigure);
|
||||
}
|
||||
|
||||
let param = LoginParam::from_database(context, "configured_");
|
||||
// the trailing underscore is correct
|
||||
|
||||
if imap.connect(context, ¶m) {
|
||||
return Ok(());
|
||||
}
|
||||
return Err(Error::ImapConnectionFailed(
|
||||
format!("{}", param).to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Configure a Context
|
||||
******************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user