From 3da870be8cee3c75e0b65a3950caea8cebea0a3a Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 22 Feb 2018 11:01:49 +0200 Subject: [PATCH] Send empty banlist error to lobby for channels user is not in --- src/plugins/irc-events/banlist.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/irc-events/banlist.js b/src/plugins/irc-events/banlist.js index 9ffe014f..a0ee92b9 100644 --- a/src/plugins/irc-events/banlist.js +++ b/src/plugins/irc-events/banlist.js @@ -16,7 +16,16 @@ module.exports = function(irc, network) { type: Msg.Type.ERROR, text: "Banlist empty", }); - network.getChannel(channel).pushMessage(client, msg, true); + let chan = network.getChannel(channel); + + // Send error to lobby if we receive banlist for a channel we're not in + if (typeof chan === "undefined") { + msg.showInActive = true; + chan = network.channels[0]; + } + + chan.pushMessage(client, msg, true); + return; }