diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-05-11 20:24:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-11 20:24:38 +0200 |
commit | 8d17d7f6cd1027a96586a25ae5a583ec50d56797 (patch) | |
tree | 119f883d1f991561d6222a5516434795d7f088a9 | |
parent | 4b1c315dcabb9f96b27557ddd6595154b218ce46 (diff) | |
parent | 58219638d7bd552a7aa66695038c78c4c0fc309e (diff) | |
download | nextcloud-server-8d17d7f6cd1027a96586a25ae5a583ec50d56797.tar.gz nextcloud-server-8d17d7f6cd1027a96586a25ae5a583ec50d56797.zip |
Merge pull request #9447 from nextcloud/feature/noid/trashbin_propfind_oc_size
Trashbin propfind respond to oc:size
-rw-r--r-- | apps/files_trashbin/lib/Sabre/ITrash.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/PropfindPlugin.php | 5 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolder.php | 3 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolderFolder.php | 4 |
4 files changed, 14 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Sabre/ITrash.php b/apps/files_trashbin/lib/Sabre/ITrash.php index 7ec27f78859..43e59e03bcf 100644 --- a/apps/files_trashbin/lib/Sabre/ITrash.php +++ b/apps/files_trashbin/lib/Sabre/ITrash.php @@ -31,4 +31,6 @@ interface ITrash { public function getOriginalLocation(): string; public function getDeletionTime(): int; + + public function getSize(); } diff --git a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php index a0aaa552a14..078f85da8f8 100644 --- a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php +++ b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace OCA\Files_Trashbin\Sabre; +use OCA\DAV\Connector\Sabre\FilesPlugin; use Sabre\DAV\INode; use Sabre\DAV\PropFind; use Sabre\DAV\Server; @@ -64,6 +65,10 @@ class PropfindPlugin extends ServerPlugin { $propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) { return $node->getDeletionTime(); }); + + $propFind->handle(FilesPlugin::SIZE_PROPERTYNAME, function () use ($node) { + return $node->getSize(); + }); } } diff --git a/apps/files_trashbin/lib/Sabre/TrashFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolder.php index e1fd965487b..76ccb2b0df0 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolder.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolder.php @@ -120,4 +120,7 @@ class TrashFolder implements ICollection, ITrash { return $this->getLastModified(); } + public function getSize(): int { + return $this->data->getSize(); + } } diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php index 3c2c4138095..de0725ab92f 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php @@ -132,4 +132,8 @@ class TrashFolderFolder implements ICollection, ITrash { public function getDeletionTime(): int { return $this->getLastModified(); } + + public function getSize(): int { + return $this->data->getSize(); + } } |