From eada83aea4bfc0d522e738d3f95c7eec33758793 Mon Sep 17 00:00:00 2001 From: really-need-an-api-key Date: Fri, 12 Oct 2018 16:47:48 +0200 Subject: [PATCH] Get rid of replace() in notification. --- www/js/callbacks.js | 2 +- www/js/util.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/callbacks.js b/www/js/callbacks.js index 960f084e..e8d7d044 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -489,7 +489,7 @@ Callbacks = { } if (ping) { - pingMessage(true, "PM: " + name, msg.last().text()); + pingMessage(true, "PM: " + name, $(msg.children()[2]).text()); } }, diff --git a/www/js/util.js b/www/js/util.js index 22857b39..5a143361 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -1662,7 +1662,7 @@ function addChatMessage(data) { } } - pingMessage(isHighlight, data.username, div.text()); + pingMessage(isHighlight, data.username, $(div.children()[2]).text()); } function trimChatBuffer() { @@ -1698,7 +1698,7 @@ function pingMessage(isHighlight, notificationTitle, notificationBody) { if (USEROPTS.notifications === "always" || (USEROPTS.notifications === "onlyping" && isHighlight)) { - showDesktopNotification(notificationTitle, notificationBody.replace(/\[[^\]]+\]/g, '')); + showDesktopNotification(notificationTitle, notificationBody); } } }