[wip] fix auto-download for pre-messages

This commit is contained in:
Hocuri
2025-12-14 21:21:39 +01:00
parent 96fa64d69b
commit 13bbbd8c14
2 changed files with 5 additions and 6 deletions

View File

@@ -2284,6 +2284,7 @@ pub(crate) async fn prefetch_should_download(
message_id: &str, message_id: &str,
mut flags: impl Iterator<Item = Flag<'_>>, mut flags: impl Iterator<Item = Flag<'_>>,
) -> Result<bool> { ) -> Result<bool> {
return Ok(true);
if message::rfc724_mid_exists(context, message_id) if message::rfc724_mid_exists(context, message_id)
.await? .await?
.is_some() .is_some()

View File

@@ -501,9 +501,6 @@ async fn inbox_fetch_idle(ctx: &Context, imap: &mut Imap, mut session: Session)
} }
} }
download_msgs(ctx, &mut session)
.await
.context("Failed to download messages")?;
session session
.fetch_metadata(ctx) .fetch_metadata(ctx)
.await .await
@@ -587,9 +584,10 @@ async fn fetch_idle(
.await .await
.context("delete_expired_imap_messages")?; .context("delete_expired_imap_messages")?;
//------- download_msgs(ctx, &mut session)
// TODO: verify that this is the correct position for this call .await
// in order to guard against lost pre-messages: .context("Failed to download messages")?;
download_known_post_messages_without_pre_message(ctx, &mut session).await?; download_known_post_messages_without_pre_message(ctx, &mut session).await?;
} else if folder_config == Config::ConfiguredInboxFolder { } else if folder_config == Config::ConfiguredInboxFolder {
session.last_full_folder_scan.lock().await.take(); session.last_full_folder_scan.lock().await.take();