Fixes #1184
This commit is contained in:
parent
955f1bc80d
commit
989ce0f54d
@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 4.0.1 (Unreleased)
|
||||||
|
|
||||||
|
- #1182 MUC occupants without nick or JID created
|
||||||
|
- #1184 Notification error when message has no body
|
||||||
|
|
||||||
## 4.0.0 (2018-09-07)
|
## 4.0.0 (2018-09-07)
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
|
13
dist/converse.js
vendored
13
dist/converse.js
vendored
@ -71740,11 +71740,16 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|||||||
// the message...
|
// the message...
|
||||||
|
|
||||||
|
|
||||||
const body = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, message).length ? __('OMEMO Message received') : message.querySelector('body').textContent;
|
const body = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, message).length ? __('OMEMO Message received') : _.get(message.querySelector('body'), 'textContent');
|
||||||
|
|
||||||
|
if (!body) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
});
|
});
|
||||||
setTimeout(n.close.bind(n), 5000);
|
setTimeout(n.close.bind(n), 5000);
|
||||||
};
|
};
|
||||||
|
@ -169,11 +169,14 @@
|
|||||||
// the message...
|
// the message...
|
||||||
const body = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, message).length ?
|
const body = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, message).length ?
|
||||||
__('OMEMO Message received') :
|
__('OMEMO Message received') :
|
||||||
message.querySelector('body').textContent;
|
_.get(message.querySelector('body'), 'textContent');
|
||||||
|
if (!body) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
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
|
||||||
});
|
});
|
||||||
setTimeout(n.close.bind(n), 5000);
|
setTimeout(n.close.bind(n), 5000);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user