Commit 3f0920a8 authored by JC Brand's avatar JC Brand

Don't remove occupants who are on member lists.

updates #1094
parent 9afc344b
......@@ -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();
}
return;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment