patch: don't show enable file clipboard when anyone unsupporting

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
This commit is contained in:
ClSlaid
2023-10-29 23:11:30 +08:00
parent 80200a9983
commit 7aee76f5de
8 changed files with 29 additions and 18 deletions

View File

@@ -1019,13 +1019,6 @@ impl Connection {
let mut pi = PeerInfo {
username: username.clone(),
version: VERSION.to_owned(),
has_file_clipboard: cfg!(any(
target_os = "windows",
all(
feature = "unix-file-copy-paste",
any(target_os = "linux", target_os = "macos")
)
)),
..Default::default()
};
@@ -1069,7 +1062,18 @@ impl Connection {
}
}
#[cfg(any(target_os = "linux", target_os = "windows"))]
#[cfg(any(
target_os = "windows",
all(
any(target_os = "linux", target_os = "macos"),
feature = "unix-file-copy-paste"
)
))]
{
platform_additions.insert("has_file_clipboard".into(), json!(true));
}
#[cfg(any(target_os = "linux", target_os = "windows", target_os = "macos"))]
if !platform_additions.is_empty() {
pi.platform_additions = serde_json::to_string(&platform_additions).unwrap_or("".into());
}

View File

@@ -153,13 +153,6 @@ pub fn new() -> GenericService {
fn displays_to_msg(displays: Vec<DisplayInfo>) -> Message {
let mut pi = PeerInfo {
has_file_clipboard: cfg!(any(
target_os = "windows",
all(
feature = "unix-file-copy-paste",
any(target_os = "linux", target_os = "macos")
)
)),
..Default::default()
};
pi.displays = displays.clone();