refactor(imap): move fetch_metadata() to Session

This commit is contained in:
link2xt
2024-02-28 22:42:54 +00:00
parent 8b9f19be70
commit 30432d8fa5
2 changed files with 8 additions and 5 deletions

View File

@@ -473,8 +473,10 @@ async fn inbox_loop(
warn!(ctx, "Failed to download messages: {:#}", err);
}
if let Err(err) = connection.fetch_metadata(&ctx).await {
warn!(ctx, "Failed to fetch metadata: {err:#}.");
if let Some(session) = connection.session.as_mut() {
if let Err(err) = session.fetch_metadata(&ctx).await {
warn!(ctx, "Failed to fetch metadata: {err:#}.");
}
}
fetch_idle(&ctx, &mut connection, FolderMeaning::Inbox).await;