Browse Source
Merge pull request #9447 from nextcloud/feature/noid/trashbin_propfind_oc_size
Trashbin propfind respond to oc:size
pull/9446/head
Roeland Jago Douma
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
14 additions and
0 deletions
-
apps/files_trashbin/lib/Sabre/ITrash.php
-
apps/files_trashbin/lib/Sabre/PropfindPlugin.php
-
apps/files_trashbin/lib/Sabre/TrashFolder.php
-
apps/files_trashbin/lib/Sabre/TrashFolderFolder.php
|
|
@ -31,4 +31,6 @@ interface ITrash { |
|
|
|
public function getOriginalLocation(): string; |
|
|
|
|
|
|
|
public function getDeletionTime(): int; |
|
|
|
|
|
|
|
public function getSize(); |
|
|
|
} |
|
|
@ -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(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -120,4 +120,7 @@ class TrashFolder implements ICollection, ITrash { |
|
|
|
return $this->getLastModified(); |
|
|
|
} |
|
|
|
|
|
|
|
public function getSize(): int { |
|
|
|
return $this->data->getSize(); |
|
|
|
} |
|
|
|
} |
|
|
@ -132,4 +132,8 @@ class TrashFolderFolder implements ICollection, ITrash { |
|
|
|
public function getDeletionTime(): int { |
|
|
|
return $this->getLastModified(); |
|
|
|
} |
|
|
|
|
|
|
|
public function getSize(): int { |
|
|
|
return $this->data->getSize(); |
|
|
|
} |
|
|
|
} |