import { ContextType } from '@shared/models'
+import { Hooks } from '../plugins/hooks'
-function activityPubContextify <T> (data: T, type: ContextType) {
- return { ...getContextData(type), ...data }
+async function activityPubContextify <T> (data: T, type: ContextType) {
+ return { ...await getContextData(type), ...data }
}
// ---------------------------------------------------------------------------
playlists: {
'@id': 'pt:playlists',
'@type': '@id'
- }
+ },
+ support: {
+ '@type': 'sc:Text',
+ '@id': 'pt:support'
+ },
+
+ // TODO: remove in a few versions, introduced in 4.2
+ icons: 'as:icon'
}),
WatchAction: buildContext({
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) {