fix propagation when renaming a directly reshared folder

This commit is contained in:
Robin Appelman 2015-04-20 16:46:35 +02:00
parent f488624e5f
commit 45784f213f
2 changed files with 8 additions and 2 deletions

View File

@ -9,6 +9,7 @@
namespace OCA\Files_Sharing\Propagation;
use OC\Files\Cache\ChangePropagator;
use OC\Files\Filesystem;
use OC\Files\View;
use OCA\Files_Sharing\SharedMount;
@ -47,10 +48,10 @@ class ChangeWatcher {
$fullPath2 = $this->baseView->getAbsolutePath($path2);
$mount1 = $this->baseView->getMount($path1);
$mount2 = $this->baseView->getMount($path2);
if ($mount1 instanceof SharedMount) {
if ($mount1 instanceof SharedMount and $mount1->getInternalPath($fullPath1) !== '') {
$this->propagateForOwner($mount1->getShare(), $mount1->getInternalPath($fullPath1), $mount1->getOwnerPropagator());
}
if ($mount1 !== $mount2 and $mount2 instanceof SharedMount) {
if ($mount1 !== $mount2 and $mount2 instanceof SharedMount and $mount2->getInternalPath($fullPath2) !== '') {
$this->propagateForOwner($mount2->getShare(), $mount2->getInternalPath($fullPath2), $mount2->getOwnerPropagator());
}
}
@ -67,6 +68,7 @@ class ChangeWatcher {
$shareRootPath = $view->getPath($share['item_source']);
if (!is_null($shareRootPath)) {
$path = $shareRootPath . '/' . $internalPath;
$path = Filesystem::normalizePath($path);
$propagator->addChange($path);
$propagator->propagateChanges();
}

View File

@ -658,6 +658,10 @@ class View {
} elseif ($result) {
if ($internalPath1 !== '') { // dont do a cache update for moved mounts
$this->updater->rename($path1, $path2);
} else { // only do etag propagation
$this->getUpdater()->getPropagator()->addChange($path1);
$this->getUpdater()->getPropagator()->addChange($path2);
$this->getUpdater()->getPropagator()->propagateChanges();
}
if ($this->shouldEmitHooks($path1) and $this->shouldEmitHooks($path2)) {
\OC_Hook::emit(