mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-16 04:56:18 +00:00
fix: option OPTION_ONE_WAY_FILE_TRANSFER (#9387)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -440,7 +440,7 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
||||
Data::ClipboardFile(_clip) => {
|
||||
#[cfg(any(target_os = "windows", target_os="linux", target_os = "macos"))]
|
||||
{
|
||||
let is_stopping_allowed = _clip.is_stopping_allowed_from_peer();
|
||||
let is_stopping_allowed = _clip.is_beginning_message();
|
||||
let is_clipboard_enabled = ContextSend::is_enabled();
|
||||
let file_transfer_enabled = self.file_transfer_enabled;
|
||||
let stop = !is_stopping_allowed && !(is_clipboard_enabled && file_transfer_enabled);
|
||||
@@ -565,10 +565,15 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
||||
log::debug!(
|
||||
"Process clipboard message from clip, stop: {}, is_stopping_allowed: {}, is_clipboard_enabled: {}, file_transfer_enabled: {}, file_transfer_enabled_peer: {}",
|
||||
stop, is_stopping_allowed, is_clipboard_enabled, file_transfer_enabled, file_transfer_enabled_peer);
|
||||
if stop || crate::get_builtin_option(OPTION_ONE_WAY_FILE_TRANSFER) == "Y"{
|
||||
if stop {
|
||||
ContextSend::set_is_stopped();
|
||||
} else {
|
||||
allow_err!(self.tx.send(Data::ClipboardFile(_clip)));
|
||||
if _clip.is_beginning_message() && crate::get_builtin_option(OPTION_ONE_WAY_FILE_TRANSFER) == "Y" {
|
||||
// If one way file transfer is enabled, don't send clipboard file to client
|
||||
// Don't call `ContextSend::set_is_stopped()`, because it will stop bidirectional file copy&paste.
|
||||
} else {
|
||||
allow_err!(self.tx.send(Data::ClipboardFile(_clip)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user