feat: Don't send SystemMessage::GroupNameChanged in unencrypted groups

Unencrypted groups are usually ones with other MUAs which don't understand Delta Chat system
messages and show them as weird emails.
This commit is contained in:
iequidoo
2025-06-23 13:29:39 -03:00
parent 919b44fb3e
commit 3627027236
2 changed files with 46 additions and 4 deletions

View File

@@ -4235,11 +4235,16 @@ async fn rename_ex(
(new_name.to_string(), chat_id),
)
.await?;
if chat.is_promoted()
&& !chat.is_mailing_list()
&& chat.typ != Chattype::Broadcast
&& sanitize_single_line(&chat.name) != new_name
if !chat.is_promoted()
|| chat.is_mailing_list()
|| chat.typ == Chattype::Broadcast
|| sanitize_single_line(&chat.name) == new_name
{
} else if chat.grpid.is_empty() {
chat_id
.update_timestamp(context, Param::GroupNameTimestamp, smeared_time(context))
.await?;
} else {
msg.viewtype = Viewtype::Text;
msg.text =
stock_str::msg_grp_name(context, &chat.name, &new_name, ContactId::SELF).await;