summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-03-25 16:26:17 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-03-26 09:42:55 +0100
commitd16dd1ad2aaeb322cd3b1f40dcf367de968cf701 (patch)
treea0fa502b3d2d5d3742d9c9f5b19c072ca7cb145b /lib/files
parentc2a49b5c1f7c06497da9285b82775914b0445ddb (diff)
downloadnextcloud-server-d16dd1ad2aaeb322cd3b1f40dcf367de968cf701.tar.gz
nextcloud-server-d16dd1ad2aaeb322cd3b1f40dcf367de968cf701.zip
listen to touch hook to update the mtime after sync
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/cache/updater.php7
-rw-r--r--lib/files/filesystem.php1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php
index 3c26ebeb491..92a16d9d9b6 100644
--- a/lib/files/cache/updater.php
+++ b/lib/files/cache/updater.php
@@ -131,6 +131,13 @@ class Updater {
/**
* @param array $params
*/
+ static public function touchHook($params) {
+ self::writeUpdate($params['path']);
+ }
+
+ /**
+ * @param array $params
+ */
static public function renameHook($params) {
self::renameUpdate($params['oldpath'], $params['newpath']);
}
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 5c3a0cf93e1..1580dfaf637 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -661,6 +661,7 @@ class Filesystem {
}
\OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Updater', 'writeHook');
+\OC_Hook::connect('OC_Filesystem', 'post_touch', '\OC\Files\Cache\Updater', 'touchHook');
\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Updater', 'deleteHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Updater', 'renameHook');