Add rename_path, move_path and delete_path for home files
The chat Files panel needs to rename, move and delete entries. Three
websocket requests, dispatched beside list_directory, operate on one
entry inside the operator's home and reply with path_mutated {path} or
an error frame (does not exist, already exists, is not empty, outside
the home directory, cannot be moved into itself).
The entry's parent folder and the move destination are resolved through
symlinks and must stay inside home; the entry's own symlink is never
followed, so a link is renamed, moved or removed as a link. The home
directory itself, anything outside it and pseudo filesystems are
refused. A folder is deleted only when empty unless recursive is set;
os.RemoveAll unlinks symlinks rather than descending into them.
This commit is contained in:
@@ -266,6 +266,12 @@ type Message struct {
|
||||
// the home-restricted folder picker listing (see directories.go).
|
||||
ListDirectory *DirectoryListRequest `json:"list_directory,omitempty"`
|
||||
DirectoryListing *DirectoryListingResult `json:"directory_listing,omitempty"`
|
||||
// RenamePath, MovePath and DeletePath are the Files panel's home file
|
||||
// mutations and PathMutated their shared reply (see directories.go).
|
||||
RenamePath *RenamePathRequest `json:"rename_path,omitempty"`
|
||||
MovePath *MovePathRequest `json:"move_path,omitempty"`
|
||||
DeletePath *DeletePathRequest `json:"delete_path,omitempty"`
|
||||
PathMutated *PathMutatedResult `json:"path_mutated,omitempty"`
|
||||
// ChatAttachmentImageRequest is the chat_attachment_image body and
|
||||
// ChatAttachmentImage its reply.
|
||||
ChatAttachmentImageRequest *ChatAttachmentImageRequest `json:"chat_attachment_image_request,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user