Send server->channel notices to the relevant channel

This commit is contained in:
Bradley Shaw 2021-06-19 19:49:04 +01:00
parent 53b7c46e69
commit 38c0c343c3
No known key found for this signature in database
GPG Key ID: 507CB03644778F8B

View File

@ -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 {