mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 08:16:32 +03:00
fix: delete available_post_msgs row if the message is already downloaded
The row does not need to stay in the database only to be skipped each time.
This commit is contained in:
@@ -326,7 +326,11 @@ pub(crate) async fn download_known_post_messages_without_pre_message(
|
||||
})
|
||||
.await?;
|
||||
for rfc724_mid in &rfc724_mids {
|
||||
if !msg_is_downloaded_for(context, rfc724_mid).await? {
|
||||
if msg_is_downloaded_for(context, rfc724_mid).await? {
|
||||
delete_from_available_post_msgs(context, rfc724_mid).await?;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Download the Post-Message unconditionally,
|
||||
// because the Pre-Message got lost.
|
||||
// The message may be in the wrong order,
|
||||
@@ -343,7 +347,6 @@ pub(crate) async fn download_known_post_messages_without_pre_message(
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user