aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/helpers/custom-validators/activitypub/video-comments.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/activitypub/video-comments.ts b/server/helpers/custom-validators/activitypub/video-comments.ts
index cbd4dac5c..079fee434 100644
--- a/server/helpers/custom-validators/activitypub/video-comments.ts
+++ b/server/helpers/custom-validators/activitypub/video-comments.ts
@@ -1,5 +1,6 @@
1import * as validator from 'validator' 1import * as validator from 'validator'
2import { exists, isDateValid } from '../misc' 2import { ACTIVITY_PUB } from '../../../initializers'
3import { exists, isArray, isDateValid } from '../misc'
3import { isActivityPubUrlValid, isBaseActivityValid } from './misc' 4import { isActivityPubUrlValid, isBaseActivityValid } from './misc'
4 5
5function isVideoCommentCreateActivityValid (activity: any) { 6function isVideoCommentCreateActivityValid (activity: any) {
@@ -13,7 +14,9 @@ function isVideoCommentObjectValid (comment: any) {
13 isCommentContentValid(comment.content) && 14 isCommentContentValid(comment.content) &&
14 isActivityPubUrlValid(comment.inReplyTo) && 15 isActivityPubUrlValid(comment.inReplyTo) &&
15 isDateValid(comment.published) && 16 isDateValid(comment.published) &&
16 isActivityPubUrlValid(comment.url) 17 isActivityPubUrlValid(comment.url) &&
18 isArray(comment.to) &&
19 comment.to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 // Only accept public comments
17} 20}
18 21
19function isVideoCommentDeleteActivityValid (activity: any) { 22function isVideoCommentDeleteActivityValid (activity: any) {