mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
[wip] fix auto-download for pre-messages
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user