diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-11-12 14:06:32 +0100 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-11-12 14:06:32 +0100 |
commit | 238e4bc3eb966c0049b545f2b9cb2c45d8bef0d2 (patch) | |
tree | 6dfda1b60649d539a6cf073641360bea948ccd44 /apps/files_versions/lib/versions.php | |
parent | 90fac1f3712e54e3bccbad87095b04afb0f9d95a (diff) | |
download | nextcloud-server-238e4bc3eb966c0049b545f2b9cb2c45d8bef0d2.tar.gz nextcloud-server-238e4bc3eb966c0049b545f2b9cb2c45d8bef0d2.zip |
implement delete hooks in file versions lib
Diffstat (limited to 'apps/files_versions/lib/versions.php')
-rw-r--r-- | apps/files_versions/lib/versions.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 225611374a6..661e98b09d5 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -156,6 +156,7 @@ class Storage { } foreach ($versions as $v) { unlink($abs_path . $v['version']); + \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $abs_path . $v['version'])); $versionsSize -= $v['size']; } self::setVersionsSize($uid, $versionsSize); @@ -465,6 +466,7 @@ class Storage { while ($availableSpace < 0 && $i < $numOfVersions) { $version = current($allVersions); $versionsFileview->unlink($version['path'].'.v'.$version['version']); + \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'])); $versionsSize -= $version['size']; $availableSpace += $version['size']; next($allVersions); @@ -515,6 +517,7 @@ class Storage { if ($version['version'] > $nextVersion) { //distance between two version too small, delete version $versionsFileview->unlink($version['path'] . '.v' . $version['version']); + \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'] . '.v' . $version['version'])); $size += $version['size']; unset($allVersions[$key]); // update array with all versions } else { |