Merge branch 'development' of github.com:prawnsalad/KiwiIRC into development
authorDarren <darren@darrenwhitlen.com>
Thu, 29 May 2014 20:55:51 +0000 (21:55 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 29 May 2014 20:55:51 +0000 (21:55 +0100)
# By tonymke
# Via tonymke (4) and Darren (1)
* 'development' of github.com:prawnsalad/KiwiIRC:
  Do not highlight the user's own messages/actions.
  Send nick with messages to channels.

client/src/views/channel.js

index 04639f3bff707bf1f3fd9db8eebed98799a9fdbe..3819ddf29c921410c9caacf389ab5f75c634b80e 100644 (file)
@@ -62,9 +62,13 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({
             network, hour, pm;
 
         // Nick highlight detecting
-        if ((new RegExp('(^|\\W)(' + escapeRegex(_kiwi.app.connections.active_connection.get('nick')) + ')(\\W|$)', 'i')).test(msg.msg)) {
-            is_highlight = true;
-            msg_css_classes += ' highlight';
+        var nick = _kiwi.app.connections.active_connection.get('nick');
+        if ((new RegExp('(^|\\W)(' + escapeRegex(nick) + ')(\\W|$)', 'i')).test(msg.msg)) {
+            // Do not highlight the user's own input
+            if (msg.nick.localeCompare(nick) !== 0) {
+                is_highlight = true;
+                msg_css_classes += ' highlight';
+            }
         }
 
         // Escape any HTML that may be in here