diff options
author | 2021-10-24 10:38:34 +0200 | |
---|---|---|
committer | 2021-10-24 10:38:34 +0200 | |
commit | 4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8 (patch) | |
tree | ce52dc6acfa24a50c3bfbf238c4ec059f5229e0c /recipes/telegram-react | |
parent | Add setDialogTitle feature to api, WhatsApp and Telegram (#750) (diff) | |
download | ferdium-recipes-4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8.tar.gz ferdium-recipes-4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8.tar.zst ferdium-recipes-4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8.zip |
feat: support telegram count for both webk and webz (#751)
Diffstat (limited to 'recipes/telegram-react')
-rw-r--r-- | recipes/telegram-react/icon.svg | 1 | ||||
-rw-r--r-- | recipes/telegram-react/index.js | 1 | ||||
-rw-r--r-- | recipes/telegram-react/package.json | 10 | ||||
-rw-r--r-- | recipes/telegram-react/webview.js | 21 |
4 files changed, 0 insertions, 33 deletions
diff --git a/recipes/telegram-react/icon.svg b/recipes/telegram-react/icon.svg deleted file mode 100644 index f8c7fe3..0000000 --- a/recipes/telegram-react/icon.svg +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | <svg height="80" width="80" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path id="a" d="M39.982.036C17.901.036 0 17.936 0 40.018S17.9 80 39.982 80s39.982-17.9 39.982-39.982S62.064.036 39.982.036z"/><mask id="b" fill="#fff"><use fill-rule="evenodd" xlink:href="#a"/></mask></defs><g fill="none" fill-rule="evenodd"><use fill="#08c" xlink:href="#a"/><g mask="url(#b)"><path d="M59.437 23.035 52.296 59.04s-.999 2.497-3.746 1.298L32.071 47.704l-5.992-2.896-10.088-3.396s-1.548-.55-1.698-1.748c-.15-1.198 1.748-1.848 1.748-1.848l40.1-15.73s3.296-1.448 3.296.949" fill="#fefefe"/><path d="M30.804 58.636s-.48-.045-1.08-1.943c-.6-1.898-3.645-11.885-3.645-11.885l24.22-15.381s1.397-.849 1.348 0c0 0 .25.15-.5.849-.749.7-19.026 17.128-19.026 17.128" fill="#d3e5f1"/><path d="m38.39 52.548-6.519 5.943s-.51.387-1.067.145l1.248-11.04" fill="#b6d0e4"/></g></g></svg> \ No newline at end of file | ||
diff --git a/recipes/telegram-react/index.js b/recipes/telegram-react/index.js deleted file mode 100644 index 23607bd..0000000 --- a/recipes/telegram-react/index.js +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | module.exports = Ferdi => Ferdi; | ||
diff --git a/recipes/telegram-react/package.json b/recipes/telegram-react/package.json deleted file mode 100644 index 11ae14f..0000000 --- a/recipes/telegram-react/package.json +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | { | ||
2 | "id": "telegram-react", | ||
3 | "name": "Telegram React", | ||
4 | "version": "1.2.2", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://webk.telegram.org", | ||
8 | "hasNotificationSound": true | ||
9 | } | ||
10 | } | ||
diff --git a/recipes/telegram-react/webview.js b/recipes/telegram-react/webview.js deleted file mode 100644 index c17b200..0000000 --- a/recipes/telegram-react/webview.js +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | module.exports = Ferdi => { | ||
2 | const getMessages = () => { | ||
3 | let count = 0; | ||
4 | const elements = document.querySelectorAll('.chatlist > li:not(.is-muted)'); | ||
5 | if (elements) { | ||
6 | for (const element of elements) { | ||
7 | if ( | ||
8 | element.querySelector('.unread') && | ||
9 | element.querySelector('.unread').textContent !== 0 | ||
10 | ) { | ||
11 | count += Ferdi.safeParseInt( | ||
12 | element.querySelector('.unread').textContent, | ||
13 | ); | ||
14 | } | ||
15 | } | ||
16 | } | ||
17 | Ferdi.setBadge(count); | ||
18 | }; | ||
19 | |||
20 | Ferdi.loop(getMessages); | ||
21 | }; | ||