diff --git a/appinfo/database.xml b/appinfo/database.xml index 103d7d9a..fa7ddfcb 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -20,7 +20,7 @@ true 512 - Relative to storage e.g. /welcome.odt + Relative to owner office storage /welcome.odt genesis_hash @@ -28,6 +28,14 @@ true To be sure the genesis did not change + + document_path + text + + true + 512 + Relative to storage e.g. /welcome.odt + owner text diff --git a/lib/view.php b/lib/view.php index ea631019..6be9daa5 100644 --- a/lib/view.php +++ b/lib/view.php @@ -34,8 +34,9 @@ class View extends \OC\Files\View{ $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; - $newName = '/' . self::getHashByGenesis($uid, $path) . '.odt'; $view = new \OC\Files\View('/' . $uid); + $newName = '/' . sha1($view->file_get_contents('/files' . $path)) . '.odt'; + $view->copy('/files' . $path, self::OFFICE_DIRNAME . $newName); \OC_FileProxy::$enabled = $proxyStatus; return $newName;