mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
scan_folders() bugfix: Don't exclude watched folders from being set as sent/spam folder
This does fix a bug and it makes the tests pass, but I'm not sure why it makes the tests pass; maybe there is a race condition that made the tests fail and my commit just leads to another timing.
This commit is contained in:
@@ -44,15 +44,6 @@ impl Imap {
|
||||
};
|
||||
|
||||
let foldername = folder.name();
|
||||
if watched_folders.contains(&foldername.to_string()) {
|
||||
info!(
|
||||
context,
|
||||
"Not scanning folder {} as it is watched anyway", foldername
|
||||
);
|
||||
continue;
|
||||
}
|
||||
info!(context, "Scanning folder: {}", foldername);
|
||||
|
||||
let folder_meaning = get_folder_meaning(&folder);
|
||||
let folder_name_meaning = get_folder_meaning_by_name(foldername);
|
||||
|
||||
@@ -70,8 +61,17 @@ impl Imap {
|
||||
spam_folder = Some(folder.name().to_string());
|
||||
}
|
||||
|
||||
if let Err(e) = self.fetch_new_messages(context, foldername, false).await {
|
||||
warn!(context, "Can't fetch new msgs in scanned folder: {:#}", e);
|
||||
if watched_folders.contains(&foldername.to_string()) {
|
||||
info!(
|
||||
context,
|
||||
"Not scanning folder {} as it is watched anyway", foldername
|
||||
);
|
||||
} else {
|
||||
info!(context, "Scanning folder: {}", foldername);
|
||||
|
||||
if let Err(e) = self.fetch_new_messages(context, foldername, false).await {
|
||||
warn!(context, "Can't fetch new msgs in scanned folder: {:#}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user