MUC: Features are fetched in join
due to the `await this.refreshDiscoInfo()` call in `join`. So should be safe to remove the check whether features were fetched.
This commit is contained in:
parent
3d19def3e7
commit
c5588e3c49
@ -2649,9 +2649,14 @@ const ChatRoomMixin = {
|
|||||||
*/
|
*/
|
||||||
async onOwnPresence (stanza) {
|
async onOwnPresence (stanza) {
|
||||||
await this.occupants.fetched;
|
await this.occupants.fetched;
|
||||||
|
|
||||||
|
if (stanza.getAttribute('type') === 'unavailable') {
|
||||||
|
this.handleDisconnection(stanza);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const old_status = this.session.get('connection_status');
|
const old_status = this.session.get('connection_status');
|
||||||
if (stanza.getAttribute('type') !== 'unavailable' &&
|
if (old_status !== converse.ROOMSTATUS.ENTERED &&
|
||||||
old_status !== converse.ROOMSTATUS.ENTERED &&
|
|
||||||
old_status !== converse.ROOMSTATUS.CLOSING
|
old_status !== converse.ROOMSTATUS.CLOSING
|
||||||
) {
|
) {
|
||||||
// Set connection_status before creating the occupant, but
|
// Set connection_status before creating the occupant, but
|
||||||
@ -2664,32 +2669,15 @@ const ChatRoomMixin = {
|
|||||||
this.updateOccupantsOnPresence(stanza);
|
this.updateOccupantsOnPresence(stanza);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stanza.getAttribute('type') === 'unavailable') {
|
const locked_room = stanza.querySelector("status[code='201']");
|
||||||
this.handleDisconnection(stanza);
|
if (locked_room) {
|
||||||
return;
|
if (this.get('auto_configure')) {
|
||||||
} else {
|
await this.autoConfigureChatRoom().then(() => this.refreshDiscoInfo());
|
||||||
const locked_room = stanza.querySelector("status[code='201']");
|
} else if (api.settings.get('muc_instant_rooms')) {
|
||||||
if (locked_room) {
|
// Accept default configuration
|
||||||
if (this.get('auto_configure')) {
|
await this.sendConfiguration().then(() => this.refreshDiscoInfo());
|
||||||
this.autoConfigureChatRoom().then(() => this.refreshDiscoInfo());
|
} else {
|
||||||
} else if (api.settings.get('muc_instant_rooms')) {
|
this.session.save({ 'view': converse.MUC.VIEWS.CONFIG });
|
||||||
// Accept default configuration
|
|
||||||
this.sendConfiguration().then(() => this.refreshDiscoInfo());
|
|
||||||
} else {
|
|
||||||
this.session.save({ 'view': converse.MUC.VIEWS.CONFIG });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else if (!this.features.get('fetched')) {
|
|
||||||
// The features for this groupchat weren't fetched.
|
|
||||||
// That must mean it's a new groupchat without locking
|
|
||||||
// (in which case Prosody doesn't send a 201 status),
|
|
||||||
// otherwise the features would have been fetched in
|
|
||||||
// the "initialize" method already.
|
|
||||||
if (this.getOwnAffiliation() === 'owner' && this.get('auto_configure')) {
|
|
||||||
this.autoConfigureChatRoom().then(() => this.refreshDiscoInfo());
|
|
||||||
} else {
|
|
||||||
this.getDiscoInfo();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user