mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
refactor(imap): reduce indentation level in fetch_idle()
This commit is contained in:
@@ -591,7 +591,13 @@ async fn fetch_idle(
|
||||
connection.connectivity.set_connected(ctx).await;
|
||||
|
||||
ctx.emit_event(EventType::ImapInboxIdle);
|
||||
if let Some(session) = connection.session.take() {
|
||||
let Some(session) = connection.session.take() else {
|
||||
warn!(ctx, "No IMAP session, going to fake idle.");
|
||||
return connection
|
||||
.fake_idle(ctx, Some(watch_folder), folder_meaning)
|
||||
.await;
|
||||
};
|
||||
|
||||
if !session.can_idle() {
|
||||
info!(
|
||||
ctx,
|
||||
@@ -635,12 +641,6 @@ async fn fetch_idle(
|
||||
InterruptInfo::new(false)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warn!(ctx, "No IMAP session, going to fake idle.");
|
||||
connection
|
||||
.fake_idle(ctx, Some(watch_folder), folder_meaning)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
async fn simple_imap_loop(
|
||||
|
||||
Reference in New Issue
Block a user