From c80dd9dfecbf5dc6cf8a827ef62f9c27eea7a776 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 20 Aug 2024 11:31:21 +0200 Subject: [PATCH] fix: Display 'Leave share' instead of 'Delete' Signed-off-by: Marcel Klehr --- apps/files_sharing/lib/Controller/ShareAPIController.php | 4 ++++ apps/files_sharing/lib/ResponseDefinitions.php | 2 ++ apps/files_sharing/openapi.json | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 48ba46150b314..1c642dcd9524a 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -189,6 +189,10 @@ protected function formatShare(IShare $share, ?Node $recipientNode = null): arra $result['item_permissions'] = $node->getPermissions(); } + // See MOUNT_ROOT_PROPERTYNAME dav property + $result['is-mount-root'] = $node->getInternalPath() === ''; + $result['mount-type'] = $node->getMountPoint()->getMountType(); + $result['mimetype'] = $node->getMimetype(); $result['has_preview'] = $this->previewManager->isAvailable($node); $result['storage_id'] = $node->getStorage()->getId(); diff --git a/apps/files_sharing/lib/ResponseDefinitions.php b/apps/files_sharing/lib/ResponseDefinitions.php index 313cf82bd51ca..70dd72b64e68f 100644 --- a/apps/files_sharing/lib/ResponseDefinitions.php +++ b/apps/files_sharing/lib/ResponseDefinitions.php @@ -39,6 +39,7 @@ * file_target: string, * has_preview: bool, * hide_download: 0|1, + * is-mount-root: bool, * id: string, * item_mtime: int, * item_permissions?: int, @@ -48,6 +49,7 @@ * label: string, * mail_send: 0|1, * mimetype: string, + * mount-type: string, * note: string, * parent: null, * password?: null|string, diff --git a/apps/files_sharing/openapi.json b/apps/files_sharing/openapi.json index 87f36d4331f88..e0f3a1397e51c 100644 --- a/apps/files_sharing/openapi.json +++ b/apps/files_sharing/openapi.json @@ -480,6 +480,7 @@ "file_target", "has_preview", "hide_download", + "is-mount-root", "id", "item_mtime", "item_size", @@ -488,6 +489,7 @@ "label", "mail_send", "mimetype", + "mount-type", "note", "parent", "path", @@ -543,6 +545,9 @@ 1 ] }, + "is-mount-root": { + "type": "boolean" + }, "id": { "type": "string" }, @@ -591,6 +596,9 @@ "mimetype": { "type": "string" }, + "mount-type": { + "type": "string" + }, "note": { "type": "string" },