Start handling error presences in MUC model
This commit is contained in:
parent
1be9958aa1
commit
145ee88213
11
dist/converse.js
vendored
11
dist/converse.js
vendored
@ -60970,7 +60970,16 @@ _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc
|
||||
*/
|
||||
onPresence(pres) {
|
||||
if (pres.getAttribute('type') === 'error') {
|
||||
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
|
||||
// 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') {
|
||||
this.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
||||
// 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']");
|
||||
|
11
src/headless/dist/converse-headless.js
vendored
11
src/headless/dist/converse-headless.js
vendored
@ -39257,7 +39257,16 @@ _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc
|
||||
*/
|
||||
onPresence(pres) {
|
||||
if (pres.getAttribute('type') === 'error') {
|
||||
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user