Skip to content

Commit

Permalink
Emit hook when restoring a file from trashbin
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Nov 27, 2023
1 parent daff4c5 commit 4998479
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 4998479

Please sign in to comment.