aboutsummaryrefslogtreecommitdiffhomepage
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
parentce487e1e3b9ae46b4bea2297e13d6f8c5b3f8aeb (diff)
downloadPeerTube-66ee325f573feeb61bc6c945151bf64dec6b9698.tar.gz
PeerTube-66ee325f573feeb61bc6c945151bf64dec6b9698.tar.zst
PeerTube-66ee325f573feeb61bc6c945151bf64dec6b9698.zip
Only accept public comments
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts1
-rw-r--r--server/helpers/custom-validators/activitypub/video-comments.ts7
2 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index c6f0525c3..3a9d932b8 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -206,6 +206,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
206 this.videoService.updateVideo(video) 206 this.videoService.updateVideo(video)
207 .subscribe( 207 .subscribe(
208 () => { 208 () => {
209 this.isUploadingVideo = false
209 this.notificationsService.success('Success', 'Video published.') 210 this.notificationsService.success('Success', 'Video published.')
210 this.router.navigate([ '/videos/watch', video.uuid ]) 211 this.router.navigate([ '/videos/watch', video.uuid ])
211 }, 212 },
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) {