Fix #156: Make sure self messages are never highlighted

This commit is contained in:
Jérémie Astori 2016-03-07 01:09:42 -05:00
parent c4d628db49
commit 977b48649b

View File

@ -36,16 +36,15 @@ module.exports = function(irc, network) {
text = text.replace(/^\u0001ACTION|\u0001$/g, ""); text = text.replace(/^\u0001ACTION|\u0001$/g, "");
} }
var highlight = false; var self = (data.from.toLowerCase() === irc.me.toLowerCase());
textSplit.forEach(function(w) {
if (w.replace(/^@/, "").toLowerCase().indexOf(irc.me.toLowerCase()) === 0) {
highlight = true;
}
});
var self = false; var highlight = false;
if (data.from.toLowerCase() === irc.me.toLowerCase()) { if (!self) { // Self messages should never be highlighted
self = true; textSplit.forEach(function(w) {
if (w.replace(/^@/, "").toLowerCase().indexOf(irc.me.toLowerCase()) === 0) {
highlight = true;
}
});
} }
if (chan.id !== client.activeChannel) { if (chan.id !== client.activeChannel) {