diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-08 09:08:43 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-08 09:08:43 +0200 |
commit | 21d4ce926ef980db40fc1260ea3686be01a81252 (patch) | |
tree | 8c7302d25b6f784522bdfa353205b5498ad0a825 /apps/files_trashbin | |
parent | 9fe95e8a7cf5f639fe3ba2a3aa33ce4a5c9a77b6 (diff) | |
download | nextcloud-server-21d4ce926ef980db40fc1260ea3686be01a81252.tar.gz nextcloud-server-21d4ce926ef980db40fc1260ea3686be01a81252.zip |
Propfind for deletion time of trash files
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_trashbin')
-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/TrashFile.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolder.php | 3 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolderFile.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolderFolder.php | 4 |
6 files changed, 19 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/Sabre/ITrash.php b/apps/files_trashbin/lib/Sabre/ITrash.php index b0ff2b1570a..7ec27f78859 100644 --- a/apps/files_trashbin/lib/Sabre/ITrash.php +++ b/apps/files_trashbin/lib/Sabre/ITrash.php @@ -29,4 +29,6 @@ interface ITrash { public function getFilename(): string; public function getOriginalLocation(): string; + + public function getDeletionTime(): int; } diff --git a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php index e50ee08590a..a0aaa552a14 100644 --- a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php +++ b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php @@ -33,6 +33,7 @@ class PropfindPlugin extends ServerPlugin { const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename'; const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location'; + const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time'; /** @var Server */ private $server; @@ -59,6 +60,10 @@ class PropfindPlugin extends ServerPlugin { $propFind->handle(self::TRASHBIN_ORIGINAL_LOCATION, function() use ($node) { return $node->getOriginalLocation(); }); + + $propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) { + return $node->getDeletionTime(); + }); } } diff --git a/apps/files_trashbin/lib/Sabre/TrashFile.php b/apps/files_trashbin/lib/Sabre/TrashFile.php index 29e7a955623..e4c67cbfb31 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFile.php +++ b/apps/files_trashbin/lib/Sabre/TrashFile.php @@ -87,5 +87,7 @@ class TrashFile implements IFile, ITrash { return $this->data['extraData']; } - + public function getDeletionTime(): int { + return $this->getLastModified(); + } } diff --git a/apps/files_trashbin/lib/Sabre/TrashFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolder.php index 33236eea262..e1fd965487b 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolder.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolder.php @@ -116,5 +116,8 @@ class TrashFolder implements ICollection, ITrash { return $this->data['extraData']; } + public function getDeletionTime(): int { + return $this->getLastModified(); + } } diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFile.php b/apps/files_trashbin/lib/Sabre/TrashFolderFile.php index 95e82d95a6e..9dd2f7b3ef5 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolderFile.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolderFile.php @@ -98,5 +98,7 @@ class TrashFolderFile implements IFile, ITrash { return $this->location . '/' . $this->getFilename(); } - + public function getDeletionTime(): int { + return $this->getLastModified(); + } } diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php index d2923c58916..3c2c4138095 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php @@ -129,5 +129,7 @@ class TrashFolderFolder implements ICollection, ITrash { return $this->location . '/' . $this->getFilename(); } - + public function getDeletionTime(): int { + return $this->getLastModified(); + } } |