aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-26 11:20:46 +0100
committerChocobozzz <me@florianbigard.com>2018-01-26 11:20:46 +0100
commit66ee325f573feeb61bc6c945151bf64dec6b9698 (patch)
tree30bfd8a388632a37db22328d7c7bad63fa4f76e4 /server
parentce487e1e3b9ae46b4bea2297e13d6f8c5b3f8aeb (diff)
downloadPeerTube-66ee325f573feeb61bc6c945151bf64dec6b9698.tar.gz
PeerTube-66ee325f573feeb61bc6c945151bf64dec6b9698.tar.zst
PeerTube-66ee325f573feeb61bc6c945151bf64dec6b9698.zip
Only accept public comments
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) {