Skip to content

Commit 1ab149f

Browse files
committed
feat: Don't mark MDNs as IMAP-seen
Marking MDNs as seen is useless, they shouldn't be displayed by any MUA.
1 parent f461b8d commit 1ab149f

3 files changed

Lines changed: 13 additions & 18 deletions

File tree

deltachat-rpc-client/tests/test_folders.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,19 @@ def test_markseen_message_and_mdn(acfactory, direct_imap):
7070

7171
rex = re.compile("Marked messages [0-9]+ in folder INBOX as seen.")
7272

73-
for ac in ac1, ac2:
74-
while True:
75-
event = ac.wait_for_event()
76-
if event.kind == EventType.INFO and rex.search(event.msg):
77-
break
73+
while True:
74+
event = ac2.wait_for_event()
75+
if event.kind == EventType.INFO and rex.search(event.msg):
76+
break
7877

7978
ac1_direct_imap = direct_imap(ac1)
8079
ac2_direct_imap = direct_imap(ac2)
8180

8281
ac1_direct_imap.select_folder("INBOX")
8382
ac2_direct_imap.select_folder("INBOX")
8483

85-
# Check that the mdn is marked as seen
86-
assert len(list(ac1_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1
84+
# Check that the mdn isn't marked as seen
85+
assert len(list(ac1_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 0
8786
# Check original message is marked as seen
8887
assert len(list(ac2_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1
8988

python/tests/test_1_online.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,6 @@ def test_send_and_receive_message_markseen(acfactory, lp):
422422
assert ev.data2 > dc.const.DC_MSG_ID_LAST_SPECIAL
423423
lp.step("2")
424424

425-
# Check that ac1 marks the read receipt as read.
426-
ac1._evtracker.get_info_contains("Marked messages .* in folder INBOX as seen.")
427-
428425
assert msg1.is_out_mdn_received()
429426
assert msg3.is_out_mdn_received()
430427

@@ -513,6 +510,9 @@ def test_mdn_asymmetric(acfactory, lp):
513510

514511
assert len(chat.get_messages()) == 1 + E2EE_INFO_MSGS
515512

513+
# Wait for the message to be marked as seen on IMAP.
514+
ac1._evtracker.get_info_contains("Marked messages [0-9]+ in folder DeltaChat as seen.")
515+
516516
lp.sec("disable ac1 MDNs")
517517
ac1.set_config("mdns_enabled", "0")
518518

@@ -524,13 +524,14 @@ def test_mdn_asymmetric(acfactory, lp):
524524
lp.sec("ac2: mark incoming message as seen")
525525
ac2.mark_seen_messages([msg])
526526

527+
# Wait for the message to be marked as seen on IMAP.
528+
ac2._evtracker.get_info_contains("Marked messages [0-9]+ in folder INBOX as seen.")
529+
527530
lp.sec("ac1: waiting for incoming activity")
528531
assert len(chat.get_messages()) == 1 + E2EE_INFO_MSGS
529532

530-
# Wait for the message to be marked as seen on IMAP.
531-
ac1._evtracker.get_info_contains("Marked messages [0-9]+ in folder INBOX as seen.")
532-
533533
# MDN is received even though MDNs are already disabled
534+
ac1._evtracker.get_matching("DC_EVENT_MSG_READ")
534535
assert msg_out.is_out_mdn_received()
535536

536537

src/receive_imf.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,6 @@ UPDATE config SET value=? WHERE keyname='configured_addr' AND value!=?1
930930
.await?;
931931
context.scheduler.interrupt_inbox().await;
932932
}
933-
if target.is_none() && !mime_parser.mdn_reports.is_empty() && mime_parser.has_chat_version()
934-
{
935-
// This is a Delta Chat MDN. Mark as read.
936-
markseen_on_imap_table(context, rfc724_mid_orig).await?;
937-
}
938933
if !mime_parser.incoming && !context.get_config_bool(Config::TeamProfile).await? {
939934
let mut updated_chats = BTreeMap::new();
940935
let mut archived_chats_maybe_noticed = false;

0 commit comments

Comments
 (0)