permisson block input

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-11-05 21:53:21 +08:00
parent 663d355a48
commit d528fd3762
49 changed files with 157 additions and 13 deletions

View File

@@ -53,6 +53,7 @@ pub struct Client {
pub file: bool,
pub restart: bool,
pub recording: bool,
pub block_input: bool,
pub from_switch: bool,
pub in_voice_call: bool,
pub incoming_voice_call: bool,
@@ -133,6 +134,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
file: bool,
restart: bool,
recording: bool,
block_input: bool,
from_switch: bool,
#[cfg(not(any(target_os = "ios")))] tx: mpsc::UnboundedSender<Data>,
) {
@@ -150,6 +152,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
file,
restart,
recording,
block_input,
from_switch,
#[cfg(not(any(target_os = "ios")))]
tx,
@@ -378,9 +381,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, from_switch} => {
Data::Login{id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, file_transfer_enabled: _file_transfer_enabled, restart, recording, block_input, 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, from_switch,self.tx.clone());
self.cm.add_connection(id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, restart, recording, block_input, from_switch, self.tx.clone());
self.conn_id = id;
#[cfg(any(target_os = "linux", target_os = "windows", target_os = "macos"))]
{
@@ -632,6 +635,7 @@ pub async fn start_listen<T: InvokeUiCM>(
file,
restart,
recording,
block_input,
from_switch,
..
}) => {
@@ -649,6 +653,7 @@ pub async fn start_listen<T: InvokeUiCM>(
file,
restart,
recording,
block_input,
from_switch,
tx.clone(),
);