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

15 lines
392 B
TypeScript
Raw Normal View History

2017-12-19 10:07:58 -06:00
import { isActivityPubUrlValid, isBaseActivityValid } from './misc'
2017-12-14 10:38:41 -06:00
import { isVideoTorrentCreateActivityValid } from './videos'
2017-11-20 02:43:39 -06:00
2017-11-23 07:19:55 -06:00
function isAnnounceActivityValid (activity: any) {
2017-11-20 02:43:39 -06:00
return isBaseActivityValid(activity, 'Announce') &&
(
2017-12-19 11:09:44 -06:00
isVideoTorrentCreateActivityValid(activity.object) ||
isActivityPubUrlValid(activity.object)
2017-11-20 02:43:39 -06:00
)
}
export {
2017-11-23 07:19:55 -06:00
isAnnounceActivityValid
2017-11-20 02:43:39 -06:00
}