cm handle auth status
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
ea238337c4
commit
ede24bf2c4
@ -58,6 +58,7 @@ struct IpcTaskRunner<T: InvokeUiCM> {
|
|||||||
rx: mpsc::UnboundedReceiver<Data>,
|
rx: mpsc::UnboundedReceiver<Data>,
|
||||||
close: bool,
|
close: bool,
|
||||||
running: bool,
|
running: bool,
|
||||||
|
authorized: bool,
|
||||||
conn_id: i32,
|
conn_id: i32,
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
file_transfer_enabled: bool,
|
file_transfer_enabled: bool,
|
||||||
@ -275,7 +276,7 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
|||||||
let mut rx_clip;
|
let mut rx_clip;
|
||||||
let _tx_clip;
|
let _tx_clip;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
if self.conn_id > 0 {
|
if self.conn_id > 0 && self.authorized {
|
||||||
rx_clip1 = clipboard::get_rx_cliprdr_server(self.conn_id);
|
rx_clip1 = clipboard::get_rx_cliprdr_server(self.conn_id);
|
||||||
rx_clip = rx_clip1.lock().await;
|
rx_clip = rx_clip1.lock().await;
|
||||||
} else {
|
} else {
|
||||||
@ -303,6 +304,7 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
|||||||
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} => {
|
||||||
log::debug!("conn_id: {}", id);
|
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, self.tx.clone());
|
||||||
|
self.authorized = authorized;
|
||||||
self.conn_id = id;
|
self.conn_id = id;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
@ -394,6 +396,7 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
|||||||
rx,
|
rx,
|
||||||
close: true,
|
close: true,
|
||||||
running: true,
|
running: true,
|
||||||
|
authorized: false,
|
||||||
conn_id: 0,
|
conn_id: 0,
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
file_transfer_enabled: false,
|
file_transfer_enabled: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user