mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-08 05:20:59 +03:00
refact: remove feature plugin-framework (#15854)
* refact: remove feature plugin-framework Signed-off-by: fufesou <linlong1266@gmail.com> * refact: remove unused translations Signed-off-by: fufesou <linlong1266@gmail.com> * fix: delete settings tab observable with correct type Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -163,43 +163,6 @@ pub static CLICK_TIME: AtomicI64 = AtomicI64::new(0);
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub static MOUSE_MOVE_TIME: AtomicI64 = AtomicI64::new(0);
|
||||
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
lazy_static::lazy_static! {
|
||||
static ref PLUGIN_BLOCK_INPUT_TXS: Arc<Mutex<HashMap<String, std_mpsc::Sender<MessageInput>>>> = Default::default();
|
||||
static ref PLUGIN_BLOCK_INPUT_TX_RX: (Arc<Mutex<std_mpsc::Sender<bool>>>, Arc<Mutex<std_mpsc::Receiver<bool>>>) = {
|
||||
let (tx, rx) = std_mpsc::channel();
|
||||
(Arc::new(Mutex::new(tx)), Arc::new(Mutex::new(rx)))
|
||||
};
|
||||
}
|
||||
|
||||
// Block input is required for some special cases, such as privacy mode.
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn plugin_block_input(peer: &str, block: bool) -> bool {
|
||||
if let Some(tx) = PLUGIN_BLOCK_INPUT_TXS.lock().unwrap().get(peer) {
|
||||
let _ = tx.send(if block {
|
||||
MessageInput::BlockOnPlugin(peer.to_string())
|
||||
} else {
|
||||
MessageInput::BlockOffPlugin(peer.to_string())
|
||||
});
|
||||
match PLUGIN_BLOCK_INPUT_TX_RX
|
||||
.1
|
||||
.lock()
|
||||
.unwrap()
|
||||
.recv_timeout(std::time::Duration::from_millis(3_000))
|
||||
{
|
||||
Ok(b) => b == block,
|
||||
Err(..) => {
|
||||
log::error!("plugin_block_input timeout");
|
||||
false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct ConnInner {
|
||||
id: i32,
|
||||
@@ -225,12 +188,6 @@ enum MessageInput {
|
||||
Pointer((PointerDeviceEvent, i32)),
|
||||
BlockOn,
|
||||
BlockOff,
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
BlockOnPlugin(String),
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
BlockOffPlugin(String),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
|
||||
@@ -1176,12 +1133,6 @@ impl Connection {
|
||||
let _ = Self::turn_off_privacy_to_msg(id, String::new());
|
||||
}
|
||||
}
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
crate::plugin::handle_listen_event(
|
||||
crate::plugin::EVENT_ON_CONN_CLOSE_SERVER.to_owned(),
|
||||
conn.lr.my_id.clone(),
|
||||
);
|
||||
video_service::notify_video_frame_fetched_by_conn_id(id, None);
|
||||
if conn.authorized {
|
||||
password::update_temporary_password();
|
||||
@@ -1266,32 +1217,6 @@ impl Connection {
|
||||
);
|
||||
}
|
||||
}
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
MessageInput::BlockOnPlugin(_peer) => {
|
||||
let (ok, _msg) = crate::platform::block_input(true);
|
||||
if ok {
|
||||
block_input_mode = true;
|
||||
}
|
||||
let _r = PLUGIN_BLOCK_INPUT_TX_RX
|
||||
.0
|
||||
.lock()
|
||||
.unwrap()
|
||||
.send(block_input_mode);
|
||||
}
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
MessageInput::BlockOffPlugin(_peer) => {
|
||||
let (ok, _msg) = crate::platform::block_input(false);
|
||||
if ok {
|
||||
block_input_mode = false;
|
||||
}
|
||||
let _r = PLUGIN_BLOCK_INPUT_TX_RX
|
||||
.0
|
||||
.lock()
|
||||
.unwrap()
|
||||
.send(block_input_mode);
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
@@ -2032,13 +1957,6 @@ impl Connection {
|
||||
username = "".to_owned();
|
||||
}
|
||||
}
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
PLUGIN_BLOCK_INPUT_TXS
|
||||
.lock()
|
||||
.unwrap()
|
||||
.insert(self.lr.my_id.clone(), self.tx_input.clone());
|
||||
|
||||
// Terminal feature is supported on desktop only
|
||||
#[allow(unused_mut)]
|
||||
let mut terminal = cfg!(not(any(target_os = "android", target_os = "ios")));
|
||||
@@ -3904,13 +3822,6 @@ impl Connection {
|
||||
self.change_resolution(Some(dr.display as _), &dr.resolution);
|
||||
}
|
||||
}
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
Some(misc::Union::PluginRequest(p)) => {
|
||||
let msg =
|
||||
crate::plugin::handle_client_event(&p.id, &self.lr.my_id, &p.content);
|
||||
self.send(msg).await;
|
||||
}
|
||||
Some(misc::Union::AutoAdjustFps(fps)) => video_service::VIDEO_QOS
|
||||
.lock()
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user