mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
feat: Don't mark MDNs as IMAP-seen
Marking MDNs as seen is useless, they shouldn't be displayed by any MUA.
This commit is contained in:
@@ -70,11 +70,10 @@ def test_markseen_message_and_mdn(acfactory, direct_imap):
|
|||||||
|
|
||||||
rex = re.compile("Marked messages [0-9]+ in folder INBOX as seen.")
|
rex = re.compile("Marked messages [0-9]+ in folder INBOX as seen.")
|
||||||
|
|
||||||
for ac in ac1, ac2:
|
while True:
|
||||||
while True:
|
event = ac2.wait_for_event()
|
||||||
event = ac.wait_for_event()
|
if event.kind == EventType.INFO and rex.search(event.msg):
|
||||||
if event.kind == EventType.INFO and rex.search(event.msg):
|
break
|
||||||
break
|
|
||||||
|
|
||||||
ac1_direct_imap = direct_imap(ac1)
|
ac1_direct_imap = direct_imap(ac1)
|
||||||
ac2_direct_imap = direct_imap(ac2)
|
ac2_direct_imap = direct_imap(ac2)
|
||||||
@@ -82,8 +81,8 @@ def test_markseen_message_and_mdn(acfactory, direct_imap):
|
|||||||
ac1_direct_imap.select_folder("INBOX")
|
ac1_direct_imap.select_folder("INBOX")
|
||||||
ac2_direct_imap.select_folder("INBOX")
|
ac2_direct_imap.select_folder("INBOX")
|
||||||
|
|
||||||
# Check that the mdn is marked as seen
|
# Check that the mdn isn't marked as seen
|
||||||
assert len(list(ac1_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1
|
assert len(list(ac1_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 0
|
||||||
# Check original message is marked as seen
|
# Check original message is marked as seen
|
||||||
assert len(list(ac2_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1
|
assert len(list(ac2_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1
|
||||||
|
|
||||||
|
|||||||
@@ -422,9 +422,6 @@ def test_send_and_receive_message_markseen(acfactory, lp):
|
|||||||
assert ev.data2 > dc.const.DC_MSG_ID_LAST_SPECIAL
|
assert ev.data2 > dc.const.DC_MSG_ID_LAST_SPECIAL
|
||||||
lp.step("2")
|
lp.step("2")
|
||||||
|
|
||||||
# Check that ac1 marks the read receipt as read.
|
|
||||||
ac1._evtracker.get_info_contains("Marked messages .* in folder INBOX as seen.")
|
|
||||||
|
|
||||||
assert msg1.is_out_mdn_received()
|
assert msg1.is_out_mdn_received()
|
||||||
assert msg3.is_out_mdn_received()
|
assert msg3.is_out_mdn_received()
|
||||||
|
|
||||||
@@ -513,6 +510,9 @@ def test_mdn_asymmetric(acfactory, lp):
|
|||||||
|
|
||||||
assert len(chat.get_messages()) == 1 + E2EE_INFO_MSGS
|
assert len(chat.get_messages()) == 1 + E2EE_INFO_MSGS
|
||||||
|
|
||||||
|
# Wait for the message to be marked as seen on IMAP.
|
||||||
|
ac1._evtracker.get_info_contains("Marked messages [0-9]+ in folder DeltaChat as seen.")
|
||||||
|
|
||||||
lp.sec("disable ac1 MDNs")
|
lp.sec("disable ac1 MDNs")
|
||||||
ac1.set_config("mdns_enabled", "0")
|
ac1.set_config("mdns_enabled", "0")
|
||||||
|
|
||||||
@@ -524,13 +524,14 @@ def test_mdn_asymmetric(acfactory, lp):
|
|||||||
lp.sec("ac2: mark incoming message as seen")
|
lp.sec("ac2: mark incoming message as seen")
|
||||||
ac2.mark_seen_messages([msg])
|
ac2.mark_seen_messages([msg])
|
||||||
|
|
||||||
|
# Wait for the message to be marked as seen on IMAP.
|
||||||
|
ac2._evtracker.get_info_contains("Marked messages [0-9]+ in folder INBOX as seen.")
|
||||||
|
|
||||||
lp.sec("ac1: waiting for incoming activity")
|
lp.sec("ac1: waiting for incoming activity")
|
||||||
assert len(chat.get_messages()) == 1 + E2EE_INFO_MSGS
|
assert len(chat.get_messages()) == 1 + E2EE_INFO_MSGS
|
||||||
|
|
||||||
# Wait for the message to be marked as seen on IMAP.
|
|
||||||
ac1._evtracker.get_info_contains("Marked messages [0-9]+ in folder INBOX as seen.")
|
|
||||||
|
|
||||||
# MDN is received even though MDNs are already disabled
|
# MDN is received even though MDNs are already disabled
|
||||||
|
ac1._evtracker.get_matching("DC_EVENT_MSG_READ")
|
||||||
assert msg_out.is_out_mdn_received()
|
assert msg_out.is_out_mdn_received()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -930,11 +930,6 @@ UPDATE config SET value=? WHERE keyname='configured_addr' AND value!=?1
|
|||||||
.await?;
|
.await?;
|
||||||
context.scheduler.interrupt_inbox().await;
|
context.scheduler.interrupt_inbox().await;
|
||||||
}
|
}
|
||||||
if target.is_none() && !mime_parser.mdn_reports.is_empty() && mime_parser.has_chat_version()
|
|
||||||
{
|
|
||||||
// This is a Delta Chat MDN. Mark as read.
|
|
||||||
markseen_on_imap_table(context, rfc724_mid_orig).await?;
|
|
||||||
}
|
|
||||||
if !mime_parser.incoming && !context.get_config_bool(Config::TeamProfile).await? {
|
if !mime_parser.incoming && !context.get_config_bool(Config::TeamProfile).await? {
|
||||||
let mut updated_chats = BTreeMap::new();
|
let mut updated_chats = BTreeMap::new();
|
||||||
let mut archived_chats_maybe_noticed = false;
|
let mut archived_chats_maybe_noticed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user