mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
Include emoji as plain text in desktop notifications
(imported from commit 26c76ae3420c02b677bcacc4dd0a05797f4f8541)
This commit is contained in:
@@ -167,13 +167,18 @@ function in_browser_notify(message, title, content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function process_notification(notification) {
|
function process_notification(notification) {
|
||||||
var i, notification_object, key;
|
var i, notification_object, key, content, other_recipients;
|
||||||
var message = notification.message;
|
var message = notification.message;
|
||||||
var title = message.sender_full_name;
|
var title = message.sender_full_name;
|
||||||
var content = $('<div/>').html(message.content).text();
|
|
||||||
var other_recipients;
|
|
||||||
var msg_count = 1;
|
var msg_count = 1;
|
||||||
|
|
||||||
|
// Convert the content to plain text, replacing emoji with their alt text
|
||||||
|
content = $('<div/>').html(message.content);
|
||||||
|
content.find(".emoji").replaceWith(function () {
|
||||||
|
return $(this).attr("alt");
|
||||||
|
});
|
||||||
|
content = content.text();
|
||||||
|
|
||||||
if (message.type === "private") {
|
if (message.type === "private") {
|
||||||
key = message.display_reply_to;
|
key = message.display_reply_to;
|
||||||
other_recipients = message.display_reply_to;
|
other_recipients = message.display_reply_to;
|
||||||
|
|||||||
Reference in New Issue
Block a user