diff options
Diffstat (limited to 'server/helpers/custom-validators/activitypub/view.ts')
-rw-r--r-- | server/helpers/custom-validators/activitypub/view.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/activitypub/view.ts b/server/helpers/custom-validators/activitypub/view.ts new file mode 100644 index 000000000..7a3aca6f5 --- /dev/null +++ b/server/helpers/custom-validators/activitypub/view.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | import { isActivityPubUrlValid, isBaseActivityValid } from './misc' | ||
2 | |||
3 | function isViewActivityValid (activity: any) { | ||
4 | return isBaseActivityValid(activity, 'Create') && | ||
5 | activity.object.type === 'View' && | ||
6 | isActivityPubUrlValid(activity.object.actor) && | ||
7 | isActivityPubUrlValid(activity.object.object) | ||
8 | } | ||
9 | // --------------------------------------------------------------------------- | ||
10 | |||
11 | export { | ||
12 | isViewActivityValid | ||
13 | } | ||