Do not trigger preview hooks if enable_previews is false
This commit is contained in:
parent
f1903f61a1
commit
3a3a58f248
1 changed files with 9 additions and 7 deletions
16
lib/base.php
16
lib/base.php
|
@ -766,13 +766,15 @@ class OC {
|
|||
* register hooks for previews
|
||||
*/
|
||||
public static function registerPreviewHooks() {
|
||||
OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write');
|
||||
OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'prepare_delete_files');
|
||||
OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete');
|
||||
OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete');
|
||||
OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files');
|
||||
OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete');
|
||||
OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete');
|
||||
if (\OC::$server->getSystemConfig()->getValue('enable_previews', false)) {
|
||||
OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write');
|
||||
OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'prepare_delete_files');
|
||||
OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete');
|
||||
OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete');
|
||||
OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files');
|
||||
OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete');
|
||||
OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue