aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud-talk
diff options
context:
space:
mode:
authorLibravatar Edgars <Edgars+GitHub@gaitenis.id.lv>2020-11-10 12:50:46 +0200
committerLibravatar Edgars <Edgars+GitHub@gaitenis.id.lv>2020-11-10 12:50:46 +0200
commita363b98e38b7b3091cb2ba11cebed0cc53bedc6b (patch)
tree13a55fcc31da0fcd1f62f9b83ceffc6955110009 /recipes/nextcloud-talk
parentMerge pull request #351 from tpapamichail/master (diff)
downloadferdium-recipes-a363b98e38b7b3091cb2ba11cebed0cc53bedc6b.tar.gz
ferdium-recipes-a363b98e38b7b3091cb2ba11cebed0cc53bedc6b.tar.zst
ferdium-recipes-a363b98e38b7b3091cb2ba11cebed0cc53bedc6b.zip
Nextcloud Talk: Hide unrelated notifications and fix notifications count
`service.css` was updated to: - unhide contacts menu; - hide notifications that are not related to Nextcloud Talk; - hide "Dismiss all notifications" as this action would also dismiss hidden notifications. `webview.js` was updated to fix notifications (both direct and indirect) count retrieval. `README.md` was added.
Diffstat (limited to 'recipes/nextcloud-talk')
-rw-r--r--recipes/nextcloud-talk/README.md21
-rw-r--r--recipes/nextcloud-talk/package.json2
-rw-r--r--recipes/nextcloud-talk/service.css12
-rw-r--r--recipes/nextcloud-talk/webview.js23
4 files changed, 48 insertions, 10 deletions
diff --git a/recipes/nextcloud-talk/README.md b/recipes/nextcloud-talk/README.md
new file mode 100644
index 0000000..e6194c2
--- /dev/null
+++ b/recipes/nextcloud-talk/README.md
@@ -0,0 +1,21 @@
1# Ferdi recipe for Nextcloud Talk
2
3Nextcloud Talk - Chat, video & audio-conferencing using WebRTC.
4
5To add Nextcloud Talk to Ferdi, Nextcloud server address should be provided in the field "Custom server".
6
7## Credits
8
9This recipe is based on [`recipe-nextcloud-talk`](https://github.com/meetfranz/recipe-nextcloud-talk).
10
11## Links
12
13Ferdi:
14
15- [Ferdi](https://getferdi.com/)
16- [Ferdi recipes](https://github.com/getferdi/recipes)
17
18Nextcloud:
19
20- [Nextcloud](https://nextcloud.com/)
21- [Nextcloud Talk](https://apps.nextcloud.com/apps/spreed)
diff --git a/recipes/nextcloud-talk/package.json b/recipes/nextcloud-talk/package.json
index dcb5508..9a25f10 100644
--- a/recipes/nextcloud-talk/package.json
+++ b/recipes/nextcloud-talk/package.json
@@ -2,7 +2,7 @@
2 "id": "nextcloud-talk", 2 "id": "nextcloud-talk",
3 "name": "Nextcloud Talk", 3 "name": "Nextcloud Talk",
4 "version": "1.0.2", 4 "version": "1.0.2",
5 "description": "Nextcloud Talk", 5 "description": "Nextcloud Talk - chat, video & audio-conferencing using WebRTC",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Stefan Malzner <stefan@adlk.io>", 7 "author": "Stefan Malzner <stefan@adlk.io>",
8 "license": "MIT", 8 "license": "MIT",
diff --git a/recipes/nextcloud-talk/service.css b/recipes/nextcloud-talk/service.css
index 82dde75..f4f08bc 100644
--- a/recipes/nextcloud-talk/service.css
+++ b/recipes/nextcloud-talk/service.css
@@ -15,7 +15,13 @@ settings links and disable them */
15 display: none !important; 15 display: none !important;
16} 16}
17 17
18/* Hide contacts in the top menu */ 18/* Hide notifications that are not related to calendar */
19#contactsmenu { 19.notifications .notification-wrapper .notification {display: none;}
20 display: none; 20.notifications .notification-wrapper .notification[object_type="chat"],
21.notifications .notification-wrapper .notification[object_type="room"] {
22 display: initial;
21} 23}
24
25/* Hide "Dismiss all notifications" as this action will dismiss also hidden
26notifications */
27.notification-wrapper .dismiss-all {display: none;}
diff --git a/recipes/nextcloud-talk/webview.js b/recipes/nextcloud-talk/webview.js
index c180d4d..42b1e49 100644
--- a/recipes/nextcloud-talk/webview.js
+++ b/recipes/nextcloud-talk/webview.js
@@ -6,13 +6,24 @@ function _interopRequireDefault(obj) {
6 return obj && obj.__esModule ? obj : { default: obj }; 6 return obj && obj.__esModule ? obj : { default: obj };
7} 7}
8 8
9module.exports = Franz => { 9module.exports = Ferdi => {
10 const getMessages = function getMessages() { 10 const getMessages = function getMessages() {
11 const direct = document.querySelectorAll('.app-navigation-entry-utils-counter.highlighted').length; 11 const direct = document.querySelector(
12 const indirect = document.querySelectorAll('.app-navigation-entry-utils-counter:not(.highlighted)').length; 12 '.notifications .notification-wrapper'
13 Franz.setBadge(direct, indirect); 13 ).querySelectorAll(
14 '.notification[object_type="chat"], .notification[object_type="room"'
15 ).length;
16
17 var indirect = 0;
18
19 document.querySelectorAll('.app-navigation-entry__counter').forEach(
20 function(counter) {
21 indirect += Number(counter.textContent)
22 }
23 );
24 Ferdi.setBadge(direct, indirect);
14 }; 25 };
15 26
16 Franz.loop(getMessages); 27 Ferdi.loop(getMessages);
17 Franz.injectCSS(_path.default.join(__dirname, 'service.css')); 28 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));
18}; 29};