Skip to content

Commit c70705d

Browse files
committed
fix: Make pre-messages w/o text want MDNs (#8004)
This fixes 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 b915832 commit c70705d

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
@@ -948,14 +948,16 @@ impl MimeMessage {
948948
self.parse_attachments();
949949

950950
// See if an MDN is requested from the other side
951+
let mut wants_mdn = false;
951952
if self.decryption_error.is_none()
952-
&& !self.parts.is_empty()
953+
&& (!self.parts.is_empty() || matches!(&self.pre_message, PreMessageMode::Pre { .. }))
953954
&& let Some(ref dn_to) = self.chat_disposition_notification_to
954955
{
955956
// Check that the message is not outgoing.
956957
let from = &self.from.addr;
957958
if !context.is_self_addr(from).await? {
958959
if from.to_lowercase() == dn_to.addr.to_lowercase() {
960+
wants_mdn = true;
959961
if let Some(part) = self.parts.last_mut() {
960962
part.param.set_int(Param::WantsMdn, 1);
961963
}
@@ -977,7 +979,9 @@ impl MimeMessage {
977979
typ: Viewtype::Text,
978980
..Default::default()
979981
};
980-
982+
if wants_mdn {
983+
part.param.set_int(Param::WantsMdn, 1);
984+
}
981985
if let Some(ref subject) = self.get_subject()
982986
&& !self.has_chat_version()
983987
&& self.webxdc_status_update.is_none()

0 commit comments

Comments
 (0)