Fixed query visibility setting
This commit is contained in:
parent
525d2ceb29
commit
fea3819024
4 changed files with 100 additions and 92 deletions
|
@ -7,6 +7,7 @@
|
|||
- Improved error handling within the codecs
|
||||
- Fixed the vertical sliders for touch devices
|
||||
- Added an effect on slider select/move
|
||||
- Fixed query visibility setting
|
||||
|
||||
* **15.02.19**
|
||||
- Fixed MS Edge loading/document issues
|
||||
|
|
|
@ -907,14 +907,17 @@ class ConnectionCommandHandler {
|
|||
} else {
|
||||
client = new ClientEntry(parseInt(json["clid"]), json["client_nickname"]);
|
||||
}
|
||||
|
||||
client.properties.client_type = parseInt(json["client_type"]);
|
||||
client = tree.insertClient(client, channel);
|
||||
} else {
|
||||
if(client == this.connection._client.getClient())
|
||||
chat.channelChat().name = channel.channelName();
|
||||
tree.moveClient(client, channel);
|
||||
}
|
||||
const own_channel = this.connection._client.getClient().currentChannel();
|
||||
|
||||
if(this.connection._client.controlBar.query_visible || client.properties.client_type != ClientType.CLIENT_QUERY) {
|
||||
const own_channel = this.connection._client.getClient().currentChannel();
|
||||
if(json["reasonid"] == ViewReasonId.VREASON_USER_ACTION) {
|
||||
if(own_channel == channel)
|
||||
if(old_channel)
|
||||
|
@ -950,6 +953,7 @@ class ConnectionCommandHandler {
|
|||
} else {
|
||||
console.warn(tr("Unknown reasonid for %o"), json["reasonid"]);
|
||||
}
|
||||
}
|
||||
|
||||
let updates: {
|
||||
key: string,
|
||||
|
@ -995,11 +999,11 @@ class ConnectionCommandHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
if(this.connection._client.controlBar.query_visible || client.properties.client_type != ClientType.CLIENT_QUERY) {
|
||||
const own_channel = this.connection._client.getClient().currentChannel();
|
||||
let channel_from = tree.findChannel(json["cfid"]);
|
||||
let channel_to = tree.findChannel(json["ctid"]);
|
||||
|
||||
|
||||
if(json["reasonid"] == ViewReasonId.VREASON_USER_ACTION) {
|
||||
chat.serverChat().appendMessage(tr("{0} disappeared from {1} to {2}"), true, client.createChatTag(true), channel_from.generate_tag(true), channel_to.generate_tag(true));
|
||||
|
||||
|
@ -1048,6 +1052,7 @@ class ConnectionCommandHandler {
|
|||
} else {
|
||||
console.error(tr("Unknown client left reason!"));
|
||||
}
|
||||
}
|
||||
|
||||
tree.deleteClient(client);
|
||||
}
|
||||
|
|
|
@ -96,9 +96,9 @@ class ControlBar {
|
|||
}
|
||||
|
||||
//Need an initialise
|
||||
this.muteInput = settings.global("mute_input") == "1";
|
||||
this.muteOutput = settings.global("mute_output") == "1";
|
||||
this.query_visibility = settings.global("show_server_queries") == "1";
|
||||
this.muteInput = settings.static_global("mute_input", false);
|
||||
this.muteOutput = settings.static_global("mute_output", false);
|
||||
this.query_visible = settings.static_global("show_server_queries", false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -412,21 +412,22 @@ class ControlBar {
|
|||
Modals.spawnBookmarkModal();
|
||||
}
|
||||
|
||||
get query_visibility() {
|
||||
get query_visible() {
|
||||
return this._query_visible;
|
||||
}
|
||||
|
||||
set query_visibility(flag: boolean) {
|
||||
set query_visible(flag: boolean) {
|
||||
console.error(flag);
|
||||
if(this._query_visible == flag) return;
|
||||
|
||||
this._query_visible = flag;
|
||||
settings.global("show_server_queries", flag);
|
||||
settings.changeGlobal("show_server_queries", flag);
|
||||
this.update_query_visibility_button();
|
||||
this.handle.channelTree.toggle_server_queries(flag);
|
||||
}
|
||||
|
||||
private on_query_visibility_toggle() {
|
||||
this.query_visibility = !this._query_visible;
|
||||
this.query_visible = !this._query_visible;
|
||||
this.update_query_visibility_button();
|
||||
}
|
||||
|
||||
|
|
|
@ -295,15 +295,17 @@ class ChannelTree {
|
|||
else
|
||||
this.clients.push(client);
|
||||
|
||||
if(!this._show_queries && client.properties.client_type == ClientType.CLIENT_QUERY)
|
||||
client.tag.hide();
|
||||
|
||||
client.channelTree = this;
|
||||
client["_channel"] = channel;
|
||||
|
||||
let tag = client.tag;
|
||||
if(!this._tree_detached)
|
||||
tag.css({display: "none"}).fadeIn("slow");
|
||||
|
||||
|
||||
if(!this._show_queries && client.properties.client_type == ClientType.CLIENT_QUERY)
|
||||
client.tag.hide();
|
||||
else if(!this._tree_detached)
|
||||
tag.css("display", "none").fadeIn("slow");
|
||||
|
||||
tag.appendTo(channel.clientTag());
|
||||
client.currentChannel().reorderClients();
|
||||
|
||||
|
@ -730,7 +732,6 @@ class ChannelTree {
|
|||
if(this._show_queries == flag) return;
|
||||
this._show_queries = flag;
|
||||
|
||||
//FIXME resize channels
|
||||
const channels: ChannelEntry[] = []
|
||||
for(const client of this.clients)
|
||||
if(client.properties.client_type == ClientType.CLIENT_QUERY) {
|
||||
|
|
Loading…
Add table
Reference in a new issue