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,48 +907,52 @@ 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(json["reasonid"] == ViewReasonId.VREASON_USER_ACTION) {
|
||||
if(own_channel == channel)
|
||||
if(old_channel)
|
||||
sound.play(Sound.USER_ENTERED);
|
||||
else
|
||||
sound.play(Sound.USER_ENTERED_CONNECT);
|
||||
if(old_channel) {
|
||||
chat.serverChat().appendMessage(tr("{0} appeared from {1} to {2}"), true, client.createChatTag(true), old_channel.generate_tag(true), channel.generate_tag(true));
|
||||
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)
|
||||
sound.play(Sound.USER_ENTERED);
|
||||
else
|
||||
sound.play(Sound.USER_ENTERED_CONNECT);
|
||||
if(old_channel) {
|
||||
chat.serverChat().appendMessage(tr("{0} appeared from {1} to {2}"), true, client.createChatTag(true), old_channel.generate_tag(true), channel.generate_tag(true));
|
||||
} else {
|
||||
chat.serverChat().appendMessage(tr("{0} connected to channel {1}"), true, client.createChatTag(true), channel.generate_tag(true));
|
||||
}
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_MOVED) {
|
||||
if(own_channel == channel)
|
||||
sound.play(Sound.USER_ENTERED_MOVED);
|
||||
|
||||
chat.serverChat().appendMessage(tr("{0} appeared from {1} to {2}, moved by {3}"), true,
|
||||
client.createChatTag(true),
|
||||
old_channel ? old_channel.generate_tag(true) : undefined,
|
||||
channel.generate_tag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_CHANNEL_KICK) {
|
||||
if(own_channel == channel)
|
||||
sound.play(Sound.USER_ENTERED_KICKED);
|
||||
|
||||
chat.serverChat().appendMessage(tr("{0} appeared from {1} to {2}, kicked by {3}{4}"), true,
|
||||
client.createChatTag(true),
|
||||
old_channel ? old_channel.generate_tag(true) : undefined,
|
||||
channel.generate_tag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] > 0 ? " (" + json["msg"] + ")" : ""
|
||||
);
|
||||
} else {
|
||||
chat.serverChat().appendMessage(tr("{0} connected to channel {1}"), true, client.createChatTag(true), channel.generate_tag(true));
|
||||
console.warn(tr("Unknown reasonid for %o"), json["reasonid"]);
|
||||
}
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_MOVED) {
|
||||
if(own_channel == channel)
|
||||
sound.play(Sound.USER_ENTERED_MOVED);
|
||||
|
||||
chat.serverChat().appendMessage(tr("{0} appeared from {1} to {2}, moved by {3}"), true,
|
||||
client.createChatTag(true),
|
||||
old_channel ? old_channel.generate_tag(true) : undefined,
|
||||
channel.generate_tag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_CHANNEL_KICK) {
|
||||
if(own_channel == channel)
|
||||
sound.play(Sound.USER_ENTERED_KICKED);
|
||||
|
||||
chat.serverChat().appendMessage(tr("{0} appeared from {1} to {2}, kicked by {3}{4}"), true,
|
||||
client.createChatTag(true),
|
||||
old_channel ? old_channel.generate_tag(true) : undefined,
|
||||
channel.generate_tag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] > 0 ? " (" + json["msg"] + ")" : ""
|
||||
);
|
||||
} else {
|
||||
console.warn(tr("Unknown reasonid for %o"), json["reasonid"]);
|
||||
}
|
||||
|
||||
let updates: {
|
||||
|
@ -995,58 +999,59 @@ class ConnectionCommandHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
const own_channel = this.connection._client.getClient().currentChannel();
|
||||
let channel_from = tree.findChannel(json["cfid"]);
|
||||
let channel_to = tree.findChannel(json["ctid"]);
|
||||
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));
|
||||
|
||||
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));
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_SERVER_LEFT) {
|
||||
chat.serverChat().appendMessage(tr("{0} left the server{1}"), true,
|
||||
client.createChatTag(true),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_SERVER_LEFT) {
|
||||
chat.serverChat().appendMessage(tr("{0} left the server{1}"), true,
|
||||
client.createChatTag(true),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_DISCONNECT);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_SERVER_KICK) {
|
||||
chat.serverChat().appendError(tr("{0} was kicked from the server by {1}.{2}"),
|
||||
client.createChatTag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_KICKED_SERVER);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_CHANNEL_KICK) {
|
||||
chat.serverChat().appendError(tr("{0} was kicked from your channel by {1}.{2}"),
|
||||
client.createChatTag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_DISCONNECT);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_SERVER_KICK) {
|
||||
chat.serverChat().appendError(tr("{0} was kicked from the server by {1}.{2}"),
|
||||
client.createChatTag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_KICKED_SERVER);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_CHANNEL_KICK) {
|
||||
chat.serverChat().appendError(tr("{0} was kicked from your channel by {1}.{2}"),
|
||||
client.createChatTag(true),
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_KICKED_CHANNEL);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_BAN) {
|
||||
//"Mulus" was banned for 1 second from the server by "WolverinDEV" (Sry brauchte kurz ein opfer :P <3 (Nohomo))
|
||||
let duration = "permanently";
|
||||
if(json["bantime"])
|
||||
duration = "for " + formatDate(Number.parseInt(json["bantime"]));
|
||||
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_KICKED_CHANNEL);
|
||||
} else if(json["reasonid"] == ViewReasonId.VREASON_BAN) {
|
||||
//"Mulus" was banned for 1 second from the server by "WolverinDEV" (Sry brauchte kurz ein opfer :P <3 (Nohomo))
|
||||
let duration = "permanently";
|
||||
if(json["bantime"])
|
||||
duration = "for " + formatDate(Number.parseInt(json["bantime"]));
|
||||
chat.serverChat().appendError(tr("{0} was banned {1} by {2}.{3}"),
|
||||
client.createChatTag(true),
|
||||
duration,
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
|
||||
chat.serverChat().appendError(tr("{0} was banned {1} by {2}.{3}"),
|
||||
client.createChatTag(true),
|
||||
duration,
|
||||
ClientEntry.chatTag(json["invokerid"], json["invokername"], json["invokeruid"]),
|
||||
json["reasonmsg"] ? " (" + json["reasonmsg"] + ")" : ""
|
||||
);
|
||||
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_BANNED);
|
||||
} else {
|
||||
console.error(tr("Unknown client left reason!"));
|
||||
if(channel_from == own_channel)
|
||||
sound.play(Sound.USER_LEFT_BANNED);
|
||||
} 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