From 7c8441a93ba557c4269ec51d9762f9693881f145 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 24 Aug 2018 11:29:03 +0300 Subject: [PATCH] Clear user lists on all channels when disconnected from network --- client/js/socket-events/network.js | 5 ++++- src/plugins/irc-events/connection.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/js/socket-events/network.js b/client/js/socket-events/network.js index db7bfccd..4f539512 100644 --- a/client/js/socket-events/network.js +++ b/client/js/socket-events/network.js @@ -37,7 +37,10 @@ socket.on("network:status", function(data) { network.status.secure = data.secure; if (!data.connected) { - network.channels.forEach((channel) => channel.state = 0); + network.channels.forEach((channel) => { + channel.users = []; + channel.state = 0; + }); } }); diff --git a/src/plugins/irc-events/connection.js b/src/plugins/irc-events/connection.js index 6a7368ff..b13b89d8 100644 --- a/src/plugins/irc-events/connection.js +++ b/src/plugins/irc-events/connection.js @@ -92,6 +92,7 @@ module.exports = function(irc, network) { } network.channels.forEach((chan) => { + chan.users = new Map(); chan.state = Chan.State.PARTED; });