Add missing hooks to hello world plugin
This commit is contained in:
parent
cb8a9c1b0e
commit
115c234a6d
@ -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',
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-hello-world",
|
||||
"version": "0.0.13",
|
||||
"version": "0.0.14",
|
||||
"description": "Hello world PeerTube plugin example",
|
||||
"engine": {
|
||||
"peertube": ">=1.3.0"
|
||||
|
Loading…
Reference in New Issue
Block a user