mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
fix: terminal, restore, cross users (#12335)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -2551,7 +2551,7 @@ impl LoginConfigHandler {
|
||||
}),
|
||||
ConnType::TERMINAL => {
|
||||
let mut terminal = Terminal::new();
|
||||
terminal.service_id = self.get_option("terminal-service-id");
|
||||
terminal.service_id = self.get_option(self.get_key_terminal_service_id());
|
||||
lr.set_terminal(terminal);
|
||||
}
|
||||
_ => {}
|
||||
@@ -2602,6 +2602,14 @@ impl LoginConfigHandler {
|
||||
pub fn get_id(&self) -> &str {
|
||||
&self.id
|
||||
}
|
||||
|
||||
pub fn get_key_terminal_service_id(&self) -> &'static str {
|
||||
if self.is_terminal_admin {
|
||||
"terminal-admin-service-id"
|
||||
} else {
|
||||
"terminal-service-id"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Media data.
|
||||
|
||||
@@ -1944,10 +1944,9 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
use hbb_common::message_proto::terminal_response::Union;
|
||||
if let Some(Union::Opened(opened)) = &response.union {
|
||||
if opened.success && !opened.service_id.is_empty() {
|
||||
self.handler.lc.write().unwrap().set_option(
|
||||
"terminal-service-id".to_owned(),
|
||||
opened.service_id.clone(),
|
||||
);
|
||||
let mut lc = self.handler.lc.write().unwrap();
|
||||
let key = lc.get_key_terminal_service_id().to_owned();
|
||||
lc.set_option(key, opened.service_id.clone());
|
||||
}
|
||||
}
|
||||
self.handler.handle_terminal_response(response);
|
||||
|
||||
Reference in New Issue
Block a user