Commit f0110788 authored by JC Brand's avatar JC Brand

Handle case where we don't have a nick for an absent occupant

updates #1099
parent 527555ba
......@@ -995,6 +995,10 @@
if (hash && vcard.get('image_hash') !== hash) {
_converse.api.vcard.update(vcard);
}
},
getDisplayName () {
return this.get('nick') || this.get('jid');
}
});
......@@ -1006,8 +1010,8 @@
const role1 = occupant1.get('role') || 'none';
const role2 = occupant2.get('role') || 'none';
if (MUC_ROLE_WEIGHTS[role1] === MUC_ROLE_WEIGHTS[role2]) {
const nick1 = occupant1.get('nick').toLowerCase();
const nick2 = occupant2.get('nick').toLowerCase();
const nick1 = occupant1.getDisplayName().toLowerCase();
const nick2 = occupant2.getDisplayName().toLowerCase();
return nick1 < nick2 ? -1 : (nick1 > nick2? 1 : 0);
} else {
return MUC_ROLE_WEIGHTS[role1] < MUC_ROLE_WEIGHTS[role2] ? -1 : 1;
......
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