Add user's groups as a class to messages in chat

Currently, the HTML containing username or full name of a poster on any regular post is augmented with the information about groups of a user as classes.

<span class="first full-name staff admin group--GROUPNAME"><a href="/u/USER" data-user-card="USER" class="">Full Name</a></span>

I believe the code responsible for this behavior is here

Wouldn’t it be good if a similar thing was made for chat messages? It may be beneficial to color code certain groups so that some (e.g. from staff) messages are distinguished from others…

I.e. if

<span class="chat-message-info__username__name">Full Name</span>

was

<span class="chat-message-info__username__name staff admin group--GROUPNAME">Full Name</span>

It seems like the chat messages don’t have a similar .js file pushing attributes and the classes only come from this file.

4 Likes

I just pushed a change which should do it:

Let me know how it goes for you :+1:

4 Likes

looks good, thank you!

1 Like

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.