mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -1405,6 +1405,54 @@ pub fn plugin_event(_id: String, _event: Vec<u8>) {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn plugin_get_session_option(_id: String, _peer: String, _key: String) -> SyncReturn<String> {
|
||||
#[cfg(feature = "plugin_framework")]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
{
|
||||
return SyncReturn(crate::plugin::PeerConfig::get(&_id, &_peer, &_key));
|
||||
}
|
||||
#[cfg(any(
|
||||
not(feature = "plugin_framework"),
|
||||
target_os = "android",
|
||||
target_os = "ios"
|
||||
))]
|
||||
return SyncReturn("".to_owned());
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn plugin_set_session_option(_id: String, _peer: String, _key: String, _value: String) {
|
||||
#[cfg(feature = "plugin_framework")]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
{
|
||||
crate::plugin::PeerConfig::set(&_id, &_peer, &_key, &_value);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn plugin_get_local_option(_id: String, _key: String) -> SyncReturn<String> {
|
||||
#[cfg(feature = "plugin_framework")]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
{
|
||||
allow_err!(crate::plugin::LocalConfig::get(&_id, &key));
|
||||
}
|
||||
#[cfg(any(
|
||||
not(feature = "plugin_framework"),
|
||||
target_os = "android",
|
||||
target_os = "ios"
|
||||
))]
|
||||
return SyncReturn("".to_owned());
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn plugin_set_local_option(_id: String, _key: String, _value: String) {
|
||||
#[cfg(feature = "plugin_framework")]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
{
|
||||
crate::plugin::LocalConfig::set(&_id, &_key, &_value);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
pub mod server_side {
|
||||
use hbb_common::{config, log};
|
||||
|
||||
@@ -15,9 +15,9 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
struct LocalConfig(HashMap<String, String>);
|
||||
pub struct LocalConfig(HashMap<String, String>);
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
struct PeerConfig(HashMap<String, String>);
|
||||
pub struct PeerConfig(HashMap<String, String>);
|
||||
type PeersConfig = HashMap<String, PeerConfig>;
|
||||
|
||||
#[inline]
|
||||
|
||||
@@ -12,6 +12,8 @@ pub use plugins::{
|
||||
reload_plugin, unload_plugin,
|
||||
};
|
||||
|
||||
pub use config::{LocalConfig, PeerConfig};
|
||||
|
||||
#[inline]
|
||||
fn cstr_to_string(cstr: *const c_char) -> ResultType<String> {
|
||||
Ok(String::from_utf8(unsafe {
|
||||
|
||||
Reference in New Issue
Block a user