Use the roster name or vCard nickname before falling back to vCard fullname or JID.

This commit is contained in:
Emmanuel Gil Peyrot 2018-08-18 21:30:56 +01:00 committed by JC Brand
parent 299fa4f3f8
commit 958e8a98a8
3 changed files with 3 additions and 3 deletions

View File

@ -208,8 +208,8 @@
render () {
this.el.innerHTML = tpl_chatbox_head(
_.extend(
this.model.toJSON(),
this.model.vcard.toJSON(),
this.model.toJSON(),
{ '_converse': _converse,
'info_close': __('Close this chat box')
}

View File

@ -247,7 +247,7 @@
},
getDisplayName () {
return this.vcard.get('fullname') || this.get('jid');
return this.get('nickname') || this.vcard.get('nickname') || this.vcard.get('fullname') || this.get('jid');
},
getFullname () {

View File

@ -7,7 +7,7 @@
{[ if (o.url) { ]}
<a href="{{{o.url}}}" target="_blank" rel="noopener" class="user">
{[ } ]}
{{{ o.fullname || o.jid }}}
{{{ o.nickname || o.fullname || o.jid }}}
{[ if (o.url) { ]}
</a>
{[ } ]}