Skip to content
Snippets Groups Projects
Unverified Commit 58219638 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

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: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent 58e4ddd6
No related branches found
No related tags found
No related merge requests found
...@@ -31,4 +31,6 @@ interface ITrash { ...@@ -31,4 +31,6 @@ interface ITrash {
public function getOriginalLocation(): string; public function getOriginalLocation(): string;
public function getDeletionTime(): int; public function getDeletionTime(): int;
public function getSize();
} }
...@@ -24,6 +24,7 @@ declare(strict_types=1); ...@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace OCA\Files_Trashbin\Sabre; namespace OCA\Files_Trashbin\Sabre;
use OCA\DAV\Connector\Sabre\FilesPlugin;
use Sabre\DAV\INode; use Sabre\DAV\INode;
use Sabre\DAV\PropFind; use Sabre\DAV\PropFind;
use Sabre\DAV\Server; use Sabre\DAV\Server;
...@@ -64,6 +65,10 @@ class PropfindPlugin extends ServerPlugin { ...@@ -64,6 +65,10 @@ class PropfindPlugin extends ServerPlugin {
$propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) { $propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) {
return $node->getDeletionTime(); return $node->getDeletionTime();
}); });
$propFind->handle(FilesPlugin::SIZE_PROPERTYNAME, function () use ($node) {
return $node->getSize();
});
} }
} }
...@@ -120,4 +120,7 @@ class TrashFolder implements ICollection, ITrash { ...@@ -120,4 +120,7 @@ class TrashFolder implements ICollection, ITrash {
return $this->getLastModified(); return $this->getLastModified();
} }
public function getSize(): int {
return $this->data->getSize();
}
} }
...@@ -132,4 +132,8 @@ class TrashFolderFolder implements ICollection, ITrash { ...@@ -132,4 +132,8 @@ class TrashFolderFolder implements ICollection, ITrash {
public function getDeletionTime(): int { public function getDeletionTime(): int {
return $this->getLastModified(); return $this->getLastModified();
} }
public function getSize(): int {
return $this->data->getSize();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment