Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-08-12 09:07:18 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2021-09-10 09:55:54 +0300
commit719480ad9d74f002065d5661ff1f9fc8ce6ad301 (patch)
treee9dc50af0afe1b79f1b79a2dd9daa770ab6b675b /apps/files_sharing/lib
parent74a149720d2fd57f7a68e233575779e10a953311 (diff)
Return proper watcher if SharedStorage originates from ExternalMount
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index f4a525ce871..66f883e106c 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -34,10 +34,12 @@ 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;
@@ -405,7 +407,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();
}