[Pkg-owncloud-commits] [owncloud] 99/215: fix propagation when renaming a directly reshared folder
David Prévot
taffit at moszumanska.debian.org
Tue May 5 01:01:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 45784f213f5e7cf9a38feabd52c4ffadee9ae4f9
Author: Robin Appelman <icewind at owncloud.com>
Date: Mon Apr 20 16:46:35 2015 +0200
fix propagation when renaming a directly reshared folder
---
apps/files_sharing/lib/propagation/changewatcher.php | 6 ++++--
lib/private/files/view.php | 4 ++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/apps/files_sharing/lib/propagation/changewatcher.php b/apps/files_sharing/lib/propagation/changewatcher.php
index 3304808..483f436 100644
--- a/apps/files_sharing/lib/propagation/changewatcher.php
+++ b/apps/files_sharing/lib/propagation/changewatcher.php
@@ -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();
}
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 162bf56..63af2b6 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -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(
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list