mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-09 18:41:29 +03:00
sciter/mobile id suffix "\r" or "/r" for relay
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
19
src/ui.rs
19
src/ui.rs
@@ -420,8 +420,8 @@ impl UI {
|
||||
crate::lan::send_wol(id)
|
||||
}
|
||||
|
||||
fn new_remote(&mut self, id: String, remote_type: String) {
|
||||
new_remote(id, remote_type)
|
||||
fn new_remote(&mut self, id: String, remote_type: String, force_relay: bool) {
|
||||
new_remote(id, remote_type, force_relay)
|
||||
}
|
||||
|
||||
fn is_process_trusted(&mut self, _prompt: bool) -> bool {
|
||||
@@ -571,6 +571,10 @@ impl UI {
|
||||
fn default_video_save_directory(&self) -> String {
|
||||
default_video_save_directory()
|
||||
}
|
||||
|
||||
fn handle_relay_id(&self, id: String) -> String {
|
||||
handle_relay_id(id)
|
||||
}
|
||||
}
|
||||
|
||||
impl sciter::EventHandler for UI {
|
||||
@@ -588,7 +592,7 @@ impl sciter::EventHandler for UI {
|
||||
fn set_remote_id(String);
|
||||
fn closing(i32, i32, i32, i32);
|
||||
fn get_size();
|
||||
fn new_remote(String, bool);
|
||||
fn new_remote(String, String, bool);
|
||||
fn send_wol(String);
|
||||
fn remove_peer(String);
|
||||
fn remove_discovered(String);
|
||||
@@ -653,6 +657,7 @@ impl sciter::EventHandler for UI {
|
||||
fn has_hwcodec();
|
||||
fn get_langs();
|
||||
fn default_video_save_directory();
|
||||
fn handle_relay_id(String);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,9 +723,13 @@ pub fn value_crash_workaround(values: &[Value]) -> Arc<Vec<Value>> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn new_remote(id: String, remote_type: String) {
|
||||
pub fn new_remote(id: String, remote_type: String, force_relay: bool) {
|
||||
let mut lock = CHILDREN.lock().unwrap();
|
||||
let args = vec![format!("--{}", remote_type), id.clone()];
|
||||
let mut args = vec![format!("--{}", remote_type), id.clone()];
|
||||
if force_relay {
|
||||
args.push("".to_string()); // password
|
||||
args.push("--relay".to_string());
|
||||
}
|
||||
let key = (id.clone(), remote_type.clone());
|
||||
if let Some(c) = lock.1.get_mut(&key) {
|
||||
if let Ok(Some(_)) = c.try_wait() {
|
||||
|
||||
Reference in New Issue
Block a user