mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-16 11:01:28 +03:00
prepare no-register-device
This commit is contained in:
Submodule libs/hbb_common updated: 53709d8f8d...fa160b2864
@@ -454,7 +454,9 @@ pub fn core_main() -> Option<Vec<String>> {
|
|||||||
}
|
}
|
||||||
return None;
|
return None;
|
||||||
} else if args[0] == "--assign" {
|
} else if args[0] == "--assign" {
|
||||||
if crate::platform::is_installed() && is_root() {
|
if config::Config::no_register_device() {
|
||||||
|
println!("Cannot assign an unregistrable device!");
|
||||||
|
} else if crate::platform::is_installed() && is_root() {
|
||||||
let max = args.len() - 1;
|
let max = args.len() - 1;
|
||||||
let pos = args.iter().position(|x| x == "--token").unwrap_or(max);
|
let pos = args.iter().position(|x| x == "--token").unwrap_or(max);
|
||||||
if pos < max {
|
if pos < max {
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ async fn start_hbbs_sync_async() {
|
|||||||
// Though the username comparison is only necessary on Windows,
|
// Though the username comparison is only necessary on Windows,
|
||||||
// we still keep the comparison on other platforms for consistency.
|
// we still keep the comparison on other platforms for consistency.
|
||||||
let need_upload = (!info_uploaded.uploaded || info_uploaded.username.as_ref() != Some(&sys_username)) &&
|
let need_upload = (!info_uploaded.uploaded || info_uploaded.username.as_ref() != Some(&sys_username)) &&
|
||||||
info_uploaded.last_uploaded.map(|x| x.elapsed() >= UPLOAD_SYSINFO_TIMEOUT).unwrap_or(true);
|
info_uploaded.last_uploaded.map(|x| x.elapsed() >= UPLOAD_SYSINFO_TIMEOUT).unwrap_or(true)
|
||||||
|
&& !Config::no_register_device();
|
||||||
if need_upload {
|
if need_upload {
|
||||||
v["version"] = json!(crate::VERSION);
|
v["version"] = json!(crate::VERSION);
|
||||||
v["id"] = json!(id);
|
v["id"] = json!(id);
|
||||||
|
|||||||
@@ -568,6 +568,7 @@ impl RendezvousMediator {
|
|||||||
id,
|
id,
|
||||||
uuid: uuid.into(),
|
uuid: uuid.into(),
|
||||||
pk: pk.into(),
|
pk: pk.into(),
|
||||||
|
no_register_device: Config::no_register_device(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
socket.send(&msg_out).await?;
|
socket.send(&msg_out).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user