diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-10 16:12:33 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-10 16:12:33 +0200 |
commit | 58219638d7bd552a7aa66695038c78c4c0fc309e (patch) | |
tree | 3fb34811fdcabbe6bdcf53a57cb41cbaded8c4f5 /apps/files_trashbin/lib | |
parent | 58e4ddd63807227d7477fed70f0297a124f64cdf (diff) | |
download | nextcloud-server-58219638d7bd552a7aa66695038c78c4c0fc309e.tar.gz nextcloud-server-58219638d7bd552a7aa66695038c78c4c0fc309e.zip |
Trashbin propfind respond to oc:size
In order to display the total size of folders also in the clients (and
web) we should return the oc:size.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_trashbin/lib')
-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(); + } } |