diff options
-rw-r--r-- | all.json | 4 | ||||
-rw-r--r-- | archives/element.tar.gz | bin | 26010 -> 26137 bytes | |||
-rw-r--r-- | uncompressed/element/README.md | 4 | ||||
-rw-r--r-- | uncompressed/element/package.json | 4 | ||||
-rw-r--r-- | uncompressed/element/webview.js | 19 |
5 files changed, 17 insertions, 14 deletions
@@ -143,11 +143,11 @@ | |||
143 | } | 143 | } |
144 | }, | 144 | }, |
145 | { | 145 | { |
146 | "author": "Omove <61330514+omove@users.noreply.github.com>", | 146 | "author": "Sylvain Cecchetto <cecchetto.sylvain@me.com>, Omove <61330514+omove@users.noreply.github.com>, Achim Leitner <1033549+fjl5@users.noreply.github.com>", |
147 | "featured": false, | 147 | "featured": false, |
148 | "id": "element", | 148 | "id": "element", |
149 | "name": "Element", | 149 | "name": "Element", |
150 | "version": "1.0.0", | 150 | "version": "1.0.1", |
151 | "icons": { | 151 | "icons": { |
152 | "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/element/icon.png", | 152 | "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/element/icon.png", |
153 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/element/icon.svg" | 153 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/element/icon.svg" |
diff --git a/archives/element.tar.gz b/archives/element.tar.gz index 92dbe9c..4362ed8 100644 --- a/archives/element.tar.gz +++ b/archives/element.tar.gz | |||
Binary files differ | |||
diff --git a/uncompressed/element/README.md b/uncompressed/element/README.md index affdf4b..221864f 100644 --- a/uncompressed/element/README.md +++ b/uncompressed/element/README.md | |||
@@ -1,2 +1,2 @@ | |||
1 | # Element for Franz | 1 | # Element for Franz and Ferdi |
2 | This is a Franz recipe/plugin for Element | 2 | This is a Franz and Ferdi recipe/plugin for Element |
diff --git a/uncompressed/element/package.json b/uncompressed/element/package.json index 6774ce3..68cd16e 100644 --- a/uncompressed/element/package.json +++ b/uncompressed/element/package.json | |||
@@ -1,10 +1,10 @@ | |||
1 | { | 1 | { |
2 | "id": "element", | 2 | "id": "element", |
3 | "name": "Element", | 3 | "name": "Element", |
4 | "version": "1.0.0", | 4 | "version": "1.0.1", |
5 | "description": "Decentralized, encrypted chat & collaboration powered by [matrix]", | 5 | "description": "Decentralized, encrypted chat & collaboration powered by [matrix]", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Omove <61330514+omove@users.noreply.github.com>", | 7 | "author": "Sylvain Cecchetto <cecchetto.sylvain@me.com>, Omove <61330514+omove@users.noreply.github.com>, Achim Leitner <1033549+fjl5@users.noreply.github.com>", |
8 | "license": "MIT", | 8 | "license": "MIT", |
9 | "config": { | 9 | "config": { |
10 | "serviceURL": "https://app.element.io", | 10 | "serviceURL": "https://app.element.io", |
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 | } |