Skip to content

Commit 583517e

Browse files
committed
feat(trashbin): Add deleted by properties
Signed-off-by: Christopher Ng <[email protected]>
1 parent caed644 commit 583517e

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
@@ -41,6 +41,8 @@ class TrashbinPlugin extends ServerPlugin {
4141
public const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location';
4242
public const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time';
4343
public const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title';
44+
public const TRASHBIN_DELETED_BY_ID = '{http://nextcloud.org/ns}trashbin-deleted-by-id';
45+
public const TRASHBIN_DELETED_BY_DISPLAY_NAME = '{http://nextcloud.org/ns}trashbin-deleted-by-display-name';
4446

4547
/** @var Server */
4648
private $server;
@@ -83,6 +85,14 @@ public function propFind(PropFind $propFind, INode $node) {
8385
return $node->getDeletionTime();
8486
});
8587

88+
$propFind->handle(self::TRASHBIN_DELETED_BY_ID, function () use ($node) {
89+
return $node->getDeletedBy()?->getUID();
90+
});
91+
92+
$propFind->handle(self::TRASHBIN_DELETED_BY_DISPLAY_NAME, function () use ($node) {
93+
return $node->getDeletedBy()?->getDisplayName();
94+
});
95+
8696
$propFind->handle(FilesPlugin::SIZE_PROPERTYNAME, function () use ($node) {
8797
return $node->getSize();
8898
});

0 commit comments

Comments
 (0)