Преглед на файлове

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.
JC Brand преди 4 години
родител
ревизия
11023dfef9
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      src/headless/plugins/muc/muc.js

+ 2 - 1
src/headless/plugins/muc/muc.js

@@ -780,7 +780,6 @@ const ChatRoomMixin = {
      */
     async leave (exit_msg) {
         this.features.destroy();
-        this.occupants.clearStore();
 
         const disco_entity = _converse.disco_entities?.get(this.get('jid'));
         if (disco_entity) {
@@ -794,6 +793,8 @@ const ChatRoomMixin = {
 
     async close (ev) {
         await this.leave();
+        this.occupants.clearStore();
+
         if (ev?.name !== 'closeAllChatBoxes' && api.settings.get('muc_clear_messages_on_leave')) {
             this.clearMessages();
         }