conversejs/converse.js

Clicking on unbookmarked rooms with automatic "letters" avatar duplicates it into room title

BetaRays opened this issue · 1 comments

Describe the bug
When joining a room without an avatar, Converse.js will automatically make one based on the room’s title, for example, for a MUC named "broken@muc.localhost", it will use the letter “B”.
When clicking on this room, if it is not bookmarked, its display name will change to "B broken@muc.localhost", which makes the avatar change to "BB": clicking any more times will prepend "BB" to the room name and the avatar won’t change.
This may also happen when an unread message count is shown (e.g. if you are mentioned in a room you aren’t currently looking at), so the bug exists outside of the new room icon feature.

To Reproduce
Steps to reproduce the behavior:

  1. Join a MUC without an avatar, ensure it is not bookmarked.
  2. Click on the MUC’s entry in the sidebar (multiple times)
  3. Notice the name getting longer each time.

Expected behavior
MUC names shouldn’t automatically change, becoming unreadable when clicking on them.

Screenshots

example screenshot

Environment (please complete the following information):

  • Desktop or Mobile? Desktop
  • Browser [e.g. Chrome, Firefox] Firefox
  • Converse.js version [e.g. 4.2.0] v11.0.0, current master: 37dfc25

Additional context
I think the issue comes from this line, specifically, target.textContent seems to include the automatic avatar.

@BetaRays: For example in Psi/Psi+, when an user has not an Avatar in vCard, there is a default Avatar picture: