Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/hbb_common
4 changes: 3 additions & 1 deletion src/core_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/hbbs_http/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/rendezvous_mediator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
Loading