|
@@ -33,7 +33,8 @@ converse.plugins.add('converse-notification', {
|
|
// ^ a list of JIDs to ignore concerning chat state notifications
|
|
// ^ a list of JIDs to ignore concerning chat state notifications
|
|
play_sounds: true,
|
|
play_sounds: true,
|
|
sounds_path: 'sounds/',
|
|
sounds_path: 'sounds/',
|
|
- notification_icon: 'logo/conversejs-filled.svg'
|
|
|
|
|
|
+ notification_icon: 'logo/conversejs-filled.svg',
|
|
|
|
+ notification_delay: 5000
|
|
});
|
|
});
|
|
|
|
|
|
_converse.isOnlyChatStateNotification = (msg) =>
|
|
_converse.isOnlyChatStateNotification = (msg) =>
|
|
@@ -180,9 +181,12 @@ converse.plugins.add('converse-notification', {
|
|
const n = new Notification(title, {
|
|
const n = new Notification(title, {
|
|
'body': body,
|
|
'body': body,
|
|
'lang': _converse.locale,
|
|
'lang': _converse.locale,
|
|
- 'icon': _converse.notification_icon
|
|
|
|
|
|
+ 'icon': _converse.notification_icon,
|
|
|
|
+ 'requireInteraction': !_converse.notification_delay
|
|
});
|
|
});
|
|
- setTimeout(n.close.bind(n), 5000);
|
|
|
|
|
|
+ if (_converse.notification_delay) {
|
|
|
|
+ setTimeout(n.close.bind(n), _converse.notification_delay);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
_converse.showChatStateNotification = function (contact) {
|
|
_converse.showChatStateNotification = function (contact) {
|