mirror of
https://github.com/chatmail/core.git
synced 2026-10-03 03:30:36 +03:00
follow link2xt review comments
This commit is contained in:
+1
-6
@@ -10,9 +10,7 @@ use std::time::Duration;
|
||||
|
||||
use anyhow::{Context as _, Result, anyhow, bail, ensure};
|
||||
use chrono::TimeZone;
|
||||
use deltachat_contact_tools::{
|
||||
ContactAddress, addr_cmp, sanitize_bidi_characters, sanitize_single_line,
|
||||
};
|
||||
use deltachat_contact_tools::{ContactAddress, sanitize_bidi_characters, sanitize_single_line};
|
||||
use humansize::{BINARY, format_size};
|
||||
use mail_builder::mime::MimePart;
|
||||
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 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:
|
||||
if (msg.param.get_int(Param::WebxdcIntegration).is_some() && msg.hidden)
|
||||
// This may happen eg. for groups with only SELF and bcc_self disabled:
|
||||
|
||||
@@ -3957,7 +3957,7 @@ async fn test_leave_broadcast_multidevice() -> Result<()> {
|
||||
|
||||
let leave_msg = bob0.pop_sent_msg().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;
|
||||
|
||||
|
||||
+3
-5
@@ -1421,11 +1421,9 @@ impl MimeFactory {
|
||||
let email_to_remove = msg.param.get(Param::Arg).unwrap_or_default();
|
||||
let fingerprint_to_remove = msg.param.get(Param::Arg4).unwrap_or_default();
|
||||
|
||||
if context.is_self_addr(email_to_remove).await? {
|
||||
placeholdertext = Some(format!("{email_to_remove} left the group."));
|
||||
} else {
|
||||
placeholdertext = Some(format!("Member {email_to_remove} was removed."));
|
||||
};
|
||||
// Only visible in classic email clients,
|
||||
// Delta Chat renders removals from the headers.
|
||||
placeholdertext = Some(format!("Member {email_to_remove} was removed."));
|
||||
|
||||
if !email_to_remove.is_empty() {
|
||||
headers.push((
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user