Converse.js shows a list of MUC rooms that are joined in the top-left corner, like this:

What I describe in this issue is behavior that I deduced by observing (Converse.js 6.0.1). I've not looked at the actual implementation, which might have other nuances to it.
The label that is shown appears to be the name of the bookmark (I'm unsure what's shown when a MUC room is joined that is not being bookmarked).
The 'name' attribute of a bookmark is not always set (even if Converse.js would always set the 'name' attribute of a bookmark that it creates, Converse.js could also be trying to display bookmarks created by other clients that might not have set the 'name' attribute).
When no 'name' attribute for the bookmark is set, Converse seems to show the JID of the MUC room (as shown for the second room in the screenshot above). This is undesirable, as JIDs are not very user friendly. Converse.js should be improved in a way that, when no 'name' for the bookmark is available, it first tries to display some other, more user friendly value, before resorting to displaying the JID of the MUC room. My suggestion would be to try and use the MUC room name, which can be obtained through service discovery:

looking at the code responsible for displaying the groupchat list, I realize that it's a function that takes an object "o" and this object contains another object "room" which is the representation of a groupchat.
on the "room" object the method "getDisplayName()" is called to display the name that is visible in the list.

my question is where is this object and how to modify the getDisplayName method ? what is the part of conversejs that communicates with the API (backend) and transforms the received data into objects usable in conversejs ?
the room object looks like this:
{
"num_unread_general":0,
"bookmarked":true,
"chat_state":"composing",
"hidden":false,
"message_type":"groupchat",
"name":"",
"num_unread":0,
"roomconfig":{},
"time_opened":1600879988806,
"time_sent":"1970-01-01T00:00:00.000Z",
"type":"chatroom",
"jid":"[email protected]",
"id":"[email protected]",
"box_id":"[email protected]",
"omemo_supported":false,
"prejoin_mam_fetched":true,
"nick":"bernard-ng",
"scrolled":false,
"scrollTop":null,
"subject":{
"author":"jcbrand",
"text":"Discussions around Converse.js. The latest release is 6.0.1. Please be patient when asking questions, we're all in different timezones. https://github.com/conversejs/converse.js/releases/tag/v6.0.1"
},
"first_unread_id":"id836c9c92-78c2-4655-8715-a8372041b6ff"
}
Let's see if we can find out together.
The room_item const is used in the same file, here: https://github.com/conversejs/converse.js/blob/e82d6785c2cc24d347c2044560d428a33a1ac6f6/src/templates/rooms_list.js#L61
It seems to be populated by another object's rooms value.
That code is part of the default export. In my non-javascript expertise, that means that we need to find other code that imports this. There seems to be just one import statement that matches, which is here:
Here, it is referenced to as tpl_rooms_list. This is used in only one place in the code:
On line 93, the rooms value is populated, using this.model.filter(m => m.get('type') === _converse.CHATROOMS_TYPE),
This is where I start to loose track. We want to see what populates model. When clicking through the Github UI, you find that it's being referenced in a number of files, one of which is called converse_muc. That _seems_ related (but I'm not sure). In that, we find this:
Is that using the Chatroom definition here, perhaps?
At this stage, I'm kind of lost - but I hope that this gives you something to go on. Be aware though that I might be totally wrong here (I'm not familiar with this code at all), so do check my reasoning!
@guusdk thank you, you were right, here is the logic of the displayName function:
the attribute "name" is set when the groupchat is bookmarked according to what I understand, otherwise we use the "jid", until then, I don't see an attribute that corresponds to the room name, I'm stuck here.
I suggest that you try to find out how 'name' is set.
What strikes me as odd, is that Converse seems to display the name of the bookmark of the MUC room, not the name of the MUC room itself. If that is true, then the 'name' attribute that you've found in the displayName function somehow gets overwritten with the bookmark name.
If that is indeed the case, then I wonder if that name gets overwritten, even if the name of the bookmark is empty/null. That potentially _removes_ the name of the room!
If all of the above is true, then simply checking if the bookmark name is not empty before overwriting the name of the room might be enough to resolve this issue. That could be the quick and dirty fix, then. If this is indeed the case, then we might want to look further, to see if we can seperate the storage of the 'bookmark' name and the 'room' name (they are two different things, it is weird for them to overwrite each-other).
Looks like the extended MUC disco info fields are stored in the model.config Model instance.
So you should be able to get the name via model.config.get('name') or model.config.get('description') (where model refers to the ChatRoom instance).