diff options
-rw-r--r-- | all.json | 2 | ||||
-rw-r--r-- | archives/discord.tar.gz | bin | 54911 -> 54681 bytes | |||
-rw-r--r-- | uncompressed/discord/package.json | 4 | ||||
-rw-r--r-- | uncompressed/discord/webview.js | 34 |
4 files changed, 20 insertions, 20 deletions
@@ -92,7 +92,7 @@ | |||
92 | "featured": false, | 92 | "featured": false, |
93 | "id": "discord", | 93 | "id": "discord", |
94 | "name": "Discord", | 94 | "name": "Discord", |
95 | "version": "1.1.1", | 95 | "version": "1.1.2", |
96 | "icons": { | 96 | "icons": { |
97 | "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/discord/icon.png", | 97 | "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/discord/icon.png", |
98 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/discord/icon.svg" | 98 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/discord/icon.svg" |
diff --git a/archives/discord.tar.gz b/archives/discord.tar.gz index 42744f8..0c5b3c3 100644 --- a/archives/discord.tar.gz +++ b/archives/discord.tar.gz | |||
Binary files differ | |||
diff --git a/uncompressed/discord/package.json b/uncompressed/discord/package.json index 76b680d..59a14d2 100644 --- a/uncompressed/discord/package.json +++ b/uncompressed/discord/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "discord", | 2 | "id": "discord", |
3 | "name": "Discord", | 3 | "name": "Discord", |
4 | "version": "1.1.1", | 4 | "version": "1.1.2", |
5 | "description": "Discord", | 5 | "description": "Discord", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Stefan Malzner <stefan@adlk.io>", | 7 | "author": "Stefan Malzner <stefan@adlk.io>", |
@@ -12,7 +12,7 @@ | |||
12 | "popup": [], | 12 | "popup": [], |
13 | "hasNotificationSound": true, | 13 | "hasNotificationSound": true, |
14 | "hasDirectMessages": true, | 14 | "hasDirectMessages": true, |
15 | "hasIndirectMessages": false, | 15 | "hasIndirectMessages": true, |
16 | "hasTeamID": false, | 16 | "hasTeamID": false, |
17 | "hasPredefinedUrl": true, | 17 | "hasPredefinedUrl": true, |
18 | "hasCustomUrl": false, | 18 | "hasCustomUrl": false, |
diff --git a/uncompressed/discord/webview.js b/uncompressed/discord/webview.js index 2a204dc..bcc8904 100644 --- a/uncompressed/discord/webview.js +++ b/uncompressed/discord/webview.js | |||
@@ -11,23 +11,23 @@ module.exports = Franz => { | |||
11 | ]; | 11 | ]; |
12 | 12 | ||
13 | const getMessages = function getMessages() { | 13 | const getMessages = function getMessages() { |
14 | // Get direct messages | 14 | const direct = document.querySelector('[class*="guilds-"]').querySelectorAll('[class^="numberBadge-"]').length; |
15 | let direct = 0; | 15 | |
16 | 16 | var indirect = 0; | |
17 | document.querySelectorAll('[class^="numberBadge-2s8kKX"]').forEach((directElement) => { | 17 | var guilds = document.querySelector("[data-ref-id=guildsnav]"); |
18 | direct = direct + parseInt(directElement.innerHTML); | 18 | if(guilds != null) { |
19 | }); | 19 | var channelPills = [].slice.call(guilds.querySelectorAll("[class*=item-2hkk8m]")); |
20 | 20 | indirect += channelPills.filter(y => y.clientHeight == 8).length; | |
21 | // Get indirect messages | 21 | |
22 | let indirect = 0; | 22 | var activeWindow = channelPills.find(y => y.clientHeight == 40); |
23 | 23 | if(activeWindow != null) { | |
24 | document.querySelectorAll('link[rel="icon"]').forEach((linkElement) => { | 24 | var unreadChannels = document.querySelector("[class*=modeUnread]"); |
25 | if(iconValues.indexOf(linkElement.getAttribute('href')) !== -1) { | 25 | |
26 | indirect = 1; | 26 | if(unreadChannels != null) |
27 | } | 27 | indirect++; |
28 | }); | 28 | } |
29 | 29 | } | |
30 | // Set badge | 30 | |
31 | Franz.setBadge(direct, indirect); | 31 | Franz.setBadge(direct, indirect); |
32 | }; | 32 | }; |
33 | 33 | ||