From 38c0c343c3fa934d57fc7b687fa0acd9731b4677 Mon Sep 17 00:00:00 2001 From: Bradley Shaw Date: Sat, 19 Jun 2021 19:49:04 +0100 Subject: [PATCH] Send server->channel notices to the relevant channel --- src/plugins/irc-events/message.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/irc-events/message.js b/src/plugins/irc-events/message.js index 664227c2..cb4818a3 100644 --- a/src/plugins/irc-events/message.js +++ b/src/plugins/irc-events/message.js @@ -51,8 +51,13 @@ module.exports = function (irc, network) { return Helper.compareHostmask(entry, data); }); - // Server messages go to server window, no questions asked - if (data.from_server) { + // Server messages that aren't targeted at a channel go to the server window + if ( + data.from_server && + (!data.target || + !network.getChannel(data.target) || + network.getChannel(data.target).type !== Chan.Type.CHANNEL) + ) { chan = network.channels[0]; from = chan.getUser(data.nick); } else {