diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-09-10 16:27:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 16:27:39 +0300 |
commit | a79ffaba4849e2025bd08075adf00cfbbe3f6315 (patch) | |
tree | 7dea6fae94203784bd9ef6d9885f686aeeab8ddc /apps/files_sharing/lib | |
parent | e71ce6f6598530506ad606cd22abae01ea861fca (diff) |
Return proper watcher if SharedStorage originates from ExternalMount
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index c06c750dc17..127fcbbccbc 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -401,7 +401,20 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto return $this->superShare->getShareOwner(); } - public function getWatcher($path = '', $storage = null) { + 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(); } |