Include emoji as plain text in desktop notifications

(imported from commit 26c76ae3420c02b677bcacc4dd0a05797f4f8541)
This commit is contained in:
Jeff Arnold
2013-07-22 16:21:34 -04:00
parent 5190a9692a
commit e35cebd821

View File

@@ -167,13 +167,18 @@ function in_browser_notify(message, title, content) {
}
function process_notification(notification) {
var i, notification_object, key;
var i, notification_object, key, content, other_recipients;
var message = notification.message;
var title = message.sender_full_name;
var content = $('<div/>').html(message.content).text();
var other_recipients;
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") {
key = message.display_reply_to;
other_recipients = message.display_reply_to;