Browse Source

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>
pull/9447/head
Roeland Jago Douma 8 years ago
parent
commit
58219638d7
No known key found for this signature in database GPG Key ID: F941078878347C0C
  1. 2
      apps/files_trashbin/lib/Sabre/ITrash.php
  2. 5
      apps/files_trashbin/lib/Sabre/PropfindPlugin.php
  3. 3
      apps/files_trashbin/lib/Sabre/TrashFolder.php
  4. 4
      apps/files_trashbin/lib/Sabre/TrashFolderFolder.php

2
apps/files_trashbin/lib/Sabre/ITrash.php

@ -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();
} }

5
apps/files_trashbin/lib/Sabre/PropfindPlugin.php

@ -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 {
$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();
});
} }
} }

3
apps/files_trashbin/lib/Sabre/TrashFolder.php

@ -120,4 +120,7 @@ class TrashFolder implements ICollection, ITrash {
return $this->getLastModified(); return $this->getLastModified();
} }
public function getSize(): int {
return $this->data->getSize();
}
} }

4
apps/files_trashbin/lib/Sabre/TrashFolderFolder.php

@ -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();
}
} }
Loading…
Cancel
Save