|
@@ -194,8 +194,16 @@
|
|
setTimeout(n.close.bind(n), 5000);
|
|
setTimeout(n.close.bind(n), 5000);
|
|
};
|
|
};
|
|
|
|
|
|
- converse.showErrorNotification = function (data) {
|
|
|
|
- var n = new Notification(__('An error has occured'), {
|
|
|
|
|
|
+ converse.showFeedbackNotification = function (data) {
|
|
|
|
+ var subject;
|
|
|
|
+ if (data.klass === 'error') {
|
|
|
|
+ subject = __('An error has occured');
|
|
|
|
+ } else if (data.klass === 'warn') {
|
|
|
|
+ subject = __('Please be aware');
|
|
|
|
+ } else {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ var n = new Notification(subject, {
|
|
body: data.message,
|
|
body: data.message,
|
|
lang: converse.i18n.locale_data.converse[""].lang,
|
|
lang: converse.i18n.locale_data.converse[""].lang,
|
|
icon: 'logo/conversejs.png'
|
|
icon: 'logo/conversejs.png'
|
|
@@ -234,8 +242,8 @@
|
|
};
|
|
};
|
|
|
|
|
|
converse.handleFeedback = function (evt, data) {
|
|
converse.handleFeedback = function (evt, data) {
|
|
- if (data.klass === 'error' && converse.areDesktopNotificationsEnabled(true)) {
|
|
|
|
- converse.showErrorNotification(data);
|
|
|
|
|
|
+ if (converse.areDesktopNotificationsEnabled(true)) {
|
|
|
|
+ converse.showFeedbackNotification(data);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|