mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
feat(trashbin): Add backend dav property
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
0729e264f5
commit
119e7d1bd7
1 changed files with 10 additions and 0 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue