Create empty dir on send files in local (#9993)

* feat: Add empty dirs on sendfiles

* Update connection.rs

---------

Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
zuiyu
2024-11-23 23:09:11 +08:00
committed by GitHub
parent b64f6271e2
commit 314c93b210
13 changed files with 311 additions and 6 deletions

View File

@@ -43,6 +43,18 @@ pub trait FileManager: Interface {
self.send(Data::CancelJob(id));
}
fn read_empty_dirs(&self, path: String, include_hidden: bool) {
let mut msg_out = Message::new();
let mut file_action = FileAction::new();
file_action.set_read_empty_dirs(ReadEmptyDirs {
path,
include_hidden,
..Default::default()
});
msg_out.set_file_action(file_action);
self.send(Data::Message(msg_out));
}
fn read_remote_dir(&self, path: String, include_hidden: bool) {
let mut msg_out = Message::new();
let mut file_action = FileAction::new();

View File

@@ -1299,6 +1299,9 @@ impl<T: InvokeUiSession> Remote<T> {
}
Some(message::Union::FileResponse(fr)) => {
match fr.union {
Some(file_response::Union::EmptyDirs(res)) => {
self.handler.update_empty_dirs(res);
}
Some(file_response::Union::Dir(fd)) => {
#[cfg(windows)]
let entries = fd.entries.to_vec();