Do not highlight the user's own messages/actions.
authortonymke <tony.lechner@gmail.com>
Mon, 5 May 2014 04:36:49 +0000 (23:36 -0500)
committertonymke <tony.lechner@gmail.com>
Mon, 5 May 2014 04:36:49 +0000 (23:36 -0500)
client/src/views/channel.js

index 24f9397508ec1968d9cc71b5e4d1665606b98d8f..0b506a70d221423c07e52bf1fa2dbed3df8371f8 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