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

16 lines
416 B
TypeScript
Raw Normal View History

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