From e35cebd8213da0fe12c84d46b504d37287ecd422 Mon Sep 17 00:00:00 2001 From: Jeff Arnold Date: Mon, 22 Jul 2013 16:21:34 -0400 Subject: [PATCH] Include emoji as plain text in desktop notifications (imported from commit 26c76ae3420c02b677bcacc4dd0a05797f4f8541) --- zephyr/static/js/notifications.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/zephyr/static/js/notifications.js b/zephyr/static/js/notifications.js index ec973368f0..5c27918f99 100644 --- a/zephyr/static/js/notifications.js +++ b/zephyr/static/js/notifications.js @@ -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 = $('
').html(message.content).text(); - var other_recipients; var msg_count = 1; + // Convert the content to plain text, replacing emoji with their alt text + content = $('
').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;