mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
propagate changes up reshares
This commit is contained in:
parent
8cb40f6043
commit
77fbb4125b
1 changed files with 10 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
namespace OCA\Files_Sharing\Propagation;
|
||||
|
||||
use OC\Files\Cache\ChangePropagator;
|
||||
use OC\Files\View;
|
||||
use OC\Share\Share;
|
||||
|
||||
/**
|
||||
|
|
@ -91,6 +92,7 @@ class RecipientPropagator {
|
|||
}
|
||||
$this->config->setAppValue('files_sharing', $share['id'], $time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen on the propagator for updates made to shares owned by a user
|
||||
*
|
||||
|
|
@ -101,7 +103,15 @@ class RecipientPropagator {
|
|||
$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, time());
|
||||
|
||||
// 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]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue