Added channel show/hide system
This commit is contained in:
parent
e337177315
commit
836847a9f1
1 changed files with 20 additions and 0 deletions
|
@ -327,6 +327,8 @@ class ConnectionCommandHandler {
|
||||||
this["channellist"] = this.handleCommandChannelList;
|
this["channellist"] = this.handleCommandChannelList;
|
||||||
this["notifychannelcreated"] = this.handleCommandChannelCreate;
|
this["notifychannelcreated"] = this.handleCommandChannelCreate;
|
||||||
this["notifychanneldeleted"] = this.handleCommandChannelDelete;
|
this["notifychanneldeleted"] = this.handleCommandChannelDelete;
|
||||||
|
this["notifychannelhide"] = this.handleCommandChannelHide;
|
||||||
|
this["notifychannelshow"] = this.handleCommandChannelShow;
|
||||||
|
|
||||||
this["notifycliententerview"] = this.handleCommandClientEnterView;
|
this["notifycliententerview"] = this.handleCommandClientEnterView;
|
||||||
this["notifyclientleftview"] = this.handleCommandClientLeftView;
|
this["notifyclientleftview"] = this.handleCommandClientLeftView;
|
||||||
|
@ -447,6 +449,10 @@ class ConnectionCommandHandler {
|
||||||
this.createChannelFromJson(json[0]);
|
this.createChannelFromJson(json[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleCommandChannelShow(json) {
|
||||||
|
this.createChannelFromJson(json[0]); //TODO may chat?
|
||||||
|
}
|
||||||
|
|
||||||
handleCommandChannelDelete(json) {
|
handleCommandChannelDelete(json) {
|
||||||
let tree = this.connection._client.channelTree;
|
let tree = this.connection._client.channelTree;
|
||||||
|
|
||||||
|
@ -461,6 +467,20 @@ class ConnectionCommandHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleCommandChannelHide(json) {
|
||||||
|
let tree = this.connection._client.channelTree;
|
||||||
|
|
||||||
|
console.log("Got " + json.length + " channel hides");
|
||||||
|
for(let index = 0; index < json.length; index++) {
|
||||||
|
let channel = tree.findChannel(json[index]["cid"]);
|
||||||
|
if(!channel) {
|
||||||
|
console.error("Invalid channel on hide (Unknown channel)");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
tree.deleteChannel(channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleCommandClientEnterView(json) {
|
handleCommandClientEnterView(json) {
|
||||||
json = json[0]; //Only one bulk
|
json = json[0]; //Only one bulk
|
||||||
let tree = this.connection._client.channelTree;
|
let tree = this.connection._client.channelTree;
|
||||||
|
|
Loading…
Add table
Reference in a new issue