|
@@ -137,7 +137,8 @@ const ChatRoomMixin = {
|
|
await this.fetchMessages().catch(e => log.error(e));
|
|
await this.fetchMessages().catch(e => log.error(e));
|
|
return true;
|
|
return true;
|
|
} else {
|
|
} else {
|
|
- this.clearCache();
|
|
|
|
|
|
+ this.session.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
|
|
|
+ this.clearOccupantsCache();
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -193,13 +194,13 @@ const ChatRoomMixin = {
|
|
* @method _converse.ChatRoom#rejoin
|
|
* @method _converse.ChatRoom#rejoin
|
|
*/
|
|
*/
|
|
rejoin () {
|
|
rejoin () {
|
|
|
|
+ this.session.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
|
this.registerHandlers();
|
|
this.registerHandlers();
|
|
- this.clearCache();
|
|
|
|
|
|
+ this.clearOccupantsCache();
|
|
return this.join();
|
|
return this.join();
|
|
},
|
|
},
|
|
|
|
|
|
- clearCache () {
|
|
|
|
- this.session.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
|
|
|
|
|
+ clearOccupantsCache () {
|
|
if (this.occupants.length) {
|
|
if (this.occupants.length) {
|
|
// Remove non-members when reconnecting
|
|
// Remove non-members when reconnecting
|
|
this.occupants.filter(o => !o.isMember()).forEach(o => o.destroy());
|
|
this.occupants.filter(o => !o.isMember()).forEach(o => o.destroy());
|