conversejs / converse.js

Web-based XMPP/Jabber chat client written in JavaScript
http://conversejs.org
Mozilla Public License 2.0
3.06k stars 763 forks source link

Display First Name and Last Name in members list #1997

Open deleolajide opened 4 years ago

deleolajide commented 4 years ago

Describe the bug Converse is giving nickname higher priority than fullname when it evaluates the function getDisplayName in vCards. This causes autocompletion lists to always show vCard usernames instead of full-names (first and fast names).

https://github.com/conversejs/converse.js/blob/ad4999384d221b41bad6a8ec9e4fe15cadf9ef15/src/headless/converse-vcard.js#L98

See this bug report for more detail

Solution is to swap postions

getDisplayName () {
    return this.get('fullname') || this.get('nickname') || this.get('jid');
}
--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/97592864-display-first-name-and-last-name-in-members-list?utm_campaign=plugin&utm_content=tracker%2F194169&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F194169&utm_medium=issues&utm_source=github).
jcbrand commented 4 years ago

IIRC, this ordering was agreed upon in the XMPP UX sprint in Brussels in 2019 (and is therefore also how other adhering clients will order things).

Perhaps we can fix the auto-complete lists so that they show whatever gets matched?

So if you match JID, it'll show the JID, if you match the nickname, it'll show that. In both cases it can perhaps show the other two values as well.

deleolajide commented 4 years ago

and is therefore also how other adhering clients will order things).

Did we get agreement from the server implements too. I am being asked by Prosody to changes this.

Alright. We can leave this as it is and tackle the issue at the auto-complete lists, but my instincts and experience tell me that this will show up again as another issue some time later, somewhere else.

My displayed name should be my full-name from vCards. If not available, then use a nickname before resorting to my JID.

deleolajide commented 4 years ago

Does not look like this will be straightforward to fix with 7.0 as the code now limits the autocompletion list to only nicknames and drops the references to the occupant that provided it.

I think getAllKnownNicknames should return a Set of objects and not a Set of strings, but that could have a breaking effect elsewhere.

https://github.com/conversejs/converse.js/blob/958379682aed97f654fa5947c2889465ef6e05cb/src/converse-muc-views.js#L893

https://github.com/conversejs/converse.js/blob/958379682aed97f654fa5947c2889465ef6e05cb/src/headless/converse-muc.js#L887

I might have to do a temporary 6.x fix and leave this issue outstanding for now.

jcbrand commented 4 years ago

Actually... I might be misremembering. The nickname you set for the user in the roster should have highest preference, but that's a different nickname I now realise.

So I think your original proposal is good. Will you please make a PR?

deleolajide commented 4 years ago

So I think your original proposal is good. Will you please make a PR?

Thanks, I will do that. It will become compatible with Prosody in that respect. However, I just released after following up deep into the code after your first comments that that it wont fix the auto-complete problem that triggered the issue.

Auto-completion lists always uses the room nickname

jcbrand commented 4 years ago

In what way does it become compatible with Prosody?

deleolajide commented 4 years ago

In what way does it become compatible with Prosody? image

The full discussion can found here.