notifications: Fix composebox notification escaping

The "Narrow to PM with" notification above the composebox was
double-escaped, mangling names with single quotes in them. This removes
the escaping in i18next, causing the name to be escaped only in
handlebars.
This commit is contained in:
Wesley Aptekar-Cassels
2020-11-29 21:13:36 +08:00
committed by Tim Abbott
parent e30b524896
commit 4173070b3d
2 changed files with 6 additions and 4 deletions

View File

@@ -564,19 +564,21 @@ exports.send_test_notification = function (content) {
]);
};
// Note that this returns values that are not HTML-escaped, for use in
// handlebars templates that will do further escaping.
function get_message_header(message) {
if (message.type === "stream") {
return message.stream + " > " + message.topic;
}
if (message.display_recipient.length > 2) {
return i18n.t("group private messages with __recipient__", {
return i18n.t("group private messages with __- recipient__", {
recipient: message.display_reply_to,
});
}
if (people.is_current_user(message.reply_to)) {
return i18n.t("private messages with yourself");
}
return i18n.t("private messages with __recipient__", {recipient: message.display_reply_to});
return i18n.t("private messages with __- recipient__", {recipient: message.display_reply_to});
}
exports.get_local_notify_mix_reason = function (message) {

View File

@@ -140,8 +140,8 @@ IGNORED_PHRASES = [
r"\bN\b",
# Capital c feels obtrusive in clear status option
r"clear",
r"group private messages with __recipient__",
r"private messages with __recipient__",
r"group private messages with __- recipient__",
r"private messages with __- recipient__",
r"private messages with yourself",
# TO CLEAN UP
# Just want to avoid churning login.html right now