mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-18 17:01:29 +03:00
no api for unregistered device
This commit is contained in:
@@ -960,6 +960,9 @@ pub fn get_custom_rendezvous_server(custom: String) -> String {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_api_server(api: String, custom: String) -> String {
|
pub fn get_api_server(api: String, custom: String) -> String {
|
||||||
|
if Config::no_register_device() {
|
||||||
|
return "".to_owned();
|
||||||
|
}
|
||||||
let mut res = get_api_server_(api, custom);
|
let mut res = get_api_server_(api, custom);
|
||||||
if res.ends_with('/') {
|
if res.ends_with('/') {
|
||||||
res.pop();
|
res.pop();
|
||||||
|
|||||||
@@ -127,8 +127,7 @@ 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user