PeerTube/server/helpers/custom-validators/activitypub/view.ts

14 lines
424 B
TypeScript
Raw Normal View History

2017-11-22 16:25:03 +01:00
import { isActivityPubUrlValid, isBaseActivityValid } from './misc'
function isViewActivityValid (activity: any) {
return isBaseActivityValid(activity, 'Create') &&
activity.object.type === 'View' &&
isActivityPubUrlValid(activity.object.actor) &&
isActivityPubUrlValid(activity.object.object)
}
// ---------------------------------------------------------------------------
export {
isViewActivityValid
}