sciter/mobile id suffix "\r" or "/r" for relay

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-02-26 11:23:43 +08:00
parent 8b3c4d3d64
commit 4b25291255
7 changed files with 38 additions and 13 deletions

View File

@@ -62,12 +62,15 @@ function createNewConnect(id, type) {
id = id.replace(/\s/g, "");
app.remote_id.value = formatId(id);
if (!id) return;
var old_id = id;
id = handler.handle_relay_id(id);
var force_relay = old_id != id;
if (id == my_id) {
msgbox("custom-error", "Error", "You cannot connect to your own computer");
return;
}
handler.set_remote_id(id);
handler.new_remote(id, type);
handler.new_remote(id, type, force_relay);
}
class ShareRdp: Reactor.Component {

View File

@@ -462,6 +462,7 @@ impl sciter::EventHandler for SciterSession {
impl SciterSession {
pub fn new(cmd: String, id: String, password: String, args: Vec<String>) -> Self {
let force_relay = args.contains(&"--relay".to_string());
let session: Session<SciterHandler> = Session {
id: id.clone(),
password: password.clone(),
@@ -486,7 +487,7 @@ impl SciterSession {
.lc
.write()
.unwrap()
.initialize(id, conn_type, None, false);
.initialize(id, conn_type, None, force_relay);
Self(session)
}