diff options
Diffstat (limited to 'uncompressed/element/webview.js')
-rw-r--r-- | uncompressed/element/webview.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/uncompressed/element/webview.js b/uncompressed/element/webview.js index 6201f27..58d18bb 100644 --- a/uncompressed/element/webview.js +++ b/uncompressed/element/webview.js | |||
@@ -2,17 +2,20 @@ | |||
2 | 2 | ||
3 | module.exports = Franz => { | 3 | module.exports = Franz => { |
4 | function getMessages() { | 4 | function getMessages() { |
5 | const indirect_badge = document.getElementsByClassName('mx_RoomSubList_badge'); | 5 | const badges = document.getElementsByClassName('mx_RoomSublist2_badgeContainer'); |
6 | let indirect_count = 0; | ||
7 | if (indirect_badge.length !== 0) { | ||
8 | indirect_count = indirect_badge.length; | ||
9 | } | ||
10 | 6 | ||
11 | const direct_badge = document.getElementsByClassName('mx_RoomSubList_badgeHighlight'); | 7 | // Number of messages from People |
12 | let direct_count = 0; | 8 | let direct_count = 0; |
13 | if (direct_badge.length !== 0) { | 9 | if (badges.length > 0 && badges[0].children.length > 0) { |
14 | direct_count = direct_badge.length; | 10 | direct_count = parseInt(badges[0].textContent) |
11 | } | ||
12 | |||
13 | // Number of messages from Rooms | ||
14 | let indirect_count = 0; | ||
15 | if (badges.length > 1 && badges[1].children.length > 0) { | ||
16 | indirect_count = parseInt(badges[1].textContent) | ||
15 | } | 17 | } |
18 | |||
16 | // set Franz badge | 19 | // set Franz badge |
17 | Franz.setBadge(direct_count, indirect_count); | 20 | Franz.setBadge(direct_count, indirect_count); |
18 | } | 21 | } |