Skip to content

Commit 03bbe06

Browse files
authored
Merge pull request #49265 from nextcloud/feat/dav-trashbin-backend
feat(trashbin): Add backend dav property
2 parents 967e1a8 + 119e7d1 commit 03bbe06

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/files_trashbin/lib/Sabre/TrashbinPlugin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace OCA\Files_Trashbin\Sabre;
1010

1111
use OCA\DAV\Connector\Sabre\FilesPlugin;
12+
use OCA\Files_Trashbin\Trash\ITrashItem;
1213
use OCP\IPreview;
1314
use Sabre\DAV\INode;
1415
use Sabre\DAV\PropFind;
@@ -24,6 +25,7 @@ class TrashbinPlugin extends ServerPlugin {
2425
public const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title';
2526
public const TRASHBIN_DELETED_BY_ID = '{http://nextcloud.org/ns}trashbin-deleted-by-id';
2627
public const TRASHBIN_DELETED_BY_DISPLAY_NAME = '{http://nextcloud.org/ns}trashbin-deleted-by-display-name';
28+
public const TRASHBIN_BACKEND = '{http://nextcloud.org/ns}trashbin-backend';
2729

2830
/** @var Server */
2931
private $server;
@@ -104,6 +106,14 @@ public function propFind(PropFind $propFind, INode $node) {
104106
$propFind->handle(FilesPlugin::MOUNT_TYPE_PROPERTYNAME, function () {
105107
return '';
106108
});
109+
110+
$propFind->handle(self::TRASHBIN_BACKEND, function () use ($node) {
111+
$fileInfo = $node->getFileInfo();
112+
if (!($fileInfo instanceof ITrashItem)) {
113+
return '';
114+
}
115+
return $fileInfo->getTrashBackend()::class;
116+
});
107117
}
108118

109119
/**

0 commit comments

Comments
 (0)