diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/gitter/package.json | 2 | ||||
-rw-r--r-- | recipes/gitter/webview.js | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/recipes/gitter/package.json b/recipes/gitter/package.json index c543c09..e931b67 100644 --- a/recipes/gitter/package.json +++ b/recipes/gitter/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gitter", | 2 | "id": "gitter", |
3 | "name": "Gitter", | 3 | "name": "Gitter", |
4 | "version": "1.1.1", | 4 | "version": "1.1.2", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://gitter.im", | 7 | "serviceURL": "https://gitter.im", |
diff --git a/recipes/gitter/webview.js b/recipes/gitter/webview.js index 0026790..c4eee5b 100644 --- a/recipes/gitter/webview.js +++ b/recipes/gitter/webview.js | |||
@@ -7,13 +7,16 @@ function _interopRequireDefault(obj) { | |||
7 | module.exports = Ferdi => { | 7 | module.exports = Ferdi => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | // get unread messages | 9 | // get unread messages |
10 | let count = 0; | 10 | let directCount = 0; |
11 | for (const node of document.querySelectorAll('div.unread-indicator')) { | 11 | for (const node of document.querySelectorAll('div.unread-indicator')) { |
12 | count += Ferdi.safeParseInt(node.textContent); | 12 | directCount += Ferdi.safeParseInt(node.textContent); |
13 | } | 13 | } |
14 | 14 | ||
15 | const channelMentionCount = | ||
16 | document.querySelectorAll('.mention-indicator').length; | ||
17 | |||
15 | // set Ferdi badge | 18 | // set Ferdi badge |
16 | Ferdi.setBadge(count); | 19 | Ferdi.setBadge(directCount, channelMentionCount); |
17 | }; | 20 | }; |
18 | 21 | ||
19 | Ferdi.loop(getMessages); | 22 | Ferdi.loop(getMessages); |