summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r--apps/files_trashbin/lib/trash.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 50fdaccfb1e..cff97418fe4 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -868,5 +868,20 @@ class Trashbin {
//Listen to delete user signal
\OCP\Util::connectHook('OC_User', 'pre_deleteUser', "OCA\Files_Trashbin\Hooks", "deleteUser_hook");
}
+
+ /**
+ * @brief check if trash bin is empty for a given user
+ * @param string $user
+ */
+ public static function isEmpty($user) {
+
+ $trashSize = self::getTrashbinSize($user);
+
+ if ($trashSize !== false && $trashSize > 0) {
+ return false;
+ }
+
+ return true;
+ }
}