diff --git a/client/components/Channel.vue b/client/components/Channel.vue
index 1b0ac948..a61396c6 100644
--- a/client/components/Channel.vue
+++ b/client/components/Channel.vue
@@ -6,6 +6,7 @@
{{ channel.name }}
+ (parted)
n.uuid === data.network);
network.status.connected = data.connected;
network.status.secure = data.secure;
+
+ if (!data.connected) {
+ network.channels.forEach((channel) => channel.state = 0);
+ }
+});
+
+socket.on("channel:state", function(data) {
+ const channel = findChannel(data.chan);
+
+ if (channel) {
+ channel.channel.state = data.state;
+ }
});
socket.on("network:info", function(data) {
diff --git a/src/plugins/irc-events/join.js b/src/plugins/irc-events/join.js
index 304fba83..7181f88f 100644
--- a/src/plugins/irc-events/join.js
+++ b/src/plugins/irc-events/join.js
@@ -29,6 +29,11 @@ module.exports = function(irc, network) {
network.irc.raw("MODE", chan.name);
} else if (data.nick === irc.user.nick) {
chan.state = Chan.State.JOINED;
+
+ client.emit("channel:state", {
+ chan: chan.id,
+ state: chan.state,
+ });
}
const user = new User({nick: data.nick});
diff --git a/src/plugins/irc-events/kick.js b/src/plugins/irc-events/kick.js
index c4d3a27c..3cd2590f 100644
--- a/src/plugins/irc-events/kick.js
+++ b/src/plugins/irc-events/kick.js
@@ -27,6 +27,11 @@ module.exports = function(irc, network) {
if (data.kicked === irc.user.nick) {
chan.users = new Map();
chan.state = Chan.State.PARTED;
+
+ client.emit("channel:state", {
+ chan: chan.id,
+ state: chan.state,
+ });
} else {
chan.removeUser(msg.target);
}