From 40058de862624f769741a23facd20ae345ca53f5 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Sat, 21 Mar 2026 09:27:47 -0300 Subject: [PATCH] fix: Make pre-messages w/o text want MDNs (#8004) This fixes the failing `test_pre_msg_mdn_before_sending_full`. Maybe it's even good that MDNs will be sent for pre-messages only having placeholder text with the viewtype and size, at least this way we notify the contact that we've noticed the message. Anyway, with adding message previews the problem will be solved for the corresponding viewtypes. --- src/mimeparser.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 58e459eb3..72bc652b4 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -960,14 +960,16 @@ impl MimeMessage { self.parse_attachments(); // See if an MDN is requested from the other side + let mut wants_mdn = false; if !self.decrypting_failed - && !self.parts.is_empty() + && (!self.parts.is_empty() || matches!(&self.pre_message, PreMessageMode::Pre { .. })) && let Some(ref dn_to) = self.chat_disposition_notification_to { // Check that the message is not outgoing. let from = &self.from.addr; if !context.is_self_addr(from).await? { if from.to_lowercase() == dn_to.addr.to_lowercase() { + wants_mdn = true; if let Some(part) = self.parts.last_mut() { part.param.set_int(Param::WantsMdn, 1); } @@ -989,7 +991,9 @@ impl MimeMessage { typ: Viewtype::Text, ..Default::default() }; - + if wants_mdn { + part.param.set_int(Param::WantsMdn, 1); + } if let Some(ref subject) = self.get_subject() && !self.has_chat_version() && self.webxdc_status_update.is_none()