mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -395,7 +395,7 @@ pub fn session_is_keyboard_mode_supported(session_id: SessionID, mode: String) -
|
||||
SyncReturn(is_keyboard_mode_supported(
|
||||
&mode,
|
||||
session.get_peer_version(),
|
||||
&session.peer_platform()
|
||||
&session.peer_platform(),
|
||||
))
|
||||
} else {
|
||||
SyncReturn(false)
|
||||
@@ -1529,6 +1529,21 @@ pub fn cm_switch_back(conn_id: i32) {
|
||||
crate::ui_cm_interface::switch_back(conn_id);
|
||||
}
|
||||
|
||||
pub fn cm_get_config(name: String) -> String {
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
{
|
||||
if let Ok(Some(v)) = crate::ipc::get_config(&name) {
|
||||
v
|
||||
} else {
|
||||
"".to_string()
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "ios")]
|
||||
{
|
||||
"".to_string()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main_get_build_date() -> String {
|
||||
crate::BUILD_DATE.to_string()
|
||||
}
|
||||
|
||||
@@ -408,6 +408,12 @@ async fn handle(data: Data, stream: &mut Connection) {
|
||||
} else {
|
||||
None
|
||||
};
|
||||
} else if name == "hide_cm" {
|
||||
value = if crate::hbbs_http::sync::is_pro() {
|
||||
Some(hbb_common::password_security::hide_cm().to_string())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
} else {
|
||||
value = None;
|
||||
}
|
||||
@@ -699,7 +705,7 @@ where
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn get_config(name: &str) -> ResultType<Option<String>> {
|
||||
pub async fn get_config(name: &str) -> ResultType<Option<String>> {
|
||||
get_config_async(name, 1_000).await
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ use cidr_utils::cidr::IpCidr;
|
||||
#[cfg(all(target_os = "linux", feature = "linux_headless"))]
|
||||
#[cfg(not(any(feature = "flatpak", feature = "appimage")))]
|
||||
use hbb_common::platform::linux::run_cmds;
|
||||
#[cfg(target_os = "android")]
|
||||
use hbb_common::protobuf::EnumOrUnknown;
|
||||
use hbb_common::{
|
||||
config::Config,
|
||||
fs,
|
||||
@@ -34,7 +36,6 @@ use hbb_common::{
|
||||
get_time, get_version_number,
|
||||
message_proto::{option_message::BoolOption, permission_info::Permission},
|
||||
password_security::{self as password, ApproveMode},
|
||||
protobuf::EnumOrUnknown,
|
||||
sleep, timeout,
|
||||
tokio::{
|
||||
net::TcpStream,
|
||||
@@ -2791,9 +2792,6 @@ async fn start_ipc(
|
||||
#[allow(unused_mut)]
|
||||
#[allow(unused_assignments)]
|
||||
let mut args = vec!["--cm"];
|
||||
if crate::hbbs_http::sync::is_pro() && password::hide_cm() {
|
||||
args.push("--hide");
|
||||
}
|
||||
#[allow(unused_mut)]
|
||||
#[cfg(target_os = "linux")]
|
||||
let mut user = None;
|
||||
|
||||
Reference in New Issue
Block a user