Do not trigger preview hooks if enable_previews is false
This commit is contained in:
parent
3a3a58f248
commit
3e647afbd4
|
@ -654,7 +654,9 @@ class OC {
|
|||
|
||||
self::registerCacheHooks();
|
||||
self::registerFilesystemHooks();
|
||||
if (\OC::$server->getSystemConfig()->getValue('enable_previews', false)) {
|
||||
self::registerPreviewHooks();
|
||||
}
|
||||
self::registerShareHooks();
|
||||
self::registerLogRotate();
|
||||
self::registerLocalAddressBook();
|
||||
|
@ -766,7 +768,6 @@ class OC {
|
|||
* register hooks for previews
|
||||
*/
|
||||
public static function registerPreviewHooks() {
|
||||
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');
|
||||
|
@ -775,7 +776,6 @@ class OC {
|
|||
OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete');
|
||||
OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* register hooks for sharing
|
||||
|
|
Loading…
Reference in New Issue