mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
feat: do not reveal sender's language in read receipts (#5802)
while adapting strings for the recent change about read receipts, https://github.com/deltachat/deltachat-core-rust/pull/5712 , it turns out in discussions eg. at https://github.com/deltachat/deltachat-android/issues/3179 that untranslated english for the read receipts seem to be sufficient or even better: - do not reveal the sender's language - unexpected languages are confusing - even if you chat in english, you may get Chinese read receipts - many clients do not show the text anyways, iirc, eg. Outlook display the read receipts in context, and Delta Chat of course as well - afaik, we're leaving comparable `multipart/report` untranslated as well (sync, but also webxdc updates are practically english only) - less code, fewer translations needed :)
This commit is contained in:
@@ -6650,6 +6650,8 @@ void dc_event_unref(dc_event_t* event);
|
||||
/// "Message opened"
|
||||
///
|
||||
/// Used in subjects of outgoing read receipts.
|
||||
///
|
||||
/// @deprecated Deprecated 2024-07-26
|
||||
#define DC_STR_READRCPT 31
|
||||
|
||||
/// "The message '%1$s' you sent was displayed on the screen of the recipient."
|
||||
@@ -6657,7 +6659,7 @@ void dc_event_unref(dc_event_t* event);
|
||||
/// Used as message text of outgoing read receipts.
|
||||
/// - %1$s will be replaced by the subject of the displayed message
|
||||
///
|
||||
/// @deprecated Deprecated 2024-06-23, use DC_STR_READRCPT_MAILBODY2 instead.
|
||||
/// @deprecated Deprecated 2024-06-23
|
||||
#define DC_STR_READRCPT_MAILBODY 32
|
||||
|
||||
/// @deprecated Deprecated, this string is no longer needed.
|
||||
@@ -7376,11 +7378,6 @@ void dc_event_unref(dc_event_t* event);
|
||||
/// Used as info message.
|
||||
#define DC_STR_SECUREJOIN_WAIT_TIMEOUT 191
|
||||
|
||||
/// "The message is a receipt notification."
|
||||
///
|
||||
/// Used as message text of outgoing read receipts.
|
||||
#define DC_STR_READRCPT_MAILBODY2 192
|
||||
|
||||
/// "Contact". Deprecated, currently unused.
|
||||
#define DC_STR_CONTACT 200
|
||||
|
||||
|
||||
@@ -267,7 +267,6 @@ module.exports = {
|
||||
DC_STR_REACTED_BY: 177,
|
||||
DC_STR_READRCPT: 31,
|
||||
DC_STR_READRCPT_MAILBODY: 32,
|
||||
DC_STR_READRCPT_MAILBODY2: 192,
|
||||
DC_STR_REMOVE_MEMBER_BY_OTHER: 131,
|
||||
DC_STR_REMOVE_MEMBER_BY_YOU: 130,
|
||||
DC_STR_REPLY_NOUN: 90,
|
||||
|
||||
@@ -267,7 +267,6 @@ export enum C {
|
||||
DC_STR_REACTED_BY = 177,
|
||||
DC_STR_READRCPT = 31,
|
||||
DC_STR_READRCPT_MAILBODY = 32,
|
||||
DC_STR_READRCPT_MAILBODY2 = 192,
|
||||
DC_STR_REMOVE_MEMBER_BY_OTHER = 131,
|
||||
DC_STR_REMOVE_MEMBER_BY_YOU = 130,
|
||||
DC_STR_REPLY_NOUN = 90,
|
||||
|
||||
@@ -454,7 +454,7 @@ impl MimeFactory {
|
||||
};
|
||||
stock_str::subject_for_new_contact(context, self_name).await
|
||||
}
|
||||
Loaded::Mdn { .. } => stock_str::read_rcpt(context).await,
|
||||
Loaded::Mdn { .. } => "Receipt Notification".to_string(), // untranslated to no reveal sender's language
|
||||
};
|
||||
|
||||
Ok(subject)
|
||||
@@ -672,7 +672,7 @@ impl MimeFactory {
|
||||
})
|
||||
}
|
||||
}
|
||||
Loaded::Mdn { .. } => self.render_mdn(context).await?,
|
||||
Loaded::Mdn { .. } => self.render_mdn()?,
|
||||
};
|
||||
|
||||
let get_content_type_directives_header = || {
|
||||
@@ -1400,7 +1400,7 @@ impl MimeFactory {
|
||||
}
|
||||
|
||||
/// Render an MDN
|
||||
async fn render_mdn(&mut self, context: &Context) -> Result<PartBuilder> {
|
||||
fn render_mdn(&mut self) -> Result<PartBuilder> {
|
||||
// RFC 6522, this also requires the `report-type` parameter which is equal
|
||||
// to the MIME subtype of the second body part of the multipart/report
|
||||
//
|
||||
@@ -1426,16 +1426,15 @@ impl MimeFactory {
|
||||
"multipart/report; report-type=disposition-notification".to_string(),
|
||||
));
|
||||
|
||||
// first body part: always human-readable, always REQUIRED by RFC 6522
|
||||
let message_text = format!(
|
||||
"{}\r\n",
|
||||
format_flowed(&stock_str::read_rcpt_mail_body(context).await)
|
||||
);
|
||||
// first body part: always human-readable, always REQUIRED by RFC 6522.
|
||||
// untranslated to no reveal sender's language.
|
||||
// moreover, translations in unknown languages are confusing, and clients may not display them at all
|
||||
let text_part = PartBuilder::new().header((
|
||||
"Content-Type".to_string(),
|
||||
"text/plain; charset=utf-8; format=flowed; delsp=no".to_string(),
|
||||
));
|
||||
let text_part = self.add_message_text(text_part, message_text);
|
||||
let text_part =
|
||||
self.add_message_text(text_part, "This is a receipt notification.\r\n".to_string());
|
||||
message = message.child(text_part.build());
|
||||
|
||||
// second body part: machine-readable, always REQUIRED by RFC 6522
|
||||
|
||||
@@ -80,9 +80,6 @@ pub enum StockMessage {
|
||||
#[strum(props(fallback = "Fingerprints"))]
|
||||
FingerPrints = 30,
|
||||
|
||||
#[strum(props(fallback = "Return receipt"))]
|
||||
ReadRcpt = 31,
|
||||
|
||||
#[strum(props(fallback = "End-to-end encryption preferred"))]
|
||||
E2ePreferred = 34,
|
||||
|
||||
@@ -440,9 +437,6 @@ pub enum StockMessage {
|
||||
fallback = "Could not yet establish guaranteed end-to-end encryption, but you may already send a message."
|
||||
))]
|
||||
SecurejoinWaitTimeout = 191,
|
||||
|
||||
#[strum(props(fallback = "This message is a receipt notification."))]
|
||||
ReadRcptMailBody = 192,
|
||||
}
|
||||
|
||||
impl StockMessage {
|
||||
@@ -795,16 +789,6 @@ pub(crate) async fn finger_prints(context: &Context) -> String {
|
||||
translated(context, StockMessage::FingerPrints).await
|
||||
}
|
||||
|
||||
/// Stock string: `Return receipt`.
|
||||
pub(crate) async fn read_rcpt(context: &Context) -> String {
|
||||
translated(context, StockMessage::ReadRcpt).await
|
||||
}
|
||||
|
||||
/// Stock string: `This message is a receipt notification.`.
|
||||
pub(crate) async fn read_rcpt_mail_body(context: &Context) -> String {
|
||||
translated(context, StockMessage::ReadRcptMailBody).await
|
||||
}
|
||||
|
||||
/// Stock string: `Group image deleted.`.
|
||||
pub(crate) async fn msg_grp_img_deleted(context: &Context, by_contact: ContactId) -> String {
|
||||
if by_contact == ContactId::SELF {
|
||||
|
||||
Reference in New Issue
Block a user