diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/activitypub/video-comments.ts | 7 |
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 @@ | |||
1 | import * as validator from 'validator' | 1 | import * as validator from 'validator' |
2 | import { exists, isDateValid } from '../misc' | 2 | import { ACTIVITY_PUB } from '../../../initializers' |
3 | import { exists, isArray, isDateValid } from '../misc' | ||
3 | import { isActivityPubUrlValid, isBaseActivityValid } from './misc' | 4 | import { isActivityPubUrlValid, isBaseActivityValid } from './misc' |
4 | 5 | ||
5 | function isVideoCommentCreateActivityValid (activity: any) { | 6 | function 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 | ||
19 | function isVideoCommentDeleteActivityValid (activity: any) { | 22 | function isVideoCommentDeleteActivityValid (activity: any) { |