mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-07 09:52:49 +08:00
prepare no-register-device
This commit is contained in:
parent
39151531d7
commit
01146574f2
@ -1 +1 @@
|
||||
Subproject commit 53709d8f8dd09a1491f4d8866e9643804caa380b
|
||||
Subproject commit fa160b286449d4feee26c03dfa721d9997b4748b
|
@ -454,7 +454,9 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
}
|
||||
return None;
|
||||
} 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 pos = args.iter().position(|x| x == "--token").unwrap_or(max);
|
||||
if pos < max {
|
||||
|
@ -127,7 +127,8 @@ async fn start_hbbs_sync_async() {
|
||||
// Though the username comparison is only necessary on Windows,
|
||||
// we still keep the comparison on other platforms for consistency.
|
||||
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 {
|
||||
v["version"] = json!(crate::VERSION);
|
||||
v["id"] = json!(id);
|
||||
|
@ -568,6 +568,7 @@ impl RendezvousMediator {
|
||||
id,
|
||||
uuid: uuid.into(),
|
||||
pk: pk.into(),
|
||||
no_register_device: Config::no_register_device(),
|
||||
..Default::default()
|
||||
});
|
||||
socket.send(&msg_out).await?;
|
||||
|
Loading…
Reference in New Issue
Block a user