From f488624e5ff3a8f580029e98373071d6fe91e2eb Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 20 Apr 2015 13:32:09 +0200 Subject: [PATCH] minor fixes --- apps/files_sharing/lib/mountprovider.php | 4 ++-- apps/files_sharing/lib/propagation/changewatcher.php | 7 +++++-- apps/files_sharing/lib/propagation/propagationmanager.php | 6 ++---- apps/files_sharing/lib/sharedmount.php | 3 +-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/mountprovider.php index 9f18ef737b..94fb473883 100644 --- a/apps/files_sharing/lib/mountprovider.php +++ b/apps/files_sharing/lib/mountprovider.php @@ -30,14 +30,14 @@ class MountProvider implements IMountProvider { * @param \OCP\IConfig $config * @param \OCA\Files_Sharing\Propagation\PropagationManager $propagationManager */ - function __construct(IConfig $config, PropagationManager $propagationManager) { + public function __construct(IConfig $config, PropagationManager $propagationManager) { $this->config = $config; $this->propagationManager = $propagationManager; } /** - * Get all mountpoints applicable for the user + * Get all mountpoints applicable for the user and check for shares where we need to update the etags * * @param \OCP\IUser $user * @param \OCP\Files\Storage\IStorageFactory $storageFactory diff --git a/apps/files_sharing/lib/propagation/changewatcher.php b/apps/files_sharing/lib/propagation/changewatcher.php index e5ca62c6d8..33048081f9 100644 --- a/apps/files_sharing/lib/propagation/changewatcher.php +++ b/apps/files_sharing/lib/propagation/changewatcher.php @@ -23,7 +23,10 @@ class ChangeWatcher { */ private $baseView; - function __construct(View $baseView) { + /** + * @param \OC\Files\View $baseView the view for the logged in user + */ + public function __construct(View $baseView) { $this->baseView = $baseView; } @@ -62,7 +65,7 @@ class ChangeWatcher { $view = new View('/' . $share['uid_owner'] . '/files'); $shareRootPath = $view->getPath($share['item_source']); - if ($shareRootPath) { + if (!is_null($shareRootPath)) { $path = $shareRootPath . '/' . $internalPath; $propagator->addChange($path); $propagator->propagateChanges(); diff --git a/apps/files_sharing/lib/propagation/propagationmanager.php b/apps/files_sharing/lib/propagation/propagationmanager.php index 14763a4df7..794a7ae04f 100644 --- a/apps/files_sharing/lib/propagation/propagationmanager.php +++ b/apps/files_sharing/lib/propagation/propagationmanager.php @@ -42,9 +42,7 @@ class PropagationManager { */ private $sharePropagators = []; - private $globalSetupDone = false; - - function __construct(IUserSession $userSession, IConfig $config) { + public function __construct(IUserSession $userSession, IConfig $config) { $this->userSession = $userSession; $this->config = $config; } @@ -82,7 +80,7 @@ class PropagationManager { } /** - * Attach the propagator to the change propagator of a user to listen to changes made to files shared by the user + * Attach the recipient propagator for $user to the change propagator of a share owner to mark shares as dirty when the owner makes a change to a share * * @param string $shareOwner * @param string $user diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php index 8c473e1f1c..15aea0aa52 100644 --- a/apps/files_sharing/lib/sharedmount.php +++ b/apps/files_sharing/lib/sharedmount.php @@ -184,8 +184,7 @@ class SharedMount extends MountPoint implements MoveableMount { } public function getShare() { - $this->getStorage(); //ensure it exists - return $this->storage->getShare(); + return $this->getStorage()->getShare(); } /**