aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Feiko Joosten <feiko_joosten@hotmail.com>2020-04-21 20:12:43 +0200
committerLibravatar GitHub <noreply@github.com>2020-04-21 18:12:43 +0000
commitac2accdf5c799852f243e86bf44d6e2b398f9032 (patch)
treec393d317fccd80f2f74e2ea3aa272d757f5a3890
parentFix notifications for Trello (#123) (diff)
downloadferdium-recipes-ac2accdf5c799852f243e86bf44d6e2b398f9032.tar.gz
ferdium-recipes-ac2accdf5c799852f243e86bf44d6e2b398f9032.tar.zst
ferdium-recipes-ac2accdf5c799852f243e86bf44d6e2b398f9032.zip
Fixes notifications for Steamchat (#121)
- Fixes an issue where notifications for Steamchat weren't properly detected - Adds support for indirect notifications
-rw-r--r--all.json2
-rw-r--r--archives/steamchat.tar.gzbin78646 -> 78583 bytes
-rw-r--r--uncompressed/steamchat/package.json6
-rw-r--r--uncompressed/steamchat/webview.js14
4 files changed, 11 insertions, 11 deletions
diff --git a/all.json b/all.json
index af6117a..796b7cd 100644
--- a/all.json
+++ b/all.json
@@ -763,7 +763,7 @@
763 "featured": false, 763 "featured": false,
764 "id": "steamchat", 764 "id": "steamchat",
765 "name": "SteamChat", 765 "name": "SteamChat",
766 "version": "1.1.0", 766 "version": "1.1.1",
767 "icons": { 767 "icons": {
768 "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/steamchat/icon.png", 768 "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/steamchat/icon.png",
769 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/steamchat/icon.svg" 769 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/steamchat/icon.svg"
diff --git a/archives/steamchat.tar.gz b/archives/steamchat.tar.gz
index 294faa1..48b6707 100644
--- a/archives/steamchat.tar.gz
+++ b/archives/steamchat.tar.gz
Binary files differ
diff --git a/uncompressed/steamchat/package.json b/uncompressed/steamchat/package.json
index 2563a61..6180284 100644
--- a/uncompressed/steamchat/package.json
+++ b/uncompressed/steamchat/package.json
@@ -1,13 +1,15 @@
1{ 1{
2 "id": "steamchat", 2 "id": "steamchat",
3 "name": "SteamChat", 3 "name": "SteamChat",
4 "version": "1.1.0", 4 "version": "1.1.1",
5 "description": "Steam Chat", 5 "description": "Steam Chat",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Kevin Oestmark <yo@kevin.am>", 7 "author": "Kevin Oestmark <yo@kevin.am>",
8 "license": "MIT", 8 "license": "MIT",
9 "config": { 9 "config": {
10 "serviceURL": "https://steamcommunity.com/chat", 10 "serviceURL": "https://steamcommunity.com/chat",
11 "hasNotificationSound": true 11 "hasNotificationSound": true,
12 "hasDirectMessages": true,
13 "hasIndirectMessages": true
12 } 14 }
13} 15}
diff --git a/uncompressed/steamchat/webview.js b/uncompressed/steamchat/webview.js
index 5ea0aed..87f1f7a 100644
--- a/uncompressed/steamchat/webview.js
+++ b/uncompressed/steamchat/webview.js
@@ -4,17 +4,15 @@ module.exports = Franz => {
4 const getMessages = function getMessages() { 4 const getMessages = function getMessages() {
5 // get new msg count 5 // get new msg count
6 let count = 0; 6 let count = 0;
7 let counters = document.querySelectorAll('.unread_message_count:not([style="display: none;"])'); 7 let counters = document.querySelectorAll("[class*=FriendMessageCount]");
8 counters = Array.prototype.slice.call(counters, Math.floor(counters.length / 2)); 8 [].filter.call(counters, countValue => {
9 [].filter.call(counters, countValues => { 9 if (countValue) {
10 if (countValues) {
11 const countValue = countValues.querySelector('.unread_message_count_value');
12 if (countValue.innerHTML.length > 0) {
13 count += parseInt(countValue.innerHTML); 10 count += parseInt(countValue.innerHTML);
14 }
15 } 11 }
16 }); 12 });
17 Franz.setBadge(count); 13
14 const indirectMessages = document.querySelectorAll("[class*=ChatUnreadMessageIndicator]").length;
15 Franz.setBadge(count, indirectMessages);
18 16
19 // force scroll to bottom of chat window 17 // force scroll to bottom of chat window
20 const chatBoxes = document.querySelectorAll('.chat_dialog'); 18 const chatBoxes = document.querySelectorAll('.chat_dialog');