Commit 958e8a98 authored by Emmanuel Gil Peyrot's avatar Emmanuel Gil Peyrot Committed by JC Brand

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

parent 299fa4f3
...@@ -208,8 +208,8 @@ ...@@ -208,8 +208,8 @@
render () { render () {
this.el.innerHTML = tpl_chatbox_head( this.el.innerHTML = tpl_chatbox_head(
_.extend( _.extend(
this.model.toJSON(),
this.model.vcard.toJSON(), this.model.vcard.toJSON(),
this.model.toJSON(),
{ '_converse': _converse, { '_converse': _converse,
'info_close': __('Close this chat box') 'info_close': __('Close this chat box')
} }
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
}, },
getDisplayName () { 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 () { getFullname () {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{[ if (o.url) { ]} {[ if (o.url) { ]}
<a href="{{{o.url}}}" target="_blank" rel="noopener" class="user"> <a href="{{{o.url}}}" target="_blank" rel="noopener" class="user">
{[ } ]} {[ } ]}
{{{ o.fullname || o.jid }}} {{{ o.nickname || o.fullname || o.jid }}}
{[ if (o.url) { ]} {[ if (o.url) { ]}
</a> </a>
{[ } ]} {[ } ]}
......
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