From d16dd1ad2aaeb322cd3b1f40dcf367de968cf701 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= <schiessle@owncloud.com>
Date: Mon, 25 Mar 2013 16:26:17 +0100
Subject: [PATCH] listen to touch hook to update the mtime after sync

---
 lib/files/cache/updater.php | 7 +++++++
 lib/files/filesystem.php    | 1 +
 2 files changed, 8 insertions(+)

diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php
index 3c26ebeb49..92a16d9d9b 100644
--- a/lib/files/cache/updater.php
+++ b/lib/files/cache/updater.php
@@ -128,6 +128,13 @@ class Updater {
 		self::writeUpdate($params['path']);
 	}
 
+	/**
+	 * @param array $params
+	 */
+	static public function touchHook($params) {
+		self::writeUpdate($params['path']);
+	}
+
 	/**
 	 * @param array $params
 	 */
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 5c3a0cf93e..1580dfaf63 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');
 
-- 
GitLab