Skip to content

Commit

Permalink
Return proper watcher if SharedStorage originates from ExternalMount
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Sep 10, 2021
1 parent e71ce6f commit a79ffab
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,20 @@ public function getOwner($path) {
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();
}
Expand Down

0 comments on commit a79ffab

Please sign in to comment.