From 1c5736310604c2d48d06eae1c02d1638d752177c Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 16 May 2016 22:46:22 +0300 Subject: [PATCH] Fix notifications in queries, limit message highlights to channels --- client/css/style.css | 6 +++--- client/js/lounge.js | 3 +-- client/themes/morning.css | 4 ++-- client/themes/zenburn.css | 4 ++-- src/plugins/irc-events/message.js | 9 ++++++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index cd071a0c..ea795eda 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -868,9 +868,9 @@ button, #chat .error, #chat .error .from, -#chat .highlight .from, -#chat .highlight .text, -#chat .highlight .user { +#chat .channel .highlight .from, +#chat .channel .highlight .text, +#chat .channel .highlight .user { color: #f00; } diff --git a/client/js/lounge.js b/client/js/lounge.js index 41dd41a2..dfda1120 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -827,8 +827,7 @@ $(function() { } } - button = button.filter(":not(.active)"); - if (button.length === 0) { + if (button.hasClass("active")) { return; } diff --git a/client/themes/morning.css b/client/themes/morning.css index 4cf15e70..e3f6cd12 100644 --- a/client/themes/morning.css +++ b/client/themes/morning.css @@ -163,8 +163,8 @@ QUIT #d0907d #chat .error, #chat .error .from, -#chat .highlight, -#chat .highlight .from { +#chat .channel .highlight, +#chat .channel .highlight .from { color: #f92772; } diff --git a/client/themes/zenburn.css b/client/themes/zenburn.css index e92187f9..66ef603e 100644 --- a/client/themes/zenburn.css +++ b/client/themes/zenburn.css @@ -193,8 +193,8 @@ body { #chat .error, #chat .error .from, -#chat .highlight, -#chat .highlight .from { +#chat .channel .highlight, +#chat .channel .highlight .from { color: #bc6c4c; } diff --git a/src/plugins/irc-events/message.js b/src/plugins/irc-events/message.js index 65e0bcb1..98c7c52a 100644 --- a/src/plugins/irc-events/message.js +++ b/src/plugins/irc-events/message.js @@ -46,7 +46,6 @@ module.exports = function(irc, network) { if (data.type === Msg.Type.NOTICE) { chan = network.channels[0]; } else { - highlight = !self; chan = new Chan({ type: Chan.Type.QUERY, name: target @@ -58,10 +57,14 @@ module.exports = function(irc, network) { }); } } + + // Query messages (unless self) always highlight + if (chan.type === Chan.Type.QUERY) { + highlight = !self; + } } - // Query messages (unless self) always highlight - // Self messages are never highlighted + // Self messages in channels are never highlighted // Non-self messages are highlighted as soon as the nick is detected if (!highlight && !self) { highlight = network.highlightRegex.test(data.message);