瀏覽代碼

Don't show join message for non-online occupants created from members list

Fixes #1169
JC Brand 6 年之前
父節點
當前提交
aa50942400
共有 3 個文件被更改,包括 16 次插入3 次删除
  1. 1 0
      CHANGES.md
  2. 8 2
      dist/converse.js
  3. 7 1
      src/converse-muc-views.js

+ 1 - 0
CHANGES.md

@@ -6,6 +6,7 @@
 - Bugfix. MUC features weren't being refreshed when saving the config form
 - #1063 URLs in the topic / subject are not clickable
 - #1140 Add support for destroyed chatrooms
+- #1169 Non-joined participants display an unwanted status message
 - #1190 MUC Participants column disappears in certain viewport widths
 - #1199 Can't get back from to login screen from registration screen
 - #1204 Link encoding issue

+ 8 - 2
dist/converse.js

@@ -68681,7 +68681,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
           this.model.on('configurationNeeded', this.getAndRenderConfigurationForm, this);
           this.model.on('destroy', this.hide, this);
           this.model.on('show', this.show, this);
-          this.model.occupants.on('add', this.showJoinNotification, this);
+          this.model.occupants.on('add', this.onOccupantAdded, this);
           this.model.occupants.on('remove', this.showLeaveNotification, this);
           this.model.occupants.on('change:show', this.showJoinOrLeaveNotification, this);
           this.model.occupants.on('change:role', this.informOfOccupantsRoleChange, this);
@@ -69700,8 +69700,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
           }
         },
 
+        onOccupantAdded(occupant) {
+          if (occupant.get('show') === 'online') {
+            this.showJoinNotification(occupant);
+          }
+        },
+
         showJoinOrLeaveNotification(occupant) {
-          if (!occupant.isMember() || _.includes(occupant.get('states'), '303')) {
+          if (_.includes(occupant.get('states'), '303')) {
             return;
           }
 

+ 7 - 1
src/converse-muc-views.js

@@ -540,7 +540,7 @@
                     this.model.on('destroy', this.hide, this);
                     this.model.on('show', this.show, this);
 
-                    this.model.occupants.on('add', this.showJoinNotification, this);
+                    this.model.occupants.on('add', this.onOccupantAdded, this);
                     this.model.occupants.on('remove', this.showLeaveNotification, this);
                     this.model.occupants.on('change:show', this.showJoinOrLeaveNotification, this);
                     this.model.occupants.on('change:role', this.informOfOccupantsRoleChange, this);
@@ -1476,6 +1476,12 @@
                     }
                 },
 
+                onOccupantAdded (occupant) {
+                    if (occupant.get('show') === 'online') {
+                        this.showJoinNotification(occupant);
+                    }
+                },
+
                 showJoinOrLeaveNotification (occupant) {
                     if (_.includes(occupant.get('states'), '303')) {
                         return;