mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-14 12:07:35 +00:00
@@ -48,6 +48,7 @@ pub struct Client {
|
||||
pub file: bool,
|
||||
pub restart: bool,
|
||||
pub recording: bool,
|
||||
pub from_switch: bool,
|
||||
#[serde(skip)]
|
||||
tx: UnboundedSender<Data>,
|
||||
}
|
||||
@@ -118,6 +119,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
|
||||
file: bool,
|
||||
restart: bool,
|
||||
recording: bool,
|
||||
from_switch: bool,
|
||||
tx: mpsc::UnboundedSender<Data>,
|
||||
) {
|
||||
let client = Client {
|
||||
@@ -134,6 +136,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
|
||||
file,
|
||||
restart,
|
||||
recording,
|
||||
from_switch,
|
||||
tx,
|
||||
};
|
||||
CLIENTS
|
||||
@@ -241,6 +244,14 @@ pub fn get_clients_length() -> usize {
|
||||
clients.len()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn switch_back(id: i32) {
|
||||
if let Some(client) = CLIENTS.read().unwrap().get(&id) {
|
||||
allow_err!(client.tx.send(Data::SwitchBack));
|
||||
};
|
||||
}
|
||||
|
||||
impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
||||
#[cfg(windows)]
|
||||
async fn enable_cliprdr_file_context(&mut self, conn_id: i32, enabled: bool) {
|
||||
@@ -308,9 +319,9 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
||||
}
|
||||
Ok(Some(data)) => {
|
||||
match data {
|
||||
Data::Login{id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, file_transfer_enabled: _file_transfer_enabled, restart, recording} => {
|
||||
Data::Login{id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, file_transfer_enabled: _file_transfer_enabled, restart, recording, from_switch} => {
|
||||
log::debug!("conn_id: {}", id);
|
||||
self.cm.add_connection(id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, restart, recording, self.tx.clone());
|
||||
self.cm.add_connection(id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, restart, recording, from_switch,self.tx.clone());
|
||||
self.authorized = authorized;
|
||||
self.conn_id = id;
|
||||
#[cfg(windows)]
|
||||
@@ -498,6 +509,7 @@ pub async fn start_listen<T: InvokeUiCM>(
|
||||
file,
|
||||
restart,
|
||||
recording,
|
||||
from_switch,
|
||||
..
|
||||
}) => {
|
||||
current_id = id;
|
||||
@@ -514,6 +526,7 @@ pub async fn start_listen<T: InvokeUiCM>(
|
||||
file,
|
||||
restart,
|
||||
recording,
|
||||
from_switch,
|
||||
tx.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user