diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-03-02 12:57:29 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-03-02 12:57:29 -0500 |
commit | 9b4d7d99253885fadeed61b988c3c7528ca6d43a (patch) | |
tree | fab195845610ffb37fcf803ec498be6ea9df4737 /apps | |
parent | b5989c933f3c51887724d89e989a3e2af4207d6e (diff) | |
download | nextcloud-server-9b4d7d99253885fadeed61b988c3c7528ca6d43a.tar.gz nextcloud-server-9b4d7d99253885fadeed61b988c3c7528ca6d43a.zip |
Update ETag when file is shared
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/lib/updater.php | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 19abc838258..f61a47c1900 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -420,6 +420,7 @@ class Shared extends \OC\Files\Storage\Common { \OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Shared_Updater', 'writeHook'); \OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook'); \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook'); + \OC_Hook::connect('OCP\Share', 'post_shared', '\OC\Files\Cache\Shared_Updater', 'shareHook'); } } diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index a41ce76f933..8d00d44c3b9 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -74,4 +74,14 @@ class Shared_Updater { self::correctFolders($params['path']); } + /** + * @param array $params + */ + static public function shareHook($params) { + if ($params['itemType'] === 'file' || $param['itemType'] === 'folder') { + $id = \OC\Files\Filesystem::getPath($params['itemSource']); + self::correctFolders($id); + } + } + }
\ No newline at end of file |