From 440076db2df921ae130d08a9626b928f48981c48 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 25 Apr 2020 17:42:18 +0200 Subject: [PATCH] Fixed missing channel tree update on talk power change --- ChangeLog.md | 3 +++ shared/js/ui/channel.ts | 2 +- shared/js/ui/tree/View.tsx | 12 ++++++++++-- shared/js/ui/view.tsx | 16 +++++++++++++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8a653c29..9326f41c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,7 @@ # Changelog: +* **25.04.20** + - Fixed missing channel tree update on talk power change + * **21.04.20** - Clicking on the music bot does not longer results in the insufficient permission sound when the client has no permissions - Fixed permission editor overflow diff --git a/shared/js/ui/channel.ts b/shared/js/ui/channel.ts index 85a42f89..a0a6d9bb 100644 --- a/shared/js/ui/channel.ts +++ b/shared/js/ui/channel.ts @@ -55,7 +55,7 @@ export class ChannelProperties { channel_maxclients: number = -1; channel_maxfamilyclients: number = -1; - channel_needed_talk_power: number = 1; + channel_needed_talk_power: number = 0; channel_flag_permanent: boolean = false; channel_flag_semi_permanent: boolean = false; diff --git a/shared/js/ui/tree/View.tsx b/shared/js/ui/tree/View.tsx index 20201f83..fc338044 100644 --- a/shared/js/ui/tree/View.tsx +++ b/shared/js/ui/tree/View.tsx @@ -14,7 +14,7 @@ import {ChannelEntryView as ChannelEntryView} from "./Channel"; import {ServerEntry as ServerEntryView} from "./Server"; import {ClientEntry as ClientEntryView} from "./Client"; -import {ChannelEntry} from "tc-shared/ui/channel"; +import {ChannelEntry, ChannelEvents} from "tc-shared/ui/channel"; import {ServerEntry} from "tc-shared/ui/server"; import {ClientEntry, ClientType} from "tc-shared/ui/client"; @@ -54,6 +54,8 @@ export class ChannelTreeView extends ReactComponentBase this.handleTreeUpdate(); this.listener_channel_change = () => this.handleTreeUpdate(); this.listener_state_collapsed = () => this.handleTreeUpdate(); + this.listener_channel_properties = (event: ChannelEvents["notify_properties_updated"]) => { + if(typeof event.updated_properties.channel_needed_talk_power !== "undefined") /* talk power flags have changed */ + this.handleTreeUpdate(); + }; this.document_mouse_listener = (e: MouseEvent) => { if(e.type !== "mouseleave" && e.button !== 0) @@ -183,6 +189,7 @@ export class ChannelTreeView extends ReactComponentBase { + this.selection.clear_selection(); + createInputModal(tr("Poke clients"), tr("Poke message:
"), text => true, result => { + if (result) { + const elements = clients.map(e => { return { clid: e.clientId() } as any }); + elements[0].msg = result; + this.client.serverConnection.send_command("clientpoke", elements); + } + }, {width: 400, maxLength: 255}).open(); + } + }, { type: contextmenu.MenuEntryType.ENTRY, icon_class: "client-kick_server", name: tr("Kick clients fom server"),