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

21 lines
680 B
TypeScript
Raw Normal View History

2017-12-14 17:38:41 +01:00
import { isActorFollowActivityValid } from './actor'
2017-11-20 09:43:39 +01:00
import { isBaseActivityValid } from './misc'
2017-11-23 14:19:55 +01:00
import { isDislikeActivityValid, isLikeActivityValid } from './rate'
2018-09-04 10:22:10 +02:00
import { isAnnounceActivityValid } from './announce'
2018-09-11 16:27:07 +02:00
import { isCacheFileCreateActivityValid } from './cache-file'
2017-11-20 09:43:39 +01:00
2017-11-23 14:19:55 +01:00
function isUndoActivityValid (activity: any) {
2017-11-20 09:43:39 +01:00
return isBaseActivityValid(activity, 'Undo') &&
(
2017-12-14 17:38:41 +01:00
isActorFollowActivityValid(activity.object) ||
2017-11-23 14:19:55 +01:00
isLikeActivityValid(activity.object) ||
2018-09-04 10:22:10 +02:00
isDislikeActivityValid(activity.object) ||
2018-09-11 16:27:07 +02:00
isAnnounceActivityValid(activity.object) ||
isCacheFileCreateActivityValid(activity.object)
2017-11-20 09:43:39 +01:00
)
}
export {
2017-11-23 14:19:55 +01:00
isUndoActivityValid
2017-11-20 09:43:39 +01:00
}