Ticket #3409: 3409.patch

File 3409.patch, 1.3 KB (added by Stan, 9 years ago)

WIP patch.

  • binaries/data/mods/public/gui/lobby/lobby.js

     
    849849        msg.datetime = null;
    850850
    851851    // Highlight local user's nick
    852     if (msg.text.indexOf(g_Name) != -1 && g_Name != msg.from)
    853         msg.text = msg.text.replace(new RegExp('\\b' + '\\' + g_Name + '\\b', "g"), colorPlayerName(g_Name));
    854 
     852    if (name != msg.from)
     853        highlightPlayerName(msg,g_Name);
     854   
    855855    // Run spam test if it's not a historical message
    856856    if (!msg.datetime)
    857857        updateSpamMonitor(msg.from);
  • binaries/data/mods/public/gui/session/functions_utility_chat.js

     
     1//-------------------------------- --------------------------------
     2// Chat utility functions
     3//-------------------------------- --------------------------------
     4
     5// Highlight the player name
     6function highlightPlayerName(msg,name)
     7{
     8        msg.text = msg.text.replace(name, colorPlayerName(name));
     9}
     10 No newline at end of file