Skip to content

Commit

Permalink
Merge pull request #2710 from nextcloud/backport/2641/stable26
Browse files Browse the repository at this point in the history
[stable26] Emit hook for restore
  • Loading branch information
come-nc authored Jan 2, 2024
2 parents 68b2926 + 84677e8 commit a75745b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Trash/TrashBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ public function restoreItem(ITrashItem $item) {
$targetFolder->getStorage()->moveFromStorage($trashStorage, $node->getInternalPath(), $targetLocation);
$targetFolder->getStorage()->getUpdater()->renameFromStorage($trashStorage, $node->getInternalPath(), $targetLocation);
$this->trashManager->removeItem((int)$folderId, $item->getName(), $item->getDeletedTime());
\OCP\Util::emitHook(
'\OCA\Files_Trashbin\Trashbin',
'post_restore',
[
'filePath' => '/' . $item->getGroupFolderMountPoint() . '/' . $originalLocation,
'trashPath' => $item->getPath(),
]
);
}

/**
Expand Down

0 comments on commit a75745b

Please sign in to comment.