aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-10-23 13:22:23 +0200
committerRobin Appelman <robin@icewind.nl>2023-11-08 17:34:58 +0100
commitf4fa2fb93cd230a69ae6d6aad6b293b3a576eae7 (patch)
treeb96bd1184ddd128c59b491a89e505a6ba33483ea /lib
parentdec880b285e47207eeebd36b1c512c1d85a18676 (diff)
downloadnextcloud-server-f4fa2fb93cd230a69ae6d6aad6b293b3a576eae7.tar.gz
nextcloud-server-f4fa2fb93cd230a69ae6d6aad6b293b3a576eae7.zip
optimize isShared and isMounted
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/FileInfo.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php
index da0ae7e8d89..4ef32861f24 100644
--- a/lib/private/Files/FileInfo.php
+++ b/lib/private/Files/FileInfo.php
@@ -33,9 +33,10 @@
*/
namespace OC\Files;
-use OCA\Files_Sharing\ISharedStorage;
+use OC\Files\Mount\HomeMountPoint;
+use OCA\Files_Sharing\External\Mount;
+use OCA\Files_Sharing\ISharedMountPoint;
use OCP\Files\Cache\ICacheEntry;
-use OCP\Files\IHomeStorage;
use OCP\Files\Mount\IMountPoint;
use OCP\IUser;
@@ -312,13 +313,12 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return bool
*/
public function isShared() {
- $storage = $this->getStorage();
- return $storage->instanceOfStorage(ISharedStorage::class);
+ return $this->mount instanceof ISharedMountPoint;
}
public function isMounted() {
- $storage = $this->getStorage();
- return !($storage->instanceOfStorage(IHomeStorage::class) || $storage->instanceOfStorage(ISharedStorage::class));
+ $isHome = $this->mount instanceof HomeMountPoint;
+ return !$isHome && !$this->isShared();
}
/**