aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/xmpp/webview.js
diff options
context:
space:
mode:
authorLibravatar Aman9das <Aman9das@users.noreply.github.com>2021-11-23 21:18:42 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2021-11-23 21:26:03 +0530
commitb5266ada66a1c8a2409f5ca6c7de2fda968420fa (patch)
treed9503d529caef339c9ed787dabe83070871b7e2a /recipes/xmpp/webview.js
parentFixing issue with 'toggl' recipe exposed by the pre-commit hook (diff)
downloadferdium-recipes-b5266ada66a1c8a2409f5ca6c7de2fda968420fa.tar.gz
ferdium-recipes-b5266ada66a1c8a2409f5ca6c7de2fda968420fa.tar.zst
ferdium-recipes-b5266ada66a1c8a2409f5ca6c7de2fda968420fa.zip
add new 'xmpp' service recipe
Diffstat (limited to 'recipes/xmpp/webview.js')
-rw-r--r--recipes/xmpp/webview.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/recipes/xmpp/webview.js b/recipes/xmpp/webview.js
new file mode 100644
index 0000000..dec648c
--- /dev/null
+++ b/recipes/xmpp/webview.js
@@ -0,0 +1,13 @@
1module.exports = (Ferdi) => {
2 function getMessages() {
3 let direct = 0;
4 for (const indicator of document.querySelectorAll('.msgs-indicator')) {
5 direct += Ferdi.safeParseInt(indicator.textContent)
6 }
7
8 direct = direct / 2 // as the messages are provided in 2 different locations..
9 Ferdi.setBadge(direct);
10 }
11
12 Ferdi.loop(getMessages);
13};