瀏覽代碼

Don't remove occupants who are on member lists.

updates #1094
JC Brand 7 年之前
父節點
當前提交
3f0920a8c4
共有 1 個文件被更改,包括 8 次插入12 次删除
  1. 8 12
      src/converse-muc.js

+ 8 - 12
src/converse-muc.js

@@ -741,19 +741,15 @@
                         return true;
                     }
                     const occupant = this.occupants.findOccupant(data);
-                    if (data.type === 'unavailable') {
-                        if (occupant) {
-                            // Even before destroying, we set the new data, so
-                            // that we can for example show the
-                            // disconnection message.
+                    if (data.type === 'unavailable' && occupant) {
+                        if (!_.includes(data.states, converse.MUC_NICK_CHANGED_CODE) &&
+                                !_.includes(['admin', 'owner', 'member'], occupant.get('affiliation'))) {
+                            // We only destroy the occupant if this is not a nickname change operation.
+                            // and if they're not on the member lists.
+                            // Before destroying we set the new data, so
+                            // that we can show the disconnection message.
                             occupant.set(data);
-                        }
-                        if (!_.includes(data.states, converse.MUC_NICK_CHANGED_CODE)) {
-                            // We only destroy the occupant if this is not a
-                            // nickname change operation.
-                            if (occupant) {
-                                occupant.destroy();
-                            }
+                            occupant.destroy();
                             return;
                         }
                     }