mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
fix: Set proper placeholder texts for system messages (#7953)
Don't use first-person form in placeholder texts, as these can be misleading when broadcasted to group. Additionally ensures that broadcasted system messages are not localized to not leak locally-set language to the group chat. Fixes #7930 Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
5f84be718a
commit
abb93cd79d
@@ -1416,9 +1416,9 @@ impl MimeFactory {
|
||||
.await?
|
||||
.unwrap_or_default()
|
||||
{
|
||||
placeholdertext = Some("I left the group.".to_string());
|
||||
placeholdertext = Some(format!("{email_to_remove} left the group."));
|
||||
} else {
|
||||
placeholdertext = Some(format!("I removed member {email_to_remove}."));
|
||||
placeholdertext = Some(format!("Member {email_to_remove} was removed."));
|
||||
};
|
||||
|
||||
if !email_to_remove.is_empty() {
|
||||
@@ -1441,7 +1441,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(format!("I added member {email_to_add}."));
|
||||
placeholdertext = Some(format!("Member {email_to_add} was added."));
|
||||
|
||||
if !email_to_add.is_empty() {
|
||||
headers.push((
|
||||
@@ -1466,6 +1466,7 @@ impl MimeFactory {
|
||||
}
|
||||
}
|
||||
SystemMessage::GroupNameChanged => {
|
||||
placeholdertext = Some("Group name changed.".to_string());
|
||||
let old_name = msg.param.get(Param::Arg).unwrap_or_default().to_string();
|
||||
headers.push((
|
||||
"Chat-Group-Name-Changed",
|
||||
@@ -1482,6 +1483,7 @@ impl MimeFactory {
|
||||
));
|
||||
}
|
||||
SystemMessage::GroupImageChanged => {
|
||||
placeholdertext = Some("Group image changed.".to_string());
|
||||
headers.push((
|
||||
"Chat-Content",
|
||||
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
|
||||
@@ -1493,7 +1495,24 @@ impl MimeFactory {
|
||||
));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
SystemMessage::Unknown => {}
|
||||
SystemMessage::AutocryptSetupMessage => {}
|
||||
SystemMessage::SecurejoinMessage => {}
|
||||
SystemMessage::LocationStreamingEnabled => {}
|
||||
SystemMessage::LocationOnly => {}
|
||||
SystemMessage::EphemeralTimerChanged => {}
|
||||
SystemMessage::ChatProtectionEnabled => {}
|
||||
SystemMessage::ChatProtectionDisabled => {}
|
||||
SystemMessage::InvalidUnencryptedMail => {}
|
||||
SystemMessage::SecurejoinWait => {}
|
||||
SystemMessage::SecurejoinWaitTimeout => {}
|
||||
SystemMessage::MultiDeviceSync => {}
|
||||
SystemMessage::WebxdcStatusUpdate => {}
|
||||
SystemMessage::WebxdcInfoMessage => {}
|
||||
SystemMessage::IrohNodeAddr => {}
|
||||
SystemMessage::ChatE2ee => {}
|
||||
SystemMessage::CallAccepted => {}
|
||||
SystemMessage::CallEnded => {}
|
||||
}
|
||||
|
||||
if command == SystemMessage::GroupDescriptionChanged
|
||||
|
||||
Reference in New Issue
Block a user