aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-04-16 15:13:00 +0200
committerRobin Appelman <icewind@owncloud.com>2015-04-27 14:07:16 +0200
commit77fbb4125b95d6fb9c8572bffa007bcf77e16dfa (patch)
tree7ac2c7d69893f2457b80bc92b7e2d89b3ebcc606
parent8cb40f6043c9eb7d2285954a404bd52162851beb (diff)
downloadnextcloud-server-77fbb4125b95d6fb9c8572bffa007bcf77e16dfa.tar.gz
nextcloud-server-77fbb4125b95d6fb9c8572bffa007bcf77e16dfa.zip
propagate changes up reshares
-rw-r--r--apps/files_sharing/lib/propagation/recipientpropagator.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/propagation/recipientpropagator.php b/apps/files_sharing/lib/propagation/recipientpropagator.php
index da71612fd4d..e1b3523ca68 100644
--- a/apps/files_sharing/lib/propagation/recipientpropagator.php
+++ b/apps/files_sharing/lib/propagation/recipientpropagator.php
@@ -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]);
}
});
}