diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-22 16:25:03 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:53 +0100 |
commit | 40ff57078e15d5b86ee6b71e198b95d3feb78eaf (patch) | |
tree | 88031d4eac6a26597e8a1f2fc63674664e3eae26 /server/helpers/custom-validators/activitypub/view.ts | |
parent | c46edbc2f6ca310b2f0331f979ac6caf27f6eb92 (diff) | |
download | PeerTube-40ff57078e15d5b86ee6b71e198b95d3feb78eaf.tar.gz PeerTube-40ff57078e15d5b86ee6b71e198b95d3feb78eaf.tar.zst PeerTube-40ff57078e15d5b86ee6b71e198b95d3feb78eaf.zip |
Federate video views
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 | } | ||