remove more "rustdesk" built-in

This commit is contained in:
rustdesk
2024-02-25 13:29:06 +08:00
parent 9ff1dfe019
commit a28c9f8f36
15 changed files with 66 additions and 50 deletions

View File

@@ -24,10 +24,11 @@ macro_rules! my_println{
#[inline]
fn is_empty_uni_link(arg: &str) -> bool {
if !arg.starts_with("rustdesk://") {
let prefix = crate::get_uri_prefix();
if !arg.starts_with(&prefix) {
return false;
}
arg["rustdesk://".len()..].chars().all(|c| c == '/')
arg[prefix.len()..].chars().all(|c| c == '/')
}
/// shared by flutter and sciter main function
@@ -135,7 +136,7 @@ pub fn core_main() -> Option<Vec<String>> {
// linux uni (url) go here.
#[cfg(all(target_os = "linux", feature = "flutter"))]
if args.len() > 0 && args[0].starts_with("rustdesk:") {
if args.len() > 0 && args[0].starts_with(&crate::get_uri_prefix()) {
return try_send_by_dbus(args[0].clone());
}
@@ -551,7 +552,14 @@ fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<Strin
}
let params = param_array.join("&");
let params_flag = if params.is_empty() { "" } else { "?" };
uni_links = format!("rustdesk://{}/{}{}{}", authority, id, params_flag, params);
uni_links = format!(
"{}{}/{}{}{}",
crate::get_uri_prefix(),
authority,
id,
params_flag,
params
);
}
}
if uni_links.is_empty() {
@@ -566,7 +574,7 @@ fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<Strin
use winapi::um::winuser::WM_USER;
let res = crate::platform::send_message_to_hnwd(
"FLUTTER_RUNNER_WIN32_WINDOW",
"RustDesk",
&crate::get_app_name(),
(WM_USER + 2) as _, // referred from unilinks desktop pub
uni_links.as_str(),
false,