diff options
Diffstat (limited to 'recipes/kiwiirc')
-rw-r--r-- | recipes/kiwiirc/package.json | 2 | ||||
-rw-r--r-- | recipes/kiwiirc/webview.js | 27 |
2 files changed, 17 insertions, 12 deletions
diff --git a/recipes/kiwiirc/package.json b/recipes/kiwiirc/package.json index 9c0b7b7..1e1adfd 100644 --- a/recipes/kiwiirc/package.json +++ b/recipes/kiwiirc/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "kiwiirc", | 2 | "id": "kiwiirc", |
3 | "name": "KiwiIRC", | 3 | "name": "KiwiIRC", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://kiwiirc.com/nextclient/", | 7 | "serviceURL": "https://kiwiirc.com/nextclient/", |
diff --git a/recipes/kiwiirc/webview.js b/recipes/kiwiirc/webview.js index 0c362f0..ef6c930 100644 --- a/recipes/kiwiirc/webview.js +++ b/recipes/kiwiirc/webview.js | |||
@@ -1,28 +1,33 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
9 | // eslint-disable-next-line no-undef | 9 | // eslint-disable-next-line no-undef |
10 | const unreadChannelsCount = kiwi.state.networks.reduce((count, network) => { | 10 | const unreadChannelsCount = kiwi.state.networks.reduce((count, network) => { |
11 | // eslint-disable-next-line no-param-reassign | ||
11 | return (count += network.buffers.filter(buffer => { | 12 | return (count += network.buffers.filter(buffer => { |
12 | return !buffer.name.startsWith('*') && buffer.flags.unread !== 0; | 13 | return !buffer.name.startsWith('*') && buffer.flags.unread !== 0; |
13 | }).length); | 14 | }).length); |
14 | }, 0); | 15 | }, 0); |
15 | 16 | ||
16 | // eslint-disable-next-line no-undef | 17 | // eslint-disable-next-line no-undef |
17 | const mentionedChannelsCount = kiwi.state.networks.reduce((count, network) => { | 18 | const mentionedChannelsCount = kiwi.state.networks.reduce( |
18 | return (count += network.buffers.filter(buffer => { | 19 | (count, network) => { |
19 | return ( | 20 | // eslint-disable-next-line no-param-reassign |
20 | !buffer.name.startsWith('*') && | 21 | return (count += network.buffers.filter(buffer => { |
21 | buffer.flags.unread !== 0 && | 22 | return ( |
22 | buffer.flags.highlight | 23 | !buffer.name.startsWith('*') && |
23 | ); | 24 | buffer.flags.unread !== 0 && |
24 | }).length); | 25 | buffer.flags.highlight |
25 | }, 0); | 26 | ); |
27 | }).length); | ||
28 | }, | ||
29 | 0, | ||
30 | ); | ||
26 | 31 | ||
27 | // set Ferdium badges | 32 | // set Ferdium badges |
28 | Ferdium.setBadge(mentionedChannelsCount, unreadChannelsCount); | 33 | Ferdium.setBadge(mentionedChannelsCount, unreadChannelsCount); |