follow link2xt review comments

This commit is contained in:
holger krekel
2026-08-04 11:47:26 +02:00
parent ba35814d34
commit 15387690c8
4 changed files with 5 additions and 28 deletions
+1 -6
View File
@@ -10,9 +10,7 @@ use std::time::Duration;
use anyhow::{Context as _, Result, anyhow, bail, ensure}; use anyhow::{Context as _, Result, anyhow, bail, ensure};
use chrono::TimeZone; use chrono::TimeZone;
use deltachat_contact_tools::{ use deltachat_contact_tools::{ContactAddress, sanitize_bidi_characters, sanitize_single_line};
ContactAddress, addr_cmp, sanitize_bidi_characters, sanitize_single_line,
};
use humansize::{BINARY, format_size}; use humansize::{BINARY, format_size};
use mail_builder::mime::MimePart; use mail_builder::mime::MimePart;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@@ -2853,9 +2851,6 @@ pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -
let attach_selfavatar = mimefactory.attach_selfavatar; let attach_selfavatar = mimefactory.attach_selfavatar;
let mut recipients = mimefactory.recipients(); let mut recipients = mimefactory.recipients();
let self_addrs = context.get_all_self_addrs().await?;
recipients.retain(|x| !self_addrs.iter().any(|a| addr_cmp(a, x)));
// Default Webxdc integrations are hidden messages and must not be sent out: // Default Webxdc integrations are hidden messages and must not be sent out:
if (msg.param.get_int(Param::WebxdcIntegration).is_some() && msg.hidden) if (msg.param.get_int(Param::WebxdcIntegration).is_some() && msg.hidden)
// This may happen eg. for groups with only SELF and bcc_self disabled: // This may happen eg. for groups with only SELF and bcc_self disabled:
+1 -1
View File
@@ -3957,7 +3957,7 @@ async fn test_leave_broadcast_multidevice() -> Result<()> {
let leave_msg = bob0.pop_sent_msg().await; let leave_msg = bob0.pop_sent_msg().await;
let parsed = MimeMessage::from_bytes(bob1, leave_msg.payload().as_bytes()).await?; let parsed = MimeMessage::from_bytes(bob1, leave_msg.payload().as_bytes()).await?;
assert_eq!(parsed.parts[0].msg, "bob@example.net left the group."); assert_eq!(parsed.parts[0].msg, "Member bob@example.net was removed.");
let rcvd = bob1.recv_msg(&leave_msg).await; let rcvd = bob1.recv_msg(&leave_msg).await;
+3 -5
View File
@@ -1421,11 +1421,9 @@ impl MimeFactory {
let email_to_remove = msg.param.get(Param::Arg).unwrap_or_default(); let email_to_remove = msg.param.get(Param::Arg).unwrap_or_default();
let fingerprint_to_remove = msg.param.get(Param::Arg4).unwrap_or_default(); let fingerprint_to_remove = msg.param.get(Param::Arg4).unwrap_or_default();
if context.is_self_addr(email_to_remove).await? { // Only visible in classic email clients,
placeholdertext = Some(format!("{email_to_remove} left the group.")); // Delta Chat renders removals from the headers.
} else { placeholdertext = Some(format!("Member {email_to_remove} was removed."));
placeholdertext = Some(format!("Member {email_to_remove} was removed."));
};
if !email_to_remove.is_empty() { if !email_to_remove.is_empty() {
headers.push(( headers.push((
-16
View File
@@ -747,22 +747,6 @@ async fn test_remove_member_bcc() -> Result<()> {
} }
} }
// A member whose address became a secondary self address is treated
// as ourselves on removal and rendered as "left the group".
let secondary_self_addr = "alice@second.example";
let secondary_self_id = crate::contact::Contact::create(alice, "", secondary_self_addr).await?;
add_contact_to_chat(alice, alice_chat_id, secondary_self_id).await?;
alice.pop_sent_msg().await;
crate::transport::add_pseudo_transport(alice, secondary_self_addr).await?;
remove_contact_from_chat(alice, alice_chat_id, secondary_self_id).await?;
let remove = alice.pop_sent_msg().await;
assert!(
remove
.payload()
.contains("alice@second.example left the group.")
);
assert!(!remove.payload().contains("was removed"));
Ok(()) Ok(())
} }