diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 9cec30158..5c3b98ffc 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -7416,19 +7416,6 @@ void dc_event_unref(dc_event_t* event); /// @deprecated 2025-06-05 #define DC_STR_AEAP_ADDR_CHANGED 122 -/// "You changed your email address from %1$s to %2$s. -/// If you now send a message to a group, contacts there will automatically -/// replace the old with your new address.\n\n It's highly advised to set up -/// your old email provider to forward all emails to your new email address. -/// Otherwise you might miss messages of contacts who did not get your new -/// address yet." + the link to the AEAP blog post -/// -/// As soon as there is a post about AEAP, the UIs should add it: -/// set_stock_translation(123, getString(aeap_explanation) + "\n\n" + AEAP_BLOG_LINK) -/// -/// Used in a device message that explains AEAP. -#define DC_STR_AEAP_EXPLANATION_AND_LINK 123 - /// "You changed group name from \"%1$s\" to \"%2$s\"." /// /// `%1$s` will be replaced by the old group name. @@ -7677,12 +7664,6 @@ void dc_event_unref(dc_event_t* event); /// Used in info messages. #define DC_STR_CHAT_PROTECTION_ENABLED 170 -/// "%1$s sent a message from another device." -/// -/// Used in info messages. -/// @deprecated 2025-07 -#define DC_STR_CHAT_PROTECTION_DISABLED 171 - /// "Others will only see this group after you sent a first message." /// /// Used as the first info messages in newly created groups. diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index 159402689..325ce41f3 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -3312,10 +3312,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(), None).await?; - assert_eq!( - parsed.parts[0].msg, - stock_str::msg_group_left_remote(bob0).await - ); + assert_eq!(parsed.parts[0].msg, "I left the group."); let rcvd = bob1.recv_msg(&leave_msg).await; diff --git a/src/configure.rs b/src/configure.rs index 3d775fa96..1b439b750 100644 --- a/src/configure.rs +++ b/src/configure.rs @@ -27,7 +27,7 @@ use crate::config::{self, Config}; use crate::constants::NON_ALPHANUMERIC_WITHOUT_DOT; use crate::context::Context; use crate::imap::Imap; -use crate::log::{LogExt, warn}; +use crate::log::warn; use crate::login_param::EnteredCertificateChecks; pub use crate::login_param::EnteredLoginParam; use crate::message::Message; @@ -44,7 +44,6 @@ use crate::transport::{ }; use crate::{EventType, stock_str}; use crate::{chat, provider}; -use deltachat_contact_tools::addr_cmp; macro_rules! progress { ($context:tt, $progress:expr, $comment:expr) => { @@ -267,7 +266,7 @@ impl Context { let provider = configure(self, param).await?; self.set_config_internal(Config::NotifyAboutWrongPw, Some("1")) .await?; - on_configure_completed(self, provider, old_addr).await?; + on_configure_completed(self, provider).await?; Ok(()) } } @@ -275,7 +274,6 @@ impl Context { async fn on_configure_completed( context: &Context, provider: Option<&'static Provider>, - old_addr: Option, ) -> Result<()> { if let Some(provider) = provider { if let Some(config_defaults) = provider.config_defaults { @@ -305,20 +303,6 @@ async fn on_configure_completed( } } - if let Some(new_addr) = context.get_config(Config::ConfiguredAddr).await? - && let Some(old_addr) = old_addr - && !addr_cmp(&new_addr, &old_addr) - { - let mut msg = Message::new_text( - stock_str::aeap_explanation_and_link(context, &old_addr, &new_addr).await, - ); - chat::add_device_msg(context, None, Some(&mut msg)) - .await - .context("Cannot add AEAP explanation") - .log_err(context) - .ok(); - } - Ok(()) } diff --git a/src/contact.rs b/src/contact.rs index 673321471..183aafaf0 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1509,18 +1509,6 @@ impl Contact { &self.addr } - /// Get authorized name or address. - /// - /// This string is suitable for sending over email - /// as it does not leak the locally set name. - pub(crate) fn get_authname_or_addr(&self) -> String { - if !self.authname.is_empty() { - (&self.authname).into() - } else { - (&self.addr).into() - } - } - /// Get a summary of name and address. /// /// The returned string is either "Name (email@domain.com)" or just diff --git a/src/mimefactory.rs b/src/mimefactory.rs index 4274d8566..68271afb4 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -1521,10 +1521,9 @@ impl MimeFactory { .await? .unwrap_or_default() { - placeholdertext = Some(stock_str::msg_group_left_remote(context).await); + placeholdertext = Some("I left the group.".to_string()); } else { - placeholdertext = - Some(stock_str::msg_del_member_remote(context, email_to_remove).await); + placeholdertext = Some(format!("I removed member {email_to_remove}.")); }; if !email_to_remove.is_empty() { @@ -1547,8 +1546,7 @@ impl MimeFactory { let email_to_add = msg.param.get(Param::Arg).unwrap_or_default(); let fingerprint_to_add = msg.param.get(Param::Arg4).unwrap_or_default(); - placeholdertext = - Some(stock_str::msg_add_member_remote(context, email_to_add).await); + placeholdertext = Some(format!("I added member {email_to_add}.")); if !email_to_add.is_empty() { headers.push(( diff --git a/src/stock_str.rs b/src/stock_str.rs index e4922a735..fd9d11e7d 100644 --- a/src/stock_str.rs +++ b/src/stock_str.rs @@ -13,7 +13,7 @@ use crate::accounts::Accounts; use crate::blob::BlobObject; use crate::chat::{self, Chat, ChatId}; use crate::config::Config; -use crate::contact::{Contact, ContactId, Origin}; +use crate::contact::{Contact, ContactId}; use crate::context::Context; use crate::message::{Message, Viewtype}; use crate::param::Param; @@ -241,11 +241,6 @@ pub enum StockMessage { #[strum(props(fallback = "Not connected"))] NotConnected = 121, - #[strum(props( - fallback = "You changed your email address from %1$s to %2$s.\n\nIf you now send a message to a verified group, contacts there will automatically replace the old with your new address.\n\nIt's highly advised to set up your old email provider to forward all emails to your new email address. Otherwise you might miss messages of contacts who did not get your new address yet." - ))] - AeapExplanationAndLink = 123, - #[strum(props(fallback = "You changed group name from \"%1$s\" to \"%2$s\"."))] MsgYouChangedGrpName = 124, @@ -356,22 +351,9 @@ pub enum StockMessage { #[strum(props(fallback = "ℹ️ Account transferred to your second device."))] BackupTransferMsgBody = 163, - #[strum(props(fallback = "I added member %1$s."))] - MsgIAddMember = 164, - - #[strum(props(fallback = "I removed member %1$s."))] - MsgIDelMember = 165, - - #[strum(props(fallback = "I left the group."))] - MsgILeftGroup = 166, - #[strum(props(fallback = "Messages are end-to-end encrypted."))] ChatProtectionEnabled = 170, - // deprecated 2025-07 - #[strum(props(fallback = "%1$s sent a message from another device."))] - ChatProtectionDisabled = 171, - #[strum(props(fallback = "Others will only see this group after you sent a first message."))] NewGroupSendFirstMessage = 172, @@ -626,25 +608,6 @@ pub(crate) async fn msg_grp_img_changed(context: &Context, by_contact: ContactId } } -/// Stock string: `I added member %1$s.`. -/// This one is for sending in group chats. -/// -/// The `added_member_addr` parameter should be an email address and is looked up in the -/// contacts to combine with the authorized display name. -pub(crate) async fn msg_add_member_remote(context: &Context, added_member_addr: &str) -> String { - let addr = added_member_addr; - let whom = &match Contact::lookup_id_by_addr(context, addr, Origin::Unknown).await { - Ok(Some(contact_id)) => Contact::get_by_id(context, contact_id) - .await - .map(|contact| contact.get_authname_or_addr()) - .unwrap_or_else(|_| addr.to_string()), - _ => addr.to_string(), - }; - translated(context, StockMessage::MsgIAddMember) - .await - .replace1(whom) -} - /// Stock string: `You added member %1$s.` or `Member %1$s added by %2$s.`. /// /// The `added_member_addr` parameter should be an email address and is looked up in the @@ -671,24 +634,6 @@ pub(crate) async fn msg_add_member_local( } } -/// Stock string: `I removed member %1$s.`. -/// -/// The `removed_member_addr` parameter should be an email address and is looked up in -/// the contacts to combine with the display name. -pub(crate) async fn msg_del_member_remote(context: &Context, removed_member_addr: &str) -> String { - let addr = removed_member_addr; - let whom = &match Contact::lookup_id_by_addr(context, addr, Origin::Unknown).await { - Ok(Some(contact_id)) => Contact::get_by_id(context, contact_id) - .await - .map(|contact| contact.get_authname_or_addr()) - .unwrap_or_else(|_| addr.to_string()), - _ => addr.to_string(), - }; - translated(context, StockMessage::MsgIDelMember) - .await - .replace1(whom) -} - /// Stock string: `I added member %1$s.` or `Member %1$s removed by %2$s.`. /// /// The `removed_member_addr` parameter should be an email address and is looked up in @@ -715,11 +660,6 @@ pub(crate) async fn msg_del_member_local( } } -/// Stock string: `I left the group.`. -pub(crate) async fn msg_group_left_remote(context: &Context) -> String { - translated(context, StockMessage::MsgILeftGroup).await -} - /// Stock string: `You left the group.` or `Group left by %1$s.`. pub(crate) async fn msg_group_left_local(context: &Context, by_contact: ContactId) -> String { if by_contact == ContactId::SELF { @@ -1293,17 +1233,6 @@ pub(crate) async fn stats_msg_body(context: &Context) -> String { translated(context, StockMessage::StatsMsgBody).await } -pub(crate) async fn aeap_explanation_and_link( - context: &Context, - old_addr: &str, - new_addr: &str, -) -> String { - translated(context, StockMessage::AeapExplanationAndLink) - .await - .replace1(old_addr) - .replace2(new_addr) -} - /// Stock string: `Others will only see this group after you sent a first message.`. pub(crate) async fn new_group_send_first_message(context: &Context) -> String { translated(context, StockMessage::NewGroupSendFirstMessage).await diff --git a/src/stock_str/stock_str_tests.rs b/src/stock_str/stock_str_tests.rs index 509724721..8af98be53 100644 --- a/src/stock_str/stock_str_tests.rs +++ b/src/stock_str/stock_str_tests.rs @@ -75,10 +75,6 @@ async fn test_stock_system_msg_add_member_by_me() { let alice_contact_id = Contact::create(&t, "Alice", "alice@example.org") .await .expect("failed to create contact"); - assert_eq!( - msg_add_member_remote(&t, "alice@example.org").await, - "I added member alice@example.org." - ); assert_eq!( msg_add_member_local(&t, alice_contact_id, ContactId::SELF).await, "You added member Alice." @@ -91,10 +87,6 @@ async fn test_stock_system_msg_add_member_by_me_with_displayname() { let alice_contact_id = Contact::create(&t, "Alice", "alice@example.org") .await .expect("failed to create contact"); - assert_eq!( - msg_add_member_remote(&t, "alice@example.org").await, - "I added member alice@example.org." - ); assert_eq!( msg_add_member_local(&t, alice_contact_id, ContactId::SELF).await, "You added member Alice."