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

Propfind for deletion time of trash files

parent 9fe95e8a
No related branches found
No related tags found
No related merge requests found
...@@ -29,4 +29,6 @@ interface ITrash { ...@@ -29,4 +29,6 @@ interface ITrash {
public function getFilename(): string; public function getFilename(): string;
public function getOriginalLocation(): string; public function getOriginalLocation(): string;
public function getDeletionTime(): int;
} }
...@@ -33,6 +33,7 @@ class PropfindPlugin extends ServerPlugin { ...@@ -33,6 +33,7 @@ class PropfindPlugin extends ServerPlugin {
const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename'; const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename';
const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location'; const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location';
const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time';
/** @var Server */ /** @var Server */
private $server; private $server;
...@@ -59,6 +60,10 @@ class PropfindPlugin extends ServerPlugin { ...@@ -59,6 +60,10 @@ class PropfindPlugin extends ServerPlugin {
$propFind->handle(self::TRASHBIN_ORIGINAL_LOCATION, function() use ($node) { $propFind->handle(self::TRASHBIN_ORIGINAL_LOCATION, function() use ($node) {
return $node->getOriginalLocation(); return $node->getOriginalLocation();
}); });
$propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) {
return $node->getDeletionTime();
});
} }
} }
...@@ -87,5 +87,7 @@ class TrashFile implements IFile, ITrash { ...@@ -87,5 +87,7 @@ class TrashFile implements IFile, ITrash {
return $this->data['extraData']; return $this->data['extraData'];
} }
public function getDeletionTime(): int {
return $this->getLastModified();
}
} }
...@@ -116,5 +116,8 @@ class TrashFolder implements ICollection, ITrash { ...@@ -116,5 +116,8 @@ class TrashFolder implements ICollection, ITrash {
return $this->data['extraData']; return $this->data['extraData'];
} }
public function getDeletionTime(): int {
return $this->getLastModified();
}
} }
...@@ -98,5 +98,7 @@ class TrashFolderFile implements IFile, ITrash { ...@@ -98,5 +98,7 @@ class TrashFolderFile implements IFile, ITrash {
return $this->location . '/' . $this->getFilename(); return $this->location . '/' . $this->getFilename();
} }
public function getDeletionTime(): int {
return $this->getLastModified();
}
} }
...@@ -129,5 +129,7 @@ class TrashFolderFolder implements ICollection, ITrash { ...@@ -129,5 +129,7 @@ class TrashFolderFolder implements ICollection, ITrash {
return $this->location . '/' . $this->getFilename(); return $this->location . '/' . $this->getFilename();
} }
public function getDeletionTime(): int {
return $this->getLastModified();
}
} }
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