nextcloud / groupfolders

๐Ÿ“๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Admin-configured folders shared by everyone in a group. https://github.com/nextcloud-releases/groupfolders
https://apps.nextcloud.com/apps/groupfolders
278 stars 85 forks source link

Trash backend doesn't emit notifications when deleting/restoring items #442

Open rerobins opened 5 years ago

rerobins commented 5 years ago

files_trashbin emits several events when a file is removed or restored from the trashbin. These are not emitted by the lib/Trash/TrashBackend.php

https://github.com/nextcloud/groupfolders/blob/4d672956b8f1ac761b16a32cae02681ad1657bfe/lib/Trash/TrashBackend.php#L87

https://github.com/nextcloud/groupfolders/blob/4d672956b8f1ac761b16a32cae02681ad1657bfe/lib/Trash/TrashBackend.php#L111

Specifically the events are:

\OC_Hook::emit('\OCP\Trashbin', 'delete', array('path' => $path));
\OC_Hook::emit('\OCP\Trashbin', 'preDelete', array('path' => $path));
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
                'trashPath' => Filesystem::normalizePath($file)));
joshtrichards commented 1 week ago

2641 added it for restoreItem(). So 1 of 2 in this issue are done. Adding the other can be modeled after that one now.