summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/SharedStorage.php
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-10-22 11:47:37 +0200
committerGitHub <noreply@github.com>2021-10-22 11:47:37 +0200
commite673ec0b879e4d32bb468825c549738e342df0f2 (patch)
treea7a01e82ac7b7aaddb07232a2d71aee85c17d8a9 /apps/files_sharing/lib/SharedStorage.php
parent7995c6e1dce83becf1e948de960894d481775a6f (diff)
parent0a359376628b36256aa8332d79b1af1dfc513ce8 (diff)
downloadnextcloud-server-e673ec0b879e4d32bb468825c549738e342df0f2.tar.gz
nextcloud-server-e673ec0b879e4d32bb468825c549738e342df0f2.zip
Merge branch 'master' into imountpoint-ocp-storage
Diffstat (limited to 'apps/files_sharing/lib/SharedStorage.php')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index bfd3f3da482..3ded20eb495 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -30,20 +30,22 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Files_Sharing;
use OC\Files\Cache\FailedCache;
use OC\Files\Cache\NullWatcher;
+use OC\Files\Cache\Watcher;
use OC\Files\Filesystem;
use OC\Files\Storage\FailedStorage;
use OC\Files\Storage\Wrapper\PermissionsMask;
use OC\User\NoUserException;
+use OCA\Files_External\Config\ExternalMountPoint;
use OCP\Constants;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\NotFoundException;
use OCP\Files\Storage\IDisableEncryptionStorage;
use OCP\Files\Storage\IStorage;
+use OCP\IUserManager;
use OCP\Lock\ILockingProvider;
use OCP\Share\IShare;
@@ -381,7 +383,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
return new FailedCache();
}
- $this->cache = new \OCA\Files_Sharing\Cache($storage, $sourceRoot, $this->superShare);
+ $this->cache = new \OCA\Files_Sharing\Cache(
+ $storage,
+ $sourceRoot,
+ \OC::$server->get(IUserManager::class)
+ );
return $this->cache;
}
@@ -396,7 +402,20 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
return $this->superShare->getShareOwner();
}
- public function getWatcher($path = '', $storage = null): NullWatcher {
+ public function getWatcher($path = '', $storage = null): Watcher {
+ $mountManager = \OC::$server->getMountManager();
+
+ // Get node informations
+ $node = $this->getShare()->getNodeCacheEntry();
+ if ($node) {
+ $mount = $mountManager->findByNumericId($node->getStorageId());
+ // If the share is originating from an external storage
+ if (count($mount) > 0 && $mount[0] instanceof ExternalMountPoint) {
+ // Propagate original storage scan
+ return parent::getWatcher($path, $storage);
+ }
+ }
+
// cache updating is handled by the share source
return new NullWatcher();
}