mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 06:46:35 +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;
|
connection.connectivity.set_connected(ctx).await;
|
||||||
|
|
||||||
ctx.emit_event(EventType::ImapInboxIdle);
|
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() {
|
if !session.can_idle() {
|
||||||
info!(
|
info!(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -635,12 +641,6 @@ async fn fetch_idle(
|
|||||||
InterruptInfo::new(false)
|
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(
|
async fn simple_imap_loop(
|
||||||
|
|||||||
Reference in New Issue
Block a user