Verified Commit 115c234a authored by Chocobozzz's avatar Chocobozzz
Browse files

Add missing hooks to hello world plugin

parent cb8a9c1b
......@@ -35,6 +35,16 @@ function register ({ registerHook, peertubeHelpers }) {
return result
}
})
registerHook({
target: 'filter:internal.video-watch.player.build-options.result',
handler: (result, params) => {
console.log('Running player build options hook for video %s.', params.video.name)
result.playerOptions.common.inactivityTimeout = 10000
return result
}
})
}
export {
......
......@@ -19,6 +19,19 @@ async function register ({
handler: () => console.log('fake hook')
})
registerHook({
target: 'filter:api.user.signup.allowed.result',
handler: (result, params) => {
if (result.allowed === false) return result
if (params && params.body.email.includes('laposte.net')) {
return { allowed: false, errorMessage: 'laposte.net emails are not allowed on this instance' }
}
return result
}
})
registerSetting({
name: 'admin-name',
label: 'Admin name',
......
{
"name": "peertube-plugin-hello-world",
"version": "0.0.13",
"version": "0.0.14",
"description": "Hello world PeerTube plugin example",
"engine": {
"peertube": ">=1.3.0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment