Commit 145ee882 authored by JC Brand's avatar JC Brand

Start handling error presences in MUC model

parent 1be9958a
......@@ -60970,7 +60970,16 @@ _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc
*/
onPresence(pres) {
if (pres.getAttribute('type') === 'error') {
// TODO: currently showErrorMessageFromPresence handles
// 'error" presences in converse-muc-views.
// Instead, they should be handled here and the presence
// handler removed from there.
if (sizzle(`error not-authorized[xmlns="${Strophe.NS.STANZAS}"]`, pres).length) {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.PASSWORD_REQUIRED);
} else {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
}
return;
}
......@@ -1116,7 +1116,15 @@ converse.plugins.add('converse-muc', {
*/
onPresence (pres) {
if (pres.getAttribute('type') === 'error') {
// TODO: currently showErrorMessageFromPresence handles
// 'error" presences in converse-muc-views.
// Instead, they should be handled here and the presence
// handler removed from there.
if (sizzle(`error not-authorized[xmlns="${Strophe.NS.STANZAS}"]`, pres).length) {
this.save('connection_status', converse.ROOMSTATUS.PASSWORD_REQUIRED);
} else {
this.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
}
return;
}
const is_self = pres.querySelector("status[code='110']");
......
......@@ -39257,7 +39257,16 @@ _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc
*/
onPresence(pres) {
if (pres.getAttribute('type') === 'error') {
// TODO: currently showErrorMessageFromPresence handles
// 'error" presences in converse-muc-views.
// Instead, they should be handled here and the presence
// handler removed from there.
if (sizzle(`error not-authorized[xmlns="${Strophe.NS.STANZAS}"]`, pres).length) {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.PASSWORD_REQUIRED);
} else {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
}
return;
}
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