summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-05-09 08:40:53 +0200
committerGitHub <noreply@github.com>2018-05-09 08:40:53 +0200
commit57ea4624741c36ed6e68f60c672ddddbfece628a (patch)
treeb0c3fa909e11a98b4424d914f61da97e0f80029f
parent412925e71da4613be9a8b522f57c7da0277121ec (diff)
parent21d4ce926ef980db40fc1260ea3686be01a81252 (diff)
downloadnextcloud-server-57ea4624741c36ed6e68f60c672ddddbfece628a.tar.gz
nextcloud-server-57ea4624741c36ed6e68f60c672ddddbfece628a.zip
Merge pull request #9415 from nextcloud/feature/noid/trashbin_dav_deletion_time
Propfind for deletion time of trash files
-rw-r--r--apps/files_trashbin/lib/Sabre/ITrash.php2
-rw-r--r--apps/files_trashbin/lib/Sabre/PropfindPlugin.php5
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFile.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolder.php3
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolderFile.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolderFolder.php4
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();
+ }
}