refact: custom client, more advanced settings (#8085)

* refact: custom client, more advanced settings

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* feat: custom client, more advanced settings

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-05-18 23:13:54 +08:00
committed by GitHub
parent c2b7810c33
commit 96f41fcc02
34 changed files with 356 additions and 258 deletions

View File

@@ -28,7 +28,7 @@ use hbb_common::platform::linux::run_cmds;
#[cfg(target_os = "android")]
use hbb_common::protobuf::EnumOrUnknown;
use hbb_common::{
config::Config,
config::{self, Config},
fs::{self, can_enable_overwrite_detection},
futures::{SinkExt, StreamExt},
get_time, get_version_number,
@@ -337,7 +337,7 @@ impl Connection {
clipboard: Connection::permission("enable-clipboard"),
audio: Connection::permission("enable-audio"),
// to-do: make sure is the option correct here
file: Connection::permission("enable-file-transfer"),
file: Connection::permission(config::keys::OPTION_ENABLE_FILE_TRANSFER),
restart: Connection::permission("enable-remote-restart"),
recording: Connection::permission("enable-record-session"),
block_input: Connection::permission("enable-block-input"),
@@ -1614,7 +1614,7 @@ impl Connection {
}
match lr.union {
Some(login_request::Union::FileTransfer(ft)) => {
if !Connection::permission("enable-file-transfer") {
if !Connection::permission(config::keys::OPTION_ENABLE_FILE_TRANSFER) {
self.send_login_error("No permission of file transfer")
.await;
sleep(1.).await;