Browse Source

Don't remove ourselves as occupant

when removing offline users who are no longer on the member lists
JC Brand 7 years ago
parent
commit
145167baae
2 changed files with 5 additions and 0 deletions
  1. 4 0
      dist/converse.js
  2. 1 0
      src/converse-muc.js

+ 4 - 0
dist/converse.js

@@ -78556,6 +78556,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
             _.each(_.difference(old_jids, jids), removed_jid => {
               // Remove absent occupants who've been removed from
               // the members lists.
+              if (removed_jid === _converse.bare_jid) {
+                return;
+              }
+
               const occupant = this.findOccupant({
                 'jid': removed_jid
               });

+ 1 - 0
src/converse-muc.js

@@ -1041,6 +1041,7 @@
                         _.each(_.difference(old_jids, jids), (removed_jid) => {
                             // Remove absent occupants who've been removed from
                             // the members lists.
+                            if (removed_jid === _converse.bare_jid) { return; }
                             const occupant = this.findOccupant({'jid': removed_jid});
                             if (!occupant) { return; }
                             if (occupant.get('show') === 'offline') {