aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-22 16:31:47 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit7663e55a2cc46a413bceee2787d48902b15ae642 (patch)
treec54d620617040642d962f9b8c74c7b8e2d745692 /server
parente8f902c05cb35f6d5e9b75a23ddabd51c220a976 (diff)
downloadPeerTube-7663e55a2cc46a413bceee2787d48902b15ae642.tar.gz
PeerTube-7663e55a2cc46a413bceee2787d48902b15ae642.tar.zst
PeerTube-7663e55a2cc46a413bceee2787d48902b15ae642.zip
Log error on unknown hook
Diffstat (limited to 'server')
-rw-r--r--server/lib/plugins/plugin-manager.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts
index afc07a151..cfe63e50d 100644
--- a/server/lib/plugins/plugin-manager.ts
+++ b/server/lib/plugins/plugin-manager.ts
@@ -13,7 +13,7 @@ import { RegisterSettingOptions } from '../../../shared/models/plugins/register-
13import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model' 13import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model'
14import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' 14import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model'
15import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' 15import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model'
16import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model' 16import { ServerHook, ServerHookName, serverHookObject } from '../../../shared/models/plugins/server-hook.model'
17import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' 17import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks'
18import { RegisterOptions } from '../../typings/plugins/register-options.model' 18import { RegisterOptions } from '../../typings/plugins/register-options.model'
19import { PluginLibrary } from '../../typings/plugins' 19import { PluginLibrary } from '../../typings/plugins'
@@ -388,6 +388,11 @@ export class PluginManager implements ServerHook {
388 388
389 private getRegisterHelpers (npmName: string, plugin: PluginModel): RegisterOptions { 389 private getRegisterHelpers (npmName: string, plugin: PluginModel): RegisterOptions {
390 const registerHook = (options: RegisterHookOptions) => { 390 const registerHook = (options: RegisterHookOptions) => {
391 if (serverHookObject[options.target] !== true) {
392 logger.warn('Unknown hook %s of plugin %s. Skipping.', options.target, npmName)
393 return
394 }
395
391 if (!this.hooks[options.target]) this.hooks[options.target] = [] 396 if (!this.hooks[options.target]) this.hooks[options.target] = []
392 397
393 this.hooks[options.target].push({ 398 this.hooks[options.target].push({