Improve isMounted to handle primary storage object store

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-10-27 14:26:13 +02:00
parent eefd059716
commit 0ee958595e
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
2 changed files with 7 additions and 2 deletions

View File

@ -33,6 +33,7 @@ namespace OC\Files;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Storage\IStorage;
use OCP\Files\IHomeStorage;
use OCP\IUser;
class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
@ -305,7 +306,11 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
}
public function isMounted() {
$sid = $this->getStorage()->getId();
$storage = $this->getStorage();
if ($storage->instanceOfStorage('\OCP\Files\IHomeStorage')) {
return false;
}
$sid = $storage->getId();
if (!is_null($sid)) {
$sid = explode(':', $sid);
return ($sid[0] !== 'home' and $sid[0] !== 'shared');

View File

@ -51,7 +51,7 @@ class ObjectHomeMountProvider implements IHomeMountProvider {
*
* @param IUser $user
* @param IStorageFactory $loader
* @return \OCP\Files\Mount\IMountPoint[]
* @return \OCP\Files\Mount\IMountPoint
*/
public function getHomeMountForUser(IUser $user, IStorageFactory $loader) {