diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-07-01 16:21:31 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-07-03 10:11:37 +0200 |
commit | 04e4d9580f74a368d4e4c9bfb901d515d4b64ee2 (patch) | |
tree | 3f259c6f07ad37a5ff2475cf539430d5dc78d569 /lib/files | |
parent | 811cf02675609c268d35b780947d4d8f02f63aef (diff) | |
download | nextcloud-server-04e4d9580f74a368d4e4c9bfb901d515d4b64ee2.tar.gz nextcloud-server-04e4d9580f74a368d4e4c9bfb901d515d4b64ee2.zip |
if a part file gets renamed to a real file, that this was the second step of a write operation, hence emit a write signal
Diffstat (limited to 'lib/files')
-rw-r--r-- | lib/files/view.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/files/view.php b/lib/files/view.php index d8d99698023..f62b84d27aa 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -353,7 +353,16 @@ class View { return false; } $run = true; - if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) { + if ($this->fakeRoot == Filesystem::getRoot() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) { + // if it was a rename from a part file to a regular file it was a write and not a rename operation + \OC_Hook::emit( + Filesystem::CLASSNAME, Filesystem::signal_write, + array( + Filesystem::signal_param_path => $path2, + Filesystem::signal_param_run => &$run + ) + ); + } elseif ($this->fakeRoot == Filesystem::getRoot()) { \OC_Hook::emit( Filesystem::CLASSNAME, Filesystem::signal_rename, array( @@ -398,7 +407,16 @@ class View { } } } - if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1) && $result !== false) { + if ($this->fakeRoot == Filesystem::getRoot() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) { + // if it was a rename from a part file to a regular file it was a write and not a rename operation + \OC_Hook::emit( + Filesystem::CLASSNAME, + Filesystem::signal_post_write, + array( + Filesystem::signal_param_path => $path2, + ) + ); + } elseif ($this->fakeRoot == Filesystem::getRoot() && $result !== false) { \OC_Hook::emit( Filesystem::CLASSNAME, Filesystem::signal_post_rename, |