Fix #156: Make sure self messages are never highlighted
This commit is contained in:
parent
c4d628db49
commit
977b48649b
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user