Skip to content
Snippets Groups Projects
Commit f9ba9f95 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

bugfix: disable desktop notification

parent 34fdb33c
No related branches found
No related tags found
No related merge requests found
Pipeline #7487 passed
...@@ -182,21 +182,6 @@ ...@@ -182,21 +182,6 @@
function emitNotification(jid, alert) function emitNotification(jid, alert)
{ {
_converse.api.trigger('chatRoomActivityIndicators', jid); _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) function sendMarker(to_jid, id, type)
...@@ -213,24 +198,4 @@ ...@@ -213,24 +198,4 @@
_converse.api.send(stanza); _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);
}
}
})); }));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment