From ba67f3747304736812749c10067ab4bbd6056c8d Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 23 Aug 2016 11:35:16 +0000 Subject: [PATCH] Only show desktop notifications for error/warn feedback messages --- src/converse-notification.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/converse-notification.js b/src/converse-notification.js index b46c39460..fbdc80042 100644 --- a/src/converse-notification.js +++ b/src/converse-notification.js @@ -195,12 +195,14 @@ }; converse.showFeedbackNotification = function (data) { - var n = new Notification(data.subject, { - body: data.message, - lang: converse.i18n.locale_data.converse[""].lang, - icon: 'logo/conversejs.png' - }); - setTimeout(n.close.bind(n), 5000); + if (data.klass === 'error' || data.klass === 'warn') { + var n = new Notification(data.subject, { + body: data.message, + lang: converse.i18n.locale_data.converse[""].lang, + icon: 'logo/conversejs.png' + }); + setTimeout(n.close.bind(n), 5000); + } }; converse.handleChatStateNotification = function (evt, contact) {