mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
fix: Don't mark message as IMAP-seen if it already exists, but has state < InSeen
The message may not exist on another device.
This commit is contained in:
13
src/imap.rs
13
src/imap.rs
@@ -2248,11 +2248,16 @@ 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> {
|
||||||
if message::rfc724_mid_exists(context, message_id)
|
if let Some((.., seen)) = message::rfc724_mid_exists_ex(
|
||||||
.await?
|
context,
|
||||||
.is_some()
|
message_id,
|
||||||
|
"state>=16", // `InSeen`
|
||||||
|
)
|
||||||
|
.await?
|
||||||
{
|
{
|
||||||
markseen_on_imap_table(context, message_id).await?;
|
if seen {
|
||||||
|
markseen_on_imap_table(context, message_id).await?;
|
||||||
|
}
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user