fix: request MDNs for resent channel messages

This commit is contained in:
link2xt
2026-06-16 14:49:49 +00:00
committed by l
parent d39b79f6fc
commit b860583f8d
2 changed files with 5 additions and 8 deletions
+1
View File
@@ -3071,6 +3071,7 @@ async fn test_broadcast_resend_to_new_member() -> Result<()> {
let fiona_msg = fiona.recv_msg(&resent_msg).await; let fiona_msg = fiona.recv_msg(&resent_msg).await;
assert_eq!(fiona_msg.chat_id, fiona_bc_id); assert_eq!(fiona_msg.chat_id, fiona_bc_id);
assert_eq!(fiona_msg.text, (i + 1).to_string()); 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("fiona@example.net"));
assert!(!resent_msg.recipients.contains("bob@")); assert!(!resent_msg.recipients.contains("bob@"));
// The message is undecryptable for Bob, he mustn't be able to know yet that somebody joined // The message is undecryptable for Bob, he mustn't be able to know yet that somebody joined
+4 -8
View File
@@ -221,7 +221,10 @@ impl MimeFactory {
let mut member_fingerprints = Vec::new(); let mut member_fingerprints = Vec::new();
let mut member_timestamps = Vec::new(); let mut member_timestamps = Vec::new();
let mut recipient_ids = HashSet::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; let encryption_pubkeys;
@@ -478,13 +481,6 @@ impl MimeFactory {
ContactId::scaleup_origin(context, &recipient_ids, origin).await?; 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 { encryption_pubkeys = if !is_encrypted {
None None
} else if should_encrypt_symmetrically(&msg, &chat) { } else if should_encrypt_symmetrically(&msg, &chat) {