Merge pull request #4277 from hellomouse/server-privmsg-fix

Fix nick-less messages from servers
This commit is contained in:
Max Leiter 2021-07-06 01:02:18 -07:00 committed by GitHub
commit 75cf4445c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,12 +11,6 @@ module.exports = function (irc, network) {
const client = this; const client = this;
irc.on("notice", function (data) { 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; data.type = Msg.Type.NOTICE;
handleMessage(data); handleMessage(data);
}); });
@ -44,6 +38,12 @@ module.exports = function (irc, network) {
let showInActive = false; let showInActive = false;
const self = data.nick === irc.user.nick; 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 // Check if the sender is in our ignore list
const shouldIgnore = const shouldIgnore =
!self && !self &&