Skip to content

Commit

Permalink
Merge pull request #2693 from nextcloud/backport/2641/stable28
Browse files Browse the repository at this point in the history
[stable28] Emit hook for restore
  • Loading branch information
come-nc authored Dec 21, 2023
2 parents 1b39255 + 0e565ea commit 3a1d97c
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 @@ -171,6 +171,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 3a1d97c

Please sign in to comment.