summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-24 15:06:27 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-24 15:06:27 +0200
commit30377e958f8a7a8aa15c62f2c3977349faf66ea1 (patch)
tree51ba1dcc49a84686379ae43268d8e0f28c12c044
parentd7a923671fa4b10f74dc615b583f6d4f5935d45b (diff)
parent7d53427ee6ff1a61e005423da952b49b7b8d3147 (diff)
downloadnextcloud-server-30377e958f8a7a8aa15c62f2c3977349faf66ea1.tar.gz
nextcloud-server-30377e958f8a7a8aa15c62f2c3977349faf66ea1.zip
Merge pull request #18834 from owncloud/delay-listen-owner-changes
Delay listening to owner changes untill we use a share for that owner
-rw-r--r--apps/files_sharing/lib/mountprovider.php3
-rw-r--r--apps/files_sharing/lib/sharedstorage.php21
2 files changed, 22 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/mountprovider.php
index 14a79625993..458e7f2619b 100644
--- a/apps/files_sharing/lib/mountprovider.php
+++ b/apps/files_sharing/lib/mountprovider.php
@@ -69,12 +69,11 @@ class MountProvider implements IMountProvider {
// for updating etags for the share owner when we make changes to this share.
$ownerPropagator = $this->propagationManager->getChangePropagator($share['uid_owner']);
- // for updating our etags when changes are made to the share from the owners side (probably indirectly by us trough another share)
- $this->propagationManager->listenToOwnerChanges($share['uid_owner'], $user->getUID());
return new SharedMount(
'\OC\Files\Storage\Shared',
'/' . $user->getUID() . '/' . $share['file_target'],
array(
+ 'propagationManager' => $this->propagationManager,
'propagator' => $ownerPropagator,
'share' => $share,
'user' => $user->getUID()
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 1ac401f3cf8..27dd2f1e485 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -50,13 +50,34 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
*/
private $ownerView;
+ /**
+ * @var \OCA\Files_Sharing\Propagation\PropagationManager
+ */
+ private $propagationManager;
+
+ /**
+ * @var string
+ */
+ private $user;
+
+ private $initialized = false;
+
public function __construct($arguments) {
$this->share = $arguments['share'];
$this->ownerView = $arguments['ownerView'];
+ $this->propagationManager = $arguments['propagationManager'];
+ $this->user = $arguments['user'];
}
private function init() {
+ if ($this->initialized) {
+ return;
+ }
+ $this->initialized = true;
Filesystem::initMountPoints($this->share['uid_owner']);
+
+ // for updating our etags when changes are made to the share from the owners side (probably indirectly by us trough another share)
+ $this->propagationManager->listenToOwnerChanges($this->share['uid_owner'], $this->user);
}
/**