From ab8ccd715129c741e27d10f8effa8d6138ddb19a Mon Sep 17 00:00:00 2001 From: Simon Sassi Date: Sun, 16 Sep 2018 17:20:28 +0200 Subject: [PATCH] Changed js_unread function for service discord In order to be functional, it will count only the unread dms messages --- app/store/ServicesList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 598f8374..7292772e 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -181,8 +181,8 @@ Ext.define('Rambox.store.ServicesList', { ,url: 'https://discordapp.com/login' ,type: 'messaging' ,titleBlink: true - ,js_unread: 'function getAlertCount(badges) {var alerts = 0;for(var i = 0; i 0) {var count = parseInt(badge.childNodes[0].nodeValue, 10);alerts += count.isNaN? 1: count;} else {alerts++;}}return alerts;}function checkUnread() {var direct = 0,indirect = document.querySelectorAll(\'.guilds-wrapper .unread\').length,guildDirect = document.querySelectorAll(\'.guilds-wrapper .badge\'),channelDirect = document.querySelectorAll(\'[class^="nameUnreadText-"]+div>div>div\');direct += getAlertCount(guildDirect);direct += getAlertCount(channelDirect);indirect += document.querySelectorAll(\'[class^="nameUnreadText-"]\').length;updateBadge(indirect, direct);}function updateBadge(ind, dir) { var n = dir > 0 ? "(" + dir + ") ": ind > 0? "(•) ": "";document.title = n + originalTitle;}var originalTitle = document.title;setInterval(checkUnread, 3e3);' - ,note: 'To enable desktop notifications, you have to go to Options inside Discord.' + ,js_unread: 'function getAlertCount(e){for(var t=0,a=0;a