refactor(imap): require watch_folder for fake_idle()

This commit is contained in:
link2xt
2024-02-28 23:18:30 +00:00
parent 9e00e8627f
commit a83884d7e9
2 changed files with 6 additions and 17 deletions

View File

@@ -101,7 +101,7 @@ impl Imap {
pub(crate) async fn fake_idle(
&mut self,
context: &Context,
watch_folder: Option<String>,
watch_folder: String,
folder_meaning: FolderMeaning,
) {
// Idle using polling. This is also needed if we're not yet configured -
@@ -110,13 +110,6 @@ impl Imap {
let fake_idle_start_time = tools::Time::now();
// Do not poll, just wait for an interrupt when no folder is passed in.
let watch_folder = if let Some(watch_folder) = watch_folder {
watch_folder
} else {
info!(context, "IMAP-fake-IDLE: no folder, waiting for interrupt");
self.idle_interrupt_receiver.recv().await.ok();
return;
};
info!(context, "IMAP-fake-IDLEing folder={:?}", watch_folder);
const TIMEOUT_INIT_MS: u64 = 60_000;