Converse.js: Chatbox showing jid/username instead of Fullname/Nickname

Created on 7 Nov 2018  路  6Comments  路  Source: conversejs/converse.js

Using converse with Openfire 4.2.3.

In converse chatbox,above every message exchanged in chat, jid is shown.

How can I show fullname or nickname wherever jid/username is shown on the screen when converse used in fullscreen mode.
Is there any way to disable vcard for converse and just use nickname everywhere?

UI UX bug

All 6 comments

There isn't enough information here for me to really be able to help you.

The full name is fetched from the user's VCards, if they don't have VCards or the fullname field is blank, then the JID is shown in the chat.

Is there any way to catch browser/tab close event and change the status of user to offline?

Thanks.

Please don't change the topic in an issue.

Issues should be about one thing particular problem or topic only.
You can ask questions in the [email protected] chatroom.

I see the same problem, for some users the conversation window uses a regular name while for others it uses the JID. I can confirm that currently only the Vcard's "full name" property is used and the roster name is ignored.

As discussed, the roster nickname should have priority here, and Vcard full name (and/or Vcard nickname) should only serve as a fallback for users that don't exist in your roster.

The current user has defined fullname, and it's visible in the header of chatbox when it's open, but when the chatbox is minimized instead of displaying fullname, it's displayed user's jid.
Also noticed a similar issue with offline messages. If the user has some unread offline message after he logs in, and after opens chatbox from the user who sent that unread message, in the header of that chatbox also appears only jid, not fullname.

I added 3 console.log in the getDisplayName function trying to understand why jid is almost always showed instead of full name,

      getDisplayName() {
        console.log("fullname is "+this.get('fullname'));
        console.log("nickname is "+this.get('nickname'));
        console.log("jid is "+this.get('jid'));
        return this.get('fullname') || this.get('nickname') || this.get('jid');
      }

The logs I get are always:

        jid is [email protected]
        fullname is undefined
        nickname is undefined
        jid is [email protected]
        fullname is undefined
        nickname is undefined

By the way, i'm pretty sure both fullname and nickname are defined, because they are shown in the chatbox header when I contact an user (But I can't see the logged user fullname too)

image

If I set a fullname and a nickname clicking in my profile picture, they are recognized, the problem is that I was planning to hide that part and passing those values in the initialize script, is there a way to read them?

converse.initialize({
    bosh_service_url: '{{ config("chat.bosh_url") }}',
    jid: 'user_{{ Auth::id() }}' + '@' + '{{ config("chat.server_domain") }}',
    password: '{!! Auth::user()->chat_auth_key !!}',
--> nickname: '{{ Auth::user()->custom_url }}',
--> fullname: '{{ Auth::user()->name }} {{ Auth::user()->surname }}',
    autoLogin: true,
    whitelisted_plugins: ['startChat','userNameFix']
});

I tried to log the values using _converse.fullname or _converse.nickname but it's not working (unless I set it manually from profile edit), otherwise all other settings are correctly logged, like _converse.password and the others

Was this page helpful?
0 / 5 - 0 ratings

Related issues

koehn picture koehn  路  7Comments

srgcdev picture srgcdev  路  3Comments

irfancnk picture irfancnk  路  6Comments

singpolyma picture singpolyma  路  6Comments

guusdk picture guusdk  路  5Comments