summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/lib/util.php')
-rw-r--r--apps/files_encryption/lib/util.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 8819b0f972a..9d351983e2a 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -777,6 +777,9 @@ class Util {
//relative to /data
$rawPath = $encryptedFile['path'];
+ //get timestamp
+ $timestamp = $this->view->filemtime($rawPath);
+
//enable proxy to use OC\Files\View to access the original file
\OC_FileProxy::$enabled = true;
@@ -818,6 +821,9 @@ class Util {
$this->view->chroot($fakeRoot);
+ //set timestamp
+ $this->view->touch($rawPath, $timestamp);
+
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(
'encrypted' => false,
@@ -875,10 +881,13 @@ class Util {
//relative to data/<user>/file
$relPath = $plainFile['path'];
-
+
//relative to /data
$rawPath = '/' . $this->userId . '/files/' . $plainFile['path'];
+ // keep timestamp
+ $timestamp = $this->view->filemtime($rawPath);
+
// Open plain file handle for binary reading
$plainHandle = $this->view->fopen($rawPath, 'rb');
@@ -897,6 +906,9 @@ class Util {
$this->view->rename($relPath . '.part', $relPath);
$this->view->chroot($fakeRoot);
+
+ // set timestamp
+ $this->view->touch($rawPath, $timestamp);
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(