Move server nick code to handleMessage
This commit is contained in:
parent
6439afd5c6
commit
16177eb9f4
@ -11,12 +11,6 @@ module.exports = function (irc, network) {
|
||||
const client = this;
|
||||
|
||||
irc.on("notice", function (data) {
|
||||
// Some servers send notices without any nickname
|
||||
if (!data.nick) {
|
||||
data.from_server = true;
|
||||
data.nick = data.hostname || network.host;
|
||||
}
|
||||
|
||||
data.type = Msg.Type.NOTICE;
|
||||
handleMessage(data);
|
||||
});
|
||||
@ -27,12 +21,6 @@ module.exports = function (irc, network) {
|
||||
});
|
||||
|
||||
irc.on("privmsg", function (data) {
|
||||
// Some servers send messages without any nickname
|
||||
if (!data.nick) {
|
||||
data.from_server = true;
|
||||
data.nick = data.hostname || network.host;
|
||||
}
|
||||
|
||||
data.type = Msg.Type.MESSAGE;
|
||||
handleMessage(data);
|
||||
});
|
||||
@ -50,6 +38,12 @@ module.exports = function (irc, network) {
|
||||
let showInActive = false;
|
||||
const self = data.nick === irc.user.nick;
|
||||
|
||||
// Some servers send messages without any nickname
|
||||
if (!data.nick) {
|
||||
data.from_server = true;
|
||||
data.nick = data.hostname || network.host;
|
||||
}
|
||||
|
||||
// Check if the sender is in our ignore list
|
||||
const shouldIgnore =
|
||||
!self &&
|
||||
|
Loading…
Reference in New Issue
Block a user