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

Fixes #1169
This commit is contained in:
JC Brand 2018-10-11 13:21:44 +02:00
parent 8c772a7f71
commit aa50942400
3 changed files with 16 additions and 3 deletions

View File

@ -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

10
dist/converse.js vendored
View File

@ -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;
}

View File

@ -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;