Clear user lists on all channels when disconnected from network

This commit is contained in:
Pavel Djundik 2018-08-24 11:29:03 +03:00 committed by Pavel Djundik
parent 839b07fdc2
commit 7c8441a93b
2 changed files with 5 additions and 1 deletions

View File

@ -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;
});
}
});

View File

@ -92,6 +92,7 @@ module.exports = function(irc, network) {
}
network.channels.forEach((chan) => {
chan.users = new Map();
chan.state = Chan.State.PARTED;
});