/** * Listen on the propagator for updates made to shares owned by a user * * @param \OC\Files\Cache\ChangePropagator $propagator * @param string $owner */ public function attachToPropagator(ChangePropagator $propagator, $owner) { $propagator->listen('\\OC\\Files', 'propagate', function ($path, $entry) use($owner) { $this->propagateById($entry['fileid']); }); }
/** * Listen on the propagator for updates made to shares owned by a user * * @param \OC\Files\Cache\ChangePropagator $propagator * @param string $owner */ public function attachToPropagator(ChangePropagator $propagator, $owner) { $propagator->listen('\\OC\\Files', 'propagate', function ($path, $entry) use($owner) { $shares = Share::getAllSharesForFileId($entry['fileid']); foreach ($shares as $share) { // propagate down the share tree $this->markDirty($share, microtime(true)); // propagate up the share tree $user = $share['uid_owner']; $view = new View('/' . $user . '/files'); $path = $view->getPath($share['file_source']); $watcher = new ChangeWatcher($view); $watcher->writeHook(['path' => $path]); } }); }