diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index e617877b1..4ccc43cc0 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -3071,6 +3071,7 @@ async fn test_broadcast_resend_to_new_member() -> Result<()> { let fiona_msg = fiona.recv_msg(&resent_msg).await; assert_eq!(fiona_msg.chat_id, fiona_bc_id); assert_eq!(fiona_msg.text, (i + 1).to_string()); + assert_eq!(fiona_msg.param.get_bool(Param::WantsMdn).unwrap(), true); assert!(resent_msg.recipients.contains("fiona@example.net")); assert!(!resent_msg.recipients.contains("bob@")); // The message is undecryptable for Bob, he mustn't be able to know yet that somebody joined diff --git a/src/mimefactory.rs b/src/mimefactory.rs index e7092df77..283713cbf 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -221,7 +221,10 @@ impl MimeFactory { let mut member_fingerprints = Vec::new(); let mut member_timestamps = Vec::new(); let mut recipient_ids = HashSet::new(); - let mut req_mdn = false; + let req_mdn = !chat.is_self_talk() + && !msg.is_system_message() + && msg.param.get_int(Param::Reaction).unwrap_or_default() == 0 + && context.should_request_mdns().await?; let encryption_pubkeys; @@ -478,13 +481,6 @@ impl MimeFactory { ContactId::scaleup_origin(context, &recipient_ids, origin).await?; } - if !msg.is_system_message() - && msg.param.get_int(Param::Reaction).unwrap_or_default() == 0 - && context.should_request_mdns().await? - { - req_mdn = true; - } - encryption_pubkeys = if !is_encrypted { None } else if should_encrypt_symmetrically(&msg, &chat) {