From caed644c03c3bbaff59135705f47be392402401c Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 11 Apr 2024 17:39:59 -0700 Subject: chore(trashbin): Add method to get deleted by from trash item Signed-off-by: Christopher Ng --- apps/files_trashbin/lib/Helper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/files_trashbin/lib/Helper.php') 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); } -- cgit v1.2.3