Commit 31536048 authored by JC Brand's avatar JC Brand

Inform user of error messages which don't have text

parent a3fe6162
...@@ -62477,7 +62477,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62477,7 +62477,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
getMessageBody(message) { getMessageBody(message) {
const type = message.getAttribute('type'); const type = message.getAttribute('type');
return type === 'error' ? _.propertyOf(message.querySelector('error text'))('textContent') : _.propertyOf(message.querySelector('body'))('textContent');
if (type === 'error') {
const error = message.querySelector('error');
return _.propertyOf(error.querySelector('text'))('textContent') || __('Sorry, an error occured:') + ' ' + error.innerHTML;
} else {
return _.propertyOf(message.querySelector('body'))('textContent');
}
}, },
getMessageAttributesFromStanza(message, delay, original_stanza) { getMessageAttributesFromStanza(message, delay, original_stanza) {
...@@ -417,9 +417,14 @@ ...@@ -417,9 +417,14 @@
getMessageBody (message) { getMessageBody (message) {
const type = message.getAttribute('type'); const type = message.getAttribute('type');
return (type === 'error') ? if (type === 'error') {
_.propertyOf(message.querySelector('error text'))('textContent') : const error = message.querySelector('error');
_.propertyOf(message.querySelector('body'))('textContent'); return _.propertyOf(error.querySelector('text'))('textContent') ||
__('Sorry, an error occured:') + ' ' + error.innerHTML;
} else {
return _.propertyOf(message.querySelector('body'))('textContent');
}
}, },
getMessageAttributesFromStanza (message, delay, original_stanza) { getMessageAttributesFromStanza (message, delay, original_stanza) {
......
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