Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
optimize isShared and isMounted
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Oct 23, 2023
commit 96471c6b3e72edf682cac3dec956dccb7e439b50
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