Skip to content

Commit

Permalink
Fix notifications in queries, limit message highlights to channels
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed May 16, 2016
1 parent e6990e0 commit 1c57363
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions client/css/style.css
Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions client/js/lounge.js
Expand Up @@ -827,8 +827,7 @@ $(function() {
}
}

button = button.filter(":not(.active)");
if (button.length === 0) {
if (button.hasClass("active")) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions client/themes/morning.css
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions client/themes/zenburn.css
Expand Up @@ -193,8 +193,8 @@ body {

#chat .error,
#chat .error .from,
#chat .highlight,
#chat .highlight .from {
#chat .channel .highlight,
#chat .channel .highlight .from {
color: #bc6c4c;
}

Expand Down
9 changes: 6 additions & 3 deletions src/plugins/irc-events/message.js
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 1c57363

Please sign in to comment.