Update ETag when file is shared

This commit is contained in:
Michael Gapczynski 2013-03-02 12:57:29 -05:00
parent b5989c933f
commit 9b4d7d9925
2 changed files with 11 additions and 0 deletions

View File

@ -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_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_delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook'); \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');
} }
} }

View File

@ -74,4 +74,14 @@ class Shared_Updater {
self::correctFolders($params['path']); 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);
}
}
} }