diff options
author | Pytal <24800714+Pytal@users.noreply.github.com> | 2024-12-03 16:27:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 16:27:35 -0800 |
commit | 03bbe062cc3ddc9f9e1cd2c3fed631f8717aa654 (patch) | |
tree | 463438137a4f341edb7d67ca5acc1721cc278af2 /apps | |
parent | 967e1a894a5ba8be9e9fbd1f5f2e6158e3600806 (diff) | |
parent | 119e7d1bd702a8db59eb1882f5ce9ba93666cc53 (diff) | |
download | nextcloud-server-03bbe062cc3ddc9f9e1cd2c3fed631f8717aa654.tar.gz nextcloud-server-03bbe062cc3ddc9f9e1cd2c3fed631f8717aa654.zip |
Merge pull request #49265 from nextcloud/feat/dav-trashbin-backend
feat(trashbin): Add backend dav property
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashbinPlugin.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php index b2864e9a1c6..2a2e3a141dc 100644 --- a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php +++ b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace OCA\Files_Trashbin\Sabre; use OCA\DAV\Connector\Sabre\FilesPlugin; +use OCA\Files_Trashbin\Trash\ITrashItem; use OCP\IPreview; use Sabre\DAV\INode; use Sabre\DAV\PropFind; @@ -24,6 +25,7 @@ class TrashbinPlugin extends ServerPlugin { public const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title'; public const TRASHBIN_DELETED_BY_ID = '{http://nextcloud.org/ns}trashbin-deleted-by-id'; public const TRASHBIN_DELETED_BY_DISPLAY_NAME = '{http://nextcloud.org/ns}trashbin-deleted-by-display-name'; + public const TRASHBIN_BACKEND = '{http://nextcloud.org/ns}trashbin-backend'; /** @var Server */ private $server; @@ -104,6 +106,14 @@ class TrashbinPlugin extends ServerPlugin { $propFind->handle(FilesPlugin::MOUNT_TYPE_PROPERTYNAME, function () { return ''; }); + + $propFind->handle(self::TRASHBIN_BACKEND, function () use ($node) { + $fileInfo = $node->getFileInfo(); + if (!($fileInfo instanceof ITrashItem)) { + return ''; + } + return $fileInfo->getTrashBackend()::class; + }); } /** |