X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fcontext.ts;h=a3ca52a31569227246b5eff8816e474bc751eab9;hb=d4fff51d96925b5704c97dd673dd779030b1aced;hp=349c4d2273ee6d21c273d25aaa3cfeea5268be94;hpb=84091608217c0c791b94e4ebcf5b2f4b7307dbd6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/context.ts b/server/lib/activitypub/context.ts index 349c4d227..a3ca52a31 100644 --- a/server/lib/activitypub/context.ts +++ b/server/lib/activitypub/context.ts @@ -1,7 +1,8 @@ import { ContextType } from '@shared/models' +import { Hooks } from '../plugins/hooks' -function activityPubContextify (data: T, type: ContextType) { - return { ...getContextData(type), ...data } +async function activityPubContextify (data: T, type: ContextType) { + return { ...await getContextData(type), ...data } } // --------------------------------------------------------------------------- @@ -165,10 +166,13 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string Rate: buildContext() } -function getContextData (type: ContextType) { - return { - '@context': contextStore[type] - } +async function getContextData (type: ContextType) { + const contextData = await Hooks.wrapObject( + contextStore[type], + 'filter:activity-pub.activity.context.build.result' + ) + + return { '@context': contextData } } function buildContext (contextValue?: ContextValue) {