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