summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/trashbin.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-06-09 17:01:31 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-15 14:32:29 +0200
commit5efbab4ab8b844051ad289dc0f8cb6f48604c971 (patch)
treee00cbf2cfb89c306ec5ed6dcf169fbd313a07205 /apps/files_trashbin/lib/trashbin.php
parenta4f808b11d2e49e4c73a910a12574df177b2f5c7 (diff)
downloadnextcloud-server-5efbab4ab8b844051ad289dc0f8cb6f48604c971.tar.gz
nextcloud-server-5efbab4ab8b844051ad289dc0f8cb6f48604c971.zip
ensure we dont have to scan a file in the trash wrapper
Diffstat (limited to 'apps/files_trashbin/lib/trashbin.php')
-rw-r--r--apps/files_trashbin/lib/trashbin.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 853bc1eda69..3a221bc2d09 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -55,6 +55,15 @@ class Trashbin {
*/
private static $scannedVersions = false;
+ /**
+ * Ensure we dont need to scan the file during the move to trash
+ *
+ * @param array $params
+ */
+ public static function ensureFileScannedHook($params) {
+ self::getUidAndFilename($params['path']);
+ }
+
public static function getUidAndFilename($filename) {
$uid = \OC\Files\Filesystem::getOwner($filename);
\OC\Files\Filesystem::initMountPoints($uid);
@@ -870,6 +879,7 @@ class Trashbin {
//Listen to post write hook
\OCP\Util::connectHook('OC_Filesystem', 'post_write', 'OCA\Files_Trashbin\Hooks', 'post_write_hook');
// pre and post-rename, disable trash logic for the copy+unlink case
+ \OCP\Util::connectHook('OC_Filesystem', 'delete', 'OCA\Files_Trashbin\Trashbin', 'ensureFileScannedHook');
\OCP\Util::connectHook('OC_Filesystem', 'rename', 'OCA\Files_Trashbin\Storage', 'preRenameHook');
\OCP\Util::connectHook('OC_Filesystem', 'post_rename', 'OCA\Files_Trashbin\Storage', 'postRenameHook');
}