From eb5ddf270f91554c7e27377ac04a3ef2b46ab698 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Sat, 25 Mar 2023 14:06:43 -0300 Subject: [PATCH] receive_imf: Mark special messages as seen (#3054) Exactly: delivery reports, webxdc status updates. --- CHANGELOG.md | 1 + python/tests/test_1_online.py | 3 +++ src/receive_imf.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5862fb8c6..0a16ce7ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Fixes - deltachat-rpc-client: fix bug in `Chat.send_message()`: invalid `MessageData` field `quotedMsg` instead of `quotedMsgId` +- receive_imf: Mark special messages as seen. Exactly: delivery reports, webxdc status updates. ## [1.112.0] - 2023-03-23 diff --git a/python/tests/test_1_online.py b/python/tests/test_1_online.py index 96b5fb3d9..eb324f071 100644 --- a/python/tests/test_1_online.py +++ b/python/tests/test_1_online.py @@ -319,6 +319,9 @@ def test_webxdc_message(acfactory, data, lp): assert msg2.text == "message1" assert msg2.is_webxdc() assert msg2.filename + ac2._evtracker.get_info_contains("Marked messages [0-9]+ in folder INBOX as seen.") + ac2.direct_imap.select_folder("Inbox") + assert len(list(ac2.direct_imap.conn.fetch(AND(seen=True)))) == 1 def test_mvbox_sentbox_threads(acfactory, lp): diff --git a/src/receive_imf.rs b/src/receive_imf.rs index f10d14549..c4adf7132 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -534,6 +534,7 @@ async fn add_parts( if chat_id.is_none() && mime_parser.delivery_report.is_some() { chat_id = Some(DC_CHAT_ID_TRASH); info!(context, "Message is a DSN (TRASH).",); + markseen_on_imap_table(context, rfc724_mid).await.ok(); } if chat_id.is_none() { @@ -868,6 +869,7 @@ async fn add_parts( if part.typ == Viewtype::Text && part.msg.is_empty() { chat_id = Some(DC_CHAT_ID_TRASH); info!(context, "Message is a status update only (TRASH)."); + markseen_on_imap_table(context, rfc724_mid).await.ok(); } } }