summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Trashbin.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/Trashbin.php')
-rw-r--r--apps/files_trashbin/lib/Trashbin.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index d449a136016..975e9fd2557 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -54,6 +54,7 @@ use OC\Files\View;
use OCA\Files_Trashbin\AppInfo\Application;
use OCA\Files_Trashbin\Command\Expire;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\App\IAppManager;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\NotFoundException;
@@ -395,7 +396,7 @@ class Trashbin {
* @param integer $timestamp when the file was deleted
*/
private static function retainVersions($filename, $owner, $ownerPath, $timestamp) {
- if (\OCP\App::isEnabled('files_versions') && !empty($ownerPath)) {
+ if (\OCP\Server::get(IAppManager::class)->isEnabledForUser('files_versions') && !empty($ownerPath)) {
$user = OC_User::getUser();
$rootView = new View('/');
@@ -543,7 +544,7 @@ class Trashbin {
* @return false|null
*/
private static function restoreVersions(View $view, $file, $filename, $uniqueFilename, $location, $timestamp) {
- if (\OCP\App::isEnabled('files_versions')) {
+ if (\OCP\Server::get(IAppManager::class)->isEnabledForUser('files_versions')) {
$user = OC_User::getUser();
$rootView = new View('/');
@@ -704,7 +705,7 @@ class Trashbin {
*/
private static function deleteVersions(View $view, $file, $filename, $timestamp, $user) {
$size = 0;
- if (\OCP\App::isEnabled('files_versions')) {
+ if (\OCP\Server::get(IAppManager::class)->isEnabledForUser('files_versions')) {
if ($view->is_dir('files_trashbin/versions/' . $file)) {
$size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
$view->unlink('files_trashbin/versions/' . $file);