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

16 lines
444 B
TypeScript
Raw Normal View History

2017-11-20 02:43:39 -06:00
import { isBaseActivityValid } from './misc'
import { isVideoTorrentAddActivityValid } from './videos'
import { isVideoChannelCreateActivityValid } from './video-channels'
2017-11-23 07:19:55 -06:00
function isAnnounceActivityValid (activity: any) {
2017-11-20 02:43:39 -06:00
return isBaseActivityValid(activity, 'Announce') &&
(
isVideoChannelCreateActivityValid(activity.object) ||
isVideoTorrentAddActivityValid(activity.object)
)
}
export {
2017-11-23 07:19:55 -06:00
isAnnounceActivityValid
2017-11-20 02:43:39 -06:00
}