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

15 lines
398 B
TypeScript

import { isActivityPubUrlValid } from './misc'
import { isVideoAbuseReasonValid } from '../video-abuses'
function isFlagActivityValid (activity: any) {
return activity.type === 'Flag' &&
isVideoAbuseReasonValid(activity.content) &&
isActivityPubUrlValid(activity.object)
}
// ---------------------------------------------------------------------------
export {
isFlagActivityValid
}