Merge pull request #6018 from 21pages/sync_share_rdp

sync option share rdp
This commit is contained in:
RustDesk 2023-10-13 15:27:17 +08:00 committed by GitHub
commit b39ba92cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,10 +147,22 @@ fn handle_config_options(config_options: HashMap<String, String>) {
config_options
.iter()
.map(|(k, v)| {
if v.is_empty() {
options.remove(k);
if k == "allow-share-rdp" {
// only changes made after installation take effect.
#[cfg(windows)]
if crate::ui_interface::is_rdp_service_open() {
let current = crate::ui_interface::is_share_rdp();
let set = v == "Y";
if current != set {
crate::platform::windows::set_share_rdp(set);
}
}
} else {
options.insert(k.to_string(), v.to_string());
if v.is_empty() {
options.remove(k);
} else {
options.insert(k.to_string(), v.to_string());
}
}
})
.count();