Always clear messages and occupants cache before (re)entering a room
This commit is contained in:
parent
e053b97043
commit
7511d8c35e
|
@ -231,6 +231,11 @@ converse.plugins.add('converse-muc', {
|
||||||
|
|
||||||
async enterRoom () {
|
async enterRoom () {
|
||||||
if (this.get('connection_status') !== converse.ROOMSTATUS.ENTERED) {
|
if (this.get('connection_status') !== converse.ROOMSTATUS.ENTERED) {
|
||||||
|
// We're not restoring a room from cache, so let's clear
|
||||||
|
// the cache (which might be stale).
|
||||||
|
this.clearMessages();
|
||||||
|
this.clearOccupants();
|
||||||
|
|
||||||
await this.getRoomFeatures();
|
await this.getRoomFeatures();
|
||||||
if (!u.isPersistableModel(this)) {
|
if (!u.isPersistableModel(this)) {
|
||||||
// XXX: Happens during tests, nothing to do if this
|
// XXX: Happens during tests, nothing to do if this
|
||||||
|
@ -264,13 +269,11 @@ converse.plugins.add('converse-muc', {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onReconnection () {
|
async onReconnection () {
|
||||||
this.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
this.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
||||||
this.clearMessages();
|
|
||||||
this.clearOccupants();
|
|
||||||
this.registerHandlers();
|
this.registerHandlers();
|
||||||
|
await this.enterRoom();
|
||||||
this.announceReconnection();
|
this.announceReconnection();
|
||||||
this.enterRoom();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initFeatures () {
|
initFeatures () {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user