Commit 11023dfe authored by JC Brand's avatar JC Brand

Don't clear occupants when leaving a MUC, only when closing it

Otherwise, when leaving as part of RAI and in a MUC where we only get
presence info based on probes, we lose occupant info that doesn't get
recreated when we rejoin.
parent 2da2dbff
...@@ -780,7 +780,6 @@ const ChatRoomMixin = { ...@@ -780,7 +780,6 @@ const ChatRoomMixin = {
*/ */
async leave (exit_msg) { async leave (exit_msg) {
this.features.destroy(); this.features.destroy();
this.occupants.clearStore();
const disco_entity = _converse.disco_entities?.get(this.get('jid')); const disco_entity = _converse.disco_entities?.get(this.get('jid'));
if (disco_entity) { if (disco_entity) {
...@@ -794,6 +793,8 @@ const ChatRoomMixin = { ...@@ -794,6 +793,8 @@ const ChatRoomMixin = {
async close (ev) { async close (ev) {
await this.leave(); await this.leave();
this.occupants.clearStore();
if (ev?.name !== 'closeAllChatBoxes' && api.settings.get('muc_clear_messages_on_leave')) { if (ev?.name !== 'closeAllChatBoxes' && api.settings.get('muc_clear_messages_on_leave')) {
this.clearMessages(); this.clearMessages();
} }
......
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