summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-05-10 16:03:28 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-11 20:45:03 +0200
commit5eb72a8a57210b44668fc1677ac3e057444665be (patch)
treea8f2875184e4fa3a88ddf17d194c7122185217b0 /apps
parent8d17d7f6cd1027a96586a25ae5a583ec50d56797 (diff)
downloadnextcloud-server-5eb72a8a57210b44668fc1677ac3e057444665be.tar.gz
nextcloud-server-5eb72a8a57210b44668fc1677ac3e057444665be.zip
Support fileid propfind on trash endpoint
Fixes #9416 In order to support previews on mobile clients they will need the fileid of files in the trashbin. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/lib/Helper.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/ITrash.php2
-rw-r--r--apps/files_trashbin/lib/Sabre/PropfindPlugin.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFile.php6
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolder.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolderFile.php4
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolderFolder.php4
7 files changed, 26 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/Helper.php b/apps/files_trashbin/lib/Helper.php
index 65407b8a56e..01a4fd231ea 100644
--- a/apps/files_trashbin/lib/Helper.php
+++ b/apps/files_trashbin/lib/Helper.php
@@ -62,7 +62,6 @@ class Helper {
$dirContent = $storage->getCache()->getFolderContents($mount->getInternalPath($view->getAbsolutePath($dir)));
foreach ($dirContent as $entry) {
$entryName = $entry->getName();
- $id = $entry->getId();
$name = $entryName;
if ($dir === '' || $dir === '/') {
$pathparts = pathinfo($entryName);
@@ -91,7 +90,8 @@ class Helper {
'directory' => ($dir === '/') ? '' : $dir,
'size' => $entry->getSize(),
'etag' => '',
- 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE
+ 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE,
+ 'fileid' => $entry->getId(),
);
if ($originalPath) {
if ($originalPath !== '.') {
diff --git a/apps/files_trashbin/lib/Sabre/ITrash.php b/apps/files_trashbin/lib/Sabre/ITrash.php
index 43e59e03bcf..6db9bccf0a2 100644
--- a/apps/files_trashbin/lib/Sabre/ITrash.php
+++ b/apps/files_trashbin/lib/Sabre/ITrash.php
@@ -33,4 +33,6 @@ interface ITrash {
public function getDeletionTime(): int;
public function getSize();
+
+ public function getFileId(): int;
}
diff --git a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php
index 078f85da8f8..492035304ba 100644
--- a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php
+++ b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php
@@ -69,6 +69,10 @@ class PropfindPlugin extends ServerPlugin {
$propFind->handle(FilesPlugin::SIZE_PROPERTYNAME, function () use ($node) {
return $node->getSize();
});
+
+ $propFind->handle(FilesPlugin::FILEID_PROPERTYNAME, function () use ($node) {
+ return $node->getFileId();
+ });
}
}
diff --git a/apps/files_trashbin/lib/Sabre/TrashFile.php b/apps/files_trashbin/lib/Sabre/TrashFile.php
index e4c67cbfb31..eba9eee641b 100644
--- a/apps/files_trashbin/lib/Sabre/TrashFile.php
+++ b/apps/files_trashbin/lib/Sabre/TrashFile.php
@@ -90,4 +90,10 @@ class TrashFile implements IFile, ITrash {
public function getDeletionTime(): int {
return $this->getLastModified();
}
+
+ public function getFileId(): int {
+ return $this->data->getId();
+ }
+
+
}
diff --git a/apps/files_trashbin/lib/Sabre/TrashFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolder.php
index 76ccb2b0df0..6b7d71b80ee 100644
--- a/apps/files_trashbin/lib/Sabre/TrashFolder.php
+++ b/apps/files_trashbin/lib/Sabre/TrashFolder.php
@@ -123,4 +123,8 @@ class TrashFolder implements ICollection, ITrash {
public function getSize(): int {
return $this->data->getSize();
}
+
+ public function getFileId(): int {
+ return $this->data->getId();
+ }
}
diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFile.php b/apps/files_trashbin/lib/Sabre/TrashFolderFile.php
index 9dd2f7b3ef5..921c98b02fb 100644
--- a/apps/files_trashbin/lib/Sabre/TrashFolderFile.php
+++ b/apps/files_trashbin/lib/Sabre/TrashFolderFile.php
@@ -101,4 +101,8 @@ class TrashFolderFile implements IFile, ITrash {
public function getDeletionTime(): int {
return $this->getLastModified();
}
+
+ public function getFileId(): int {
+ return $this->data->getId();
+ }
}
diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php
index de0725ab92f..2fe75479c1b 100644
--- a/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php
+++ b/apps/files_trashbin/lib/Sabre/TrashFolderFolder.php
@@ -136,4 +136,8 @@ class TrashFolderFolder implements ICollection, ITrash {
public function getSize(): int {
return $this->data->getSize();
}
+
+ public function getFileId(): int {
+ return $this->data->getId();
+ }
}