1
0
Fork 0
peertube/server/helpers/custom-validators/activitypub/announce.ts
2018-01-26 13:43:34 +01:00

13 lines
343 B
TypeScript

import { isActivityPubUrlValid, isBaseActivityValid } from './misc'
function isAnnounceActivityValid (activity: any) {
return isBaseActivityValid(activity, 'Announce') &&
(
isActivityPubUrlValid(activity.object) ||
(activity.object && isActivityPubUrlValid(activity.object.id))
)
}
export {
isAnnounceActivityValid
}