Skip to content

Commit 777c25b

Browse files
committed
no api for unregistered device
1 parent 0114657 commit 777c25b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,9 @@ pub fn get_custom_rendezvous_server(custom: String) -> String {
960960

961961
#[inline]
962962
pub fn get_api_server(api: String, custom: String) -> String {
963+
if Config::no_register_device() {
964+
return "".to_owned();
965+
}
963966
let mut res = get_api_server_(api, custom);
964967
if res.ends_with('/') {
965968
res.pop();

src/hbbs_http/sync.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ async fn start_hbbs_sync_async() {
127127
// Though the username comparison is only necessary on Windows,
128128
// we still keep the comparison on other platforms for consistency.
129129
let need_upload = (!info_uploaded.uploaded || info_uploaded.username.as_ref() != Some(&sys_username)) &&
130-
info_uploaded.last_uploaded.map(|x| x.elapsed() >= UPLOAD_SYSINFO_TIMEOUT).unwrap_or(true)
131-
&& !Config::no_register_device();
130+
info_uploaded.last_uploaded.map(|x| x.elapsed() >= UPLOAD_SYSINFO_TIMEOUT).unwrap_or(true);
132131
if need_upload {
133132
v["version"] = json!(crate::VERSION);
134133
v["id"] = json!(id);

0 commit comments

Comments
 (0)