From 7feda9d2be399624663a63be5b67f57a026763cf Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Thu, 24 Sep 2020 22:16:08 +0200 Subject: [PATCH] Updated the icon and the favicon icon handler --- ChangeLog.md | 1 + shared/img/client-icons/client_hide.svg | 14 ------------- shared/img/client-icons/client_show.svg | 14 ------------- shared/img/client-icons/teaspeak_logo.svg | 20 ++++++++++++++++++ shared/img/favicon/speaking.png | Bin 3432 -> 0 bytes shared/js/tree/Client.ts | 24 ++++++++++++++++++++-- shared/svg-sprites/client-icons.d.ts | 7 +++---- web/app/ui/FaviconRenderer.tsx | 12 +++++------ web/audio-lib/src/lib.rs | 1 - 9 files changed, 51 insertions(+), 42 deletions(-) delete mode 100644 shared/img/client-icons/client_hide.svg delete mode 100644 shared/img/client-icons/client_show.svg create mode 100644 shared/img/client-icons/teaspeak_logo.svg delete mode 100644 shared/img/favicon/speaking.png diff --git a/ChangeLog.md b/ChangeLog.md index 119036c9..02071dbb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,7 @@ - Rendering the server icon - Changing the favicon according to the clients status - Aborting all replaying audio streams when client mutes himself + - Fixed issue [#139](https://github.com/TeaSpeak/TeaWeb/issues/139) * **17.09.20** - Added a settings registry and some minor bug fixing diff --git a/shared/img/client-icons/client_hide.svg b/shared/img/client-icons/client_hide.svg deleted file mode 100644 index f99b82bc..00000000 --- a/shared/img/client-icons/client_hide.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/shared/img/client-icons/client_show.svg b/shared/img/client-icons/client_show.svg deleted file mode 100644 index b1e3ad60..00000000 --- a/shared/img/client-icons/client_show.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/shared/img/client-icons/teaspeak_logo.svg b/shared/img/client-icons/teaspeak_logo.svg new file mode 100644 index 00000000..92f46cc6 --- /dev/null +++ b/shared/img/client-icons/teaspeak_logo.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/shared/img/favicon/speaking.png b/shared/img/favicon/speaking.png deleted file mode 100644 index 832c9752fec2b2b86b501cdc0ce50971944b63cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3432 zcmV-u4VUtXP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{01VJcL_t(|+U;FSY+P3v{_bmD z_SoZk>@*X%8LOowNt294fl^e(Rbjy@j>Hb3Bt>jkFtNm<3q&Yl(FKxY7G;4Tju1Pf zq-&^1RZ$95^|Wcz2NfQ->6rLYkL`Kh$2lzSb#UFecg~%;Gxv_?e3GTH?(ul$eBb$B z=LK+ZaBy&NaBy&NaP$|1gZQOV^SKOwG=L0%qt@%)9~R{I{44{=0mv1ynLHOjFbSUq zFb&|0MS7w`|Eg$-;S~Tk3fWAK3&20pX8@c9Fw;T8Sp;zdz)OW}<^~r)cSibopGj{f zhHHgv<|Y?_x5QrnkhRQvFCYhCzL3oDYs9DB{{2u`!ii)Q$HyWV4of(m zjAA$}-FyCxiNVjc|NEWNz1N>?tGKhHVykZ8_F4_^u2->LH(L1`c>vb{Tq$HTMJ@n$ zBmS}*;*TXGc;d()o=6Sg_*fJZ@sOvV>CTRd+iO+4UMS=BPfK`jz2;U3&j-;W2mvF0 z8o(T@sedLtgl|m_;oFl#h=-)Ee%2k;z@L}4@t37-yqw>5;~Hjz6e9=$AwFRdf1z31 zM@J+0{>f21lkPt0PGWdDzl}fK+Q0`JOqOB65<;=>1z@FfSDQuk(?{d@-ic8>et00z zLDd^8W&H8o4cuJbVaXaU`kg)sK9Bm#R-k8#GY`fw`}IRe4TjK5D3nyp{o^iP`M9YN zu2}Iwv2O&Bn$M*HTzB&IQ-@-BHj~8Ep%{7@i+3ydeQq6#cPq_egL8hAngt)opSH+v zXz~X`BF>*o;=9L2aFFn)_cn3u);dZmadHXgx*Z@2T_*p6=Um2 z0-?j?+nW8O!y)|in<>N;5&evcM)1qO6|lUe`r-}*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rDfV1pu>tjrza|U|)bZ2gZ8}Q*i}H216JhP`bVcp`sD2mNk4@ zQc>8^SpO_%5q~o%eICf9+e#NN!^LG)iHL;pn1b;E86y$dbL&vn2sUdvR?9k8D;kP5 z!_A-PEkC~yw7w2()x~lPm*BAXzzHEqz(_ { readonly events: Registry; readonly view: React.RefObject = React.createRef(); @@ -207,6 +218,16 @@ export class ClientEntry extends ChannelTreeEntry { this._channel = null; this.voiceCallbackStateChanged = this.handleVoiceStateChange.bind(this); + + this.events.on(["notify_speak_state_change", "notify_mute_state_change"], () => this.events.fire_async("notify_status_icon_changed", { newIcon: this.getStatusIcon() })); + this.events.on("notify_properties_updated", event => { + for (const key of StatusIconUpdateKeys) { + if (key in event.updated_properties) { + this.events.fire_async("notify_status_icon_changed", { newIcon: this.getStatusIcon() }) + return; + } + } + }); } destroy() { @@ -218,6 +239,7 @@ export class ClientEntry extends ChannelTreeEntry { } this._channel = undefined; + this.events.destroy(); } setVoiceClient(handle: VoiceClient) { @@ -596,8 +618,6 @@ export class ClientEntry extends ChannelTreeEntry { callback: () => { createInputModal(tr("Change client description"), tr("New description:
"), () => true, result => { if(typeof(result) === "string") { - //TODO tr - console.log("Changing " + this.clientNickName() + "'s description to " + result); this.channelTree.client.serverConnection.send_command("clientedit", { clid: this.clientId(), client_description: result diff --git a/shared/svg-sprites/client-icons.d.ts b/shared/svg-sprites/client-icons.d.ts index d6d53744..bd13164f 100644 --- a/shared/svg-sprites/client-icons.d.ts +++ b/shared/svg-sprites/client-icons.d.ts @@ -3,9 +3,9 @@ * * This file has been auto generated by the svg-sprite generator. * Sprite source directory: D:\TeaSpeak\web\shared\img\client-icons - * Sprite count: 202 + * Sprite count: 201 */ -export type ClientIconClass = "client-about" | "client-activate_microphone" | "client-add" | "client-add_foe" | "client-add_folder" | "client-add_friend" | "client-addon-collection" | "client-addon" | "client-apply" | "client-arrow_down" | "client-arrow_left" | "client-arrow_right" | "client-arrow_up" | "client-away" | "client-ban_client" | "client-ban_list" | "client-bookmark_add" | "client-bookmark_add_folder" | "client-bookmark_duplicate" | "client-bookmark_manager" | "client-bookmark_remove" | "client-broken_image" | "client-browse-addon-online" | "client-capture" | "client-change_nickname" | "client-changelog" | "client-channel_chat" | "client-channel_collapse_all" | "client-channel_commander" | "client-channel_create" | "client-channel_create_sub" | "client-channel_default" | "client-channel_delete" | "client-channel_edit" | "client-channel_expand_all" | "client-channel_green" | "client-channel_green_subscribed" | "client-channel_green_subscribed2" | "client-channel_private" | "client-channel_red" | "client-channel_red_subscribed" | "client-channel_switch" | "client-channel_unsubscribed" | "client-channel_yellow" | "client-channel_yellow_subscribed" | "client-check_update" | "client-client_hide" | "client-client_show" | "client-close_button" | "client-complaint_list" | "client-conflict-icon" | "client-connect" | "client-contact" | "client-copy" | "client-copy_url" | "client-d_sound" | "client-d_sound_me" | "client-d_sound_user" | "client-default" | "client-default_for_all_bookmarks" | "client-delete" | "client-delete_avatar" | "client-disconnect" | "client-down" | "client-download" | "client-edit" | "client-edit_friend_foe_status" | "client-emoticon" | "client-error" | "client-file_home" | "client-file_refresh" | "client-filetransfer" | "client-find" | "client-folder" | "client-folder_up" | "client-group_100" | "client-group_200" | "client-group_300" | "client-group_500" | "client-group_600" | "client-guisetup" | "client-hardware_input_muted" | "client-hardware_output_muted" | "client-home" | "client-hoster_button" | "client-hotkeys" | "client-icon-pack" | "client-iconsview" | "client-iconviewer" | "client-identity_default" | "client-identity_export" | "client-identity_import" | "client-identity_manager" | "client-info" | "client-input_muted" | "client-input_muted_local" | "client-invite_buddy" | "client-is_talker" | "client-kick_channel" | "client-kick_server" | "client-listview" | "client-loading_image" | "client-message_incoming" | "client-message_info" | "client-message_outgoing" | "client-messages" | "client-microphone_broken" | "client-minimize_button" | "client-moderated" | "client-move_client_to_own_channel" | "client-music" | "client-new_chat" | "client-notifications" | "client-offline_messages" | "client-on_whisperlist" | "client-output_muted" | "client-permission_channel" | "client-permission_client" | "client-permission_overview" | "client-permission_server_groups" | "client-phoneticsnickname" | "client-ping_1" | "client-ping_2" | "client-ping_3" | "client-ping_4" | "client-ping_calculating" | "client-ping_disconnected" | "client-play" | "client-player_chat" | "client-player_commander_off" | "client-player_commander_on" | "client-player_off" | "client-player_on" | "client-player_whisper" | "client-plugins" | "client-poke" | "client-present" | "client-recording_start" | "client-recording_stop" | "client-refresh" | "client-register" | "client-reload" | "client-remove_foe" | "client-remove_friend" | "client-security" | "client-selectfolder" | "client-send_complaint" | "client-server_green" | "client-server_log" | "client-server_query" | "client-settings" | "client-sort_by_name" | "client-sound-pack" | "client-soundpack" | "client-stop" | "client-subscribe_mode" | "client-subscribe_to_all_channels" | "client-subscribe_to_channel" | "client-subscribe_to_channel_family" | "client-switch_advanced" | "client-switch_standard" | "client-sync-disable" | "client-sync-enable" | "client-sync-icon" | "client-tab_close_button" | "client-talk_power_grant" | "client-talk_power_grant_next" | "client-talk_power_request" | "client-talk_power_request_cancel" | "client-talk_power_revoke" | "client-talk_power_revoke_all_grant_next" | "client-temp_server_password" | "client-temp_server_password_add" | "client-textformat" | "client-textformat_bold" | "client-textformat_foreground" | "client-textformat_italic" | "client-textformat_underline" | "client-theme" | "client-toggle_server_query_clients" | "client-toggle_whisper" | "client-token" | "client-token_use" | "client-translation" | "client-unsubscribe_from_all_channels" | "client-unsubscribe_from_channel_family" | "client-unsubscribe_mode" | "client-up" | "client-upload" | "client-upload_avatar" | "client-urlcatcher" | "client-user-account" | "client-virtualserver_edit" | "client-volume" | "client-w2g" | "client-warning" | "client-warning_external_link" | "client-warning_info" | "client-warning_question" | "client-weblist" | "client-whisper" | "client-whisperlists"; +export type ClientIconClass = "client-about" | "client-activate_microphone" | "client-add" | "client-add_foe" | "client-add_folder" | "client-add_friend" | "client-addon-collection" | "client-addon" | "client-apply" | "client-arrow_down" | "client-arrow_left" | "client-arrow_right" | "client-arrow_up" | "client-away" | "client-ban_client" | "client-ban_list" | "client-bookmark_add" | "client-bookmark_add_folder" | "client-bookmark_duplicate" | "client-bookmark_manager" | "client-bookmark_remove" | "client-broken_image" | "client-browse-addon-online" | "client-capture" | "client-change_nickname" | "client-changelog" | "client-channel_chat" | "client-channel_collapse_all" | "client-channel_commander" | "client-channel_create" | "client-channel_create_sub" | "client-channel_default" | "client-channel_delete" | "client-channel_edit" | "client-channel_expand_all" | "client-channel_green" | "client-channel_green_subscribed" | "client-channel_green_subscribed2" | "client-channel_private" | "client-channel_red" | "client-channel_red_subscribed" | "client-channel_switch" | "client-channel_unsubscribed" | "client-channel_yellow" | "client-channel_yellow_subscribed" | "client-check_update" | "client-close_button" | "client-complaint_list" | "client-conflict-icon" | "client-connect" | "client-contact" | "client-copy" | "client-copy_url" | "client-d_sound" | "client-d_sound_me" | "client-d_sound_user" | "client-default" | "client-default_for_all_bookmarks" | "client-delete" | "client-delete_avatar" | "client-disconnect" | "client-down" | "client-download" | "client-edit" | "client-edit_friend_foe_status" | "client-emoticon" | "client-error" | "client-file_home" | "client-file_refresh" | "client-filetransfer" | "client-find" | "client-folder" | "client-folder_up" | "client-group_100" | "client-group_200" | "client-group_300" | "client-group_500" | "client-group_600" | "client-guisetup" | "client-hardware_input_muted" | "client-hardware_output_muted" | "client-home" | "client-hoster_button" | "client-hotkeys" | "client-icon-pack" | "client-iconsview" | "client-iconviewer" | "client-identity_default" | "client-identity_export" | "client-identity_import" | "client-identity_manager" | "client-info" | "client-input_muted" | "client-input_muted_local" | "client-invite_buddy" | "client-is_talker" | "client-kick_channel" | "client-kick_server" | "client-listview" | "client-loading_image" | "client-message_incoming" | "client-message_info" | "client-message_outgoing" | "client-messages" | "client-microphone_broken" | "client-minimize_button" | "client-moderated" | "client-move_client_to_own_channel" | "client-music" | "client-new_chat" | "client-notifications" | "client-offline_messages" | "client-on_whisperlist" | "client-output_muted" | "client-permission_channel" | "client-permission_client" | "client-permission_overview" | "client-permission_server_groups" | "client-phoneticsnickname" | "client-ping_1" | "client-ping_2" | "client-ping_3" | "client-ping_4" | "client-ping_calculating" | "client-ping_disconnected" | "client-play" | "client-player_chat" | "client-player_commander_off" | "client-player_commander_on" | "client-player_off" | "client-player_on" | "client-player_whisper" | "client-plugins" | "client-poke" | "client-present" | "client-recording_start" | "client-recording_stop" | "client-refresh" | "client-register" | "client-reload" | "client-remove_foe" | "client-remove_friend" | "client-security" | "client-selectfolder" | "client-send_complaint" | "client-server_green" | "client-server_log" | "client-server_query" | "client-settings" | "client-sort_by_name" | "client-sound-pack" | "client-soundpack" | "client-stop" | "client-subscribe_mode" | "client-subscribe_to_all_channels" | "client-subscribe_to_channel" | "client-subscribe_to_channel_family" | "client-switch_advanced" | "client-switch_standard" | "client-sync-disable" | "client-sync-enable" | "client-sync-icon" | "client-tab_close_button" | "client-talk_power_grant" | "client-talk_power_grant_next" | "client-talk_power_request" | "client-talk_power_request_cancel" | "client-talk_power_revoke" | "client-talk_power_revoke_all_grant_next" | "client-teaspeak_logo" | "client-temp_server_password" | "client-temp_server_password_add" | "client-textformat" | "client-textformat_bold" | "client-textformat_foreground" | "client-textformat_italic" | "client-textformat_underline" | "client-theme" | "client-toggle_server_query_clients" | "client-toggle_whisper" | "client-token" | "client-token_use" | "client-translation" | "client-unsubscribe_from_all_channels" | "client-unsubscribe_from_channel_family" | "client-unsubscribe_mode" | "client-up" | "client-upload" | "client-upload_avatar" | "client-urlcatcher" | "client-user-account" | "client-virtualserver_edit" | "client-volume" | "client-w2g" | "client-warning" | "client-warning_external_link" | "client-warning_info" | "client-warning_question" | "client-weblist" | "client-whisper" | "client-whisperlists"; export enum ClientIcon { About = "client-about", @@ -54,8 +54,6 @@ export enum ClientIcon { ChannelYellow = "client-channel_yellow", ChannelYellowSubscribed = "client-channel_yellow_subscribed", CheckUpdate = "client-check_update", - ClientHide = "client-client_hide", - ClientShow = "client-client_show", CloseButton = "client-close_button", ComplaintList = "client-complaint_list", ConflictIcon = "client-conflict-icon", @@ -179,6 +177,7 @@ export enum ClientIcon { TalkPowerRequestCancel = "client-talk_power_request_cancel", TalkPowerRevoke = "client-talk_power_revoke", TalkPowerRevokeAllGrantNext = "client-talk_power_revoke_all_grant_next", + TeaspeakLogo = "client-teaspeak_logo", TempServerPassword = "client-temp_server_password", TempServerPasswordAdd = "client-temp_server_password_add", Textformat = "client-textformat", diff --git a/web/app/ui/FaviconRenderer.tsx b/web/app/ui/FaviconRenderer.tsx index 46fb0e69..c08f549c 100644 --- a/web/app/ui/FaviconRenderer.tsx +++ b/web/app/ui/FaviconRenderer.tsx @@ -2,9 +2,8 @@ import * as loader from "tc-loader"; import {Stage} from "tc-loader"; import {ConnectionHandler, ConnectionState} from "tc-shared/ConnectionHandler"; import * as React from "react"; -import {useState} from "react"; import * as ReactDOM from "react-dom"; -import {ClientStatusIndicator} from "tc-shared/ui/tree/Client"; +import {useState} from "react"; import {server_connections} from "tc-shared/ConnectionManager"; import { @@ -67,12 +66,11 @@ const HandlerFaviconRenderer = (props: { connection: ConnectionHandler }) => { const [ showClientStatus, setShowClientStatus ] = useState(props.connection.connection_state === ConnectionState.CONNECTED); props.connection.events().reactUse("notify_connection_state_changed", event => setShowClientStatus(event.new_state === ConnectionState.CONNECTED)); + const [ statusIcon, setStatusIcon ] = useState(props.connection.getClient().getStatusIcon()); + props.connection.getClient().events.reactUse("notify_status_icon_changed", event => setStatusIcon(event.newIcon)); + if(showClientStatus) { - return } - key={"server"} - />; + return ; } else { return ; } diff --git a/web/audio-lib/src/lib.rs b/web/audio-lib/src/lib.rs index 6bb92f73..576bdc17 100644 --- a/web/audio-lib/src/lib.rs +++ b/web/audio-lib/src/lib.rs @@ -52,7 +52,6 @@ pub fn audio_client_create() -> AudioClientId { client.client_id } -/// Let the audio client say hi (mutable). /// If an error occurs or the client isn't known an exception will be thrown. #[wasm_bindgen] pub fn audio_client_enqueue_buffer(client_id: AudioClientId, buffer: &[u8], packet_id: u16, codec: u8, is_head_packet: bool) -> Result<(), JsValue> {