Skip to content

Commit 40058de

Browse files
committed
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.
1 parent d2f33f5 commit 40058de

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/mimeparser.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,14 +960,16 @@ impl MimeMessage {
960960
self.parse_attachments();
961961

962962
// See if an MDN is requested from the other side
963+
let mut wants_mdn = false;
963964
if !self.decrypting_failed
964-
&& !self.parts.is_empty()
965+
&& (!self.parts.is_empty() || matches!(&self.pre_message, PreMessageMode::Pre { .. }))
965966
&& let Some(ref dn_to) = self.chat_disposition_notification_to
966967
{
967968
// Check that the message is not outgoing.
968969
let from = &self.from.addr;
969970
if !context.is_self_addr(from).await? {
970971
if from.to_lowercase() == dn_to.addr.to_lowercase() {
972+
wants_mdn = true;
971973
if let Some(part) = self.parts.last_mut() {
972974
part.param.set_int(Param::WantsMdn, 1);
973975
}
@@ -989,7 +991,9 @@ impl MimeMessage {
989991
typ: Viewtype::Text,
990992
..Default::default()
991993
};
992-
994+
if wants_mdn {
995+
part.param.set_int(Param::WantsMdn, 1);
996+
}
993997
if let Some(ref subject) = self.get_subject()
994998
&& !self.has_chat_version()
995999
&& self.webxdc_status_update.is_none()

0 commit comments

Comments
 (0)