mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 14:26:30 +03:00
merge JobThread::connect_to_imap with Imap::connect_configured for simplicity
This commit is contained in:
11
src/imap.rs
11
src/imap.rs
@@ -295,6 +295,14 @@ impl Imap {
|
||||
// the trailing underscore is correct
|
||||
|
||||
if self.connect(context, ¶m) {
|
||||
if context
|
||||
.sql
|
||||
.get_raw_config_int(context, "folders_configured")
|
||||
.unwrap_or_default()
|
||||
< 3
|
||||
{
|
||||
self.configure_folders(context, 0x1);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
return Err(Error::ImapConnectionFailed(
|
||||
@@ -1069,8 +1077,7 @@ impl Imap {
|
||||
// TODO: make INBOX/SENT/MVBOX perform the jobs on their
|
||||
// respective folders to avoid select_folder network traffic
|
||||
// and the involved error states
|
||||
let inbox_thread = context.inbox_thread.read().unwrap();
|
||||
if let Err(err) = inbox_thread.connect_to_imap(context) {
|
||||
if let Err(err) = self.connect_configured(context) {
|
||||
warn!(context, "prepare_imap_op failed: {}", err);
|
||||
return Some(ImapActionResult::RetryLater);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user