From f9ba9f95bd5af1d6349f2c720757ab2dd6881a1b Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Thu, 17 Sep 2020 10:04:53 +0000
Subject: [PATCH] bugfix: disable desktop notification

---
 src/plugins/converse-rai.js | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/src/plugins/converse-rai.js b/src/plugins/converse-rai.js
index 83883cb..4f185fe 100644
--- a/src/plugins/converse-rai.js
+++ b/src/plugins/converse-rai.js
@@ -182,21 +182,6 @@
     function emitNotification(jid, alert)
     {
         _converse.api.trigger('chatRoomActivityIndicators', jid);
-
-        if (_converse.api.settings.get("rai_notification") && alert)
-        {
-            notifyText(_converse.api.settings.get("rai_notification_label"), jid, null, function (notificationId, buttonIndex) {
-
-                if (buttonIndex == 0)
-                {
-                    if (jid.includes("conference.")) {
-                        _converse.api.rooms.open(jid);
-                    } else {
-                        _converse.api.chats.open(jid);
-                    }
-                }
-            });
-        }
     }
 
     function sendMarker(to_jid, id, type)
@@ -213,24 +198,4 @@
 
         _converse.api.send(stanza);
     }
-
-    function notifyText(message, title, notifyId, callback)
-    {
-        if (!notifyId) notifyId = Math.random().toString(36).substr(2, 9);
-
-        var prompt = new Notification(title, {
-            body: message,
-            requireInteraction: true
-        });
-
-        prompt.onclick = function (event) {
-            event.preventDefault();
-            if (callback) callback(notifyId, 0);
-        }
-
-        prompt.onclose = function (event) {
-            event.preventDefault();
-            if (callback) callback(notifyId, 1);
-        }
-    }
 }));
-- 
GitLab