aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Helper.php
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2024-04-11 17:39:59 -0700
committerChristopher Ng <chrng8@gmail.com>2024-04-23 16:20:41 -0700
commitcaed644c03c3bbaff59135705f47be392402401c (patch)
tree96c0528f15839ed58a32d3c7549352feac52a408 /apps/files_trashbin/lib/Helper.php
parentb41834fb8d53e2a7d81247046731f398a80dcb1b (diff)
downloadnextcloud-server-caed644c03c3bbaff59135705f47be392402401c.tar.gz
nextcloud-server-caed644c03c3bbaff59135705f47be392402401c.zip
chore(trashbin): Add method to get deleted by from trash item
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/files_trashbin/lib/Helper.php')
-rw-r--r--apps/files_trashbin/lib/Helper.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/Helper.php b/apps/files_trashbin/lib/Helper.php
index 61d8eb9c715..ba28751e99f 100644
--- a/apps/files_trashbin/lib/Helper.php
+++ b/apps/files_trashbin/lib/Helper.php
@@ -60,7 +60,7 @@ class Helper {
$absoluteDir = $view->getAbsolutePath($dir);
$internalPath = $mount->getInternalPath($absoluteDir);
- $originalLocations = \OCA\Files_Trashbin\Trashbin::getLocations($user);
+ $extraData = \OCA\Files_Trashbin\Trashbin::getExtraData($user);
$dirContent = $storage->getCache()->getFolderContents($mount->getInternalPath($view->getAbsolutePath($dir)));
foreach ($dirContent as $entry) {
$entryName = $entry->getName();
@@ -76,8 +76,8 @@ class Helper {
}
$originalPath = '';
$originalName = substr($entryName, 0, -strlen($timestamp) - 2);
- if (isset($originalLocations[$originalName][$timestamp])) {
- $originalPath = $originalLocations[$originalName][$timestamp];
+ if (isset($extraData[$originalName][$timestamp]['location'])) {
+ $originalPath = $extraData[$originalName][$timestamp]['location'];
if (substr($originalPath, -1) === '/') {
$originalPath = substr($originalPath, 0, -1);
}
@@ -101,6 +101,7 @@ class Helper {
$i['extraData'] = $originalName;
}
}
+ $i['deletedBy'] = $extraData[$originalName][$timestamp]['deletedBy'] ?? null;
$result[] = new FileInfo($absoluteDir . '/' . $i['name'], $storage, $internalPath . '/' . $i['name'], $i, $mount);
}