Commit ba67f374 authored by JC Brand's avatar JC Brand

Only show desktop notifications for error/warn feedback messages

parent 7a428f4d
...@@ -195,12 +195,14 @@ ...@@ -195,12 +195,14 @@
}; };
converse.showFeedbackNotification = function (data) { converse.showFeedbackNotification = function (data) {
var n = new Notification(data.subject, { if (data.klass === 'error' || data.klass === 'warn') {
body: data.message, var n = new Notification(data.subject, {
lang: converse.i18n.locale_data.converse[""].lang, body: data.message,
icon: 'logo/conversejs.png' lang: converse.i18n.locale_data.converse[""].lang,
}); icon: 'logo/conversejs.png'
setTimeout(n.close.bind(n), 5000); });
setTimeout(n.close.bind(n), 5000);
}
}; };
converse.handleChatStateNotification = function (evt, contact) { converse.handleChatStateNotification = function (evt, contact) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment