Skip to content

Commit

Permalink
optimize isShared and isMounted
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Oct 23, 2023
1 parent bb912ad commit 96471c6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
*/
namespace OC\Files;

use OCA\Files_Sharing\ISharedStorage;
use OCA\Files_External\Config\ConfigAdapter;
use OCA\Files_Sharing\External\Mount;
use OCA\Files_Sharing\SharedMount;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\IHomeStorage;
use OCP\Files\Mount\IMountPoint;
use OCP\IUser;

Expand Down Expand Up @@ -311,13 +312,11 @@ public function isShareable() {
* @return bool
*/
public function isShared() {
$storage = $this->getStorage();
return $storage->instanceOfStorage(ISharedStorage::class);
return $this->mount instanceof SharedMount || $this->mount instanceof Mount;
}

public function isMounted() {
$storage = $this->getStorage();
return !($storage->instanceOfStorage(IHomeStorage::class) || $storage->instanceOfStorage(ISharedStorage::class));
return $this->mount instanceof ConfigAdapter;
}

/**
Expand Down

0 comments on commit 96471c6

Please sign in to comment.