Merge pull request #4277 from hellomouse/server-privmsg-fix
Fix nick-less messages from servers
This commit is contained in:
commit
75cf4445c4
@ -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 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user