Browse Source

Element.io (new Riot.im) - Unread badge count doesn't work.

fixes https://github.com/ramboxapp/community-edition/issues/2766
pull/2841/head
Vulich Fernando 5 years ago committed by GitHub
parent
commit
c54f688062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      api/services.json

2
api/services.json

@ -248,7 +248,7 @@
"type": "messaging", "type": "messaging",
"allow_popups": false, "allow_popups": false,
"manual_notifications": false, "manual_notifications": false,
"js_unread": "function checkUnread(){var a=document.getElementsByClassName(\"mx_RoomTile_nameContainer\"),b=0;for(i=0;i<a.length;i++){var c=a[i].getElementsByClassName(\"mx_RoomTile_badge\");for(ii=0;ii<c.length;ii++)parseInt(c[ii].textContent.trim())%1===0&&(b+=parseInt(c[ii].textContent.trim()))}updateBadge(b)}function updateBadge(a){a>=1?document.title=\"(\"+a+\") \"+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,1e3);", "js_unread": "function checkUnread(){e=0,document.querySelectorAll(\".mx_RoomSublist2_stickable\").forEach(t=>t.querySelector(\".mx_NotificationBadge_count\")&&parseInt(t.querySelector(\".mx_NotificationBadge_count\").innerText)&&(e+=parseInt(t.querySelector(\".mx_NotificationBadge_count\").innerText))),updateBadge(e)}function updateBadge(e){e&&e>=1?rambox.setUnreadCount(e):rambox.clearUnreadCount()}setInterval(checkUnread,3e3);",
"userAgent": "", "userAgent": "",
"note": "", "note": "",
"titleBlink": false, "titleBlink": false,

Loading…
Cancel
Save