Make sure highlight lookup stops as soon as a candidate is detected
This commit is contained in:
parent
977b48649b
commit
6a6c41732d
@ -38,14 +38,11 @@ module.exports = function(irc, network) {
|
||||
|
||||
var self = (data.from.toLowerCase() === irc.me.toLowerCase());
|
||||
|
||||
var highlight = false;
|
||||
if (!self) { // Self messages should never be highlighted
|
||||
textSplit.forEach(function(w) {
|
||||
if (w.replace(/^@/, "").toLowerCase().indexOf(irc.me.toLowerCase()) === 0) {
|
||||
highlight = true;
|
||||
}
|
||||
// Self messages are never highlighted
|
||||
// Non-self messages are highlighted as soon as the nick is detected
|
||||
var highlight = !self && textSplit.some(function(w) {
|
||||
return (w.replace(/^@/, "").toLowerCase().indexOf(irc.me.toLowerCase()) === 0);
|
||||
});
|
||||
}
|
||||
|
||||
if (chan.id !== client.activeChannel) {
|
||||
chan.unread++;
|
||||
|
Loading…
Reference in New Issue
Block a user