From: Chocobozzz Date: Fri, 26 Jan 2018 10:20:46 +0000 (+0100) Subject: Only accept public comments X-Git-Tag: v0.0.16-alpha~14 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=66ee325f573feeb61bc6c945151bf64dec6b9698;p=oweals%2Fpeertube.git Only accept public comments --- 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 this.videoService.updateVideo(video) .subscribe( () => { + this.isUploadingVideo = false this.notificationsService.success('Success', 'Video published.') this.router.navigate([ '/videos/watch', video.uuid ]) }, 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 @@ import * as validator from 'validator' -import { exists, isDateValid } from '../misc' +import { ACTIVITY_PUB } from '../../../initializers' +import { exists, isArray, isDateValid } from '../misc' import { isActivityPubUrlValid, isBaseActivityValid } from './misc' function isVideoCommentCreateActivityValid (activity: any) { @@ -13,7 +14,9 @@ function isVideoCommentObjectValid (comment: any) { isCommentContentValid(comment.content) && isActivityPubUrlValid(comment.inReplyTo) && isDateValid(comment.published) && - isActivityPubUrlValid(comment.url) + isActivityPubUrlValid(comment.url) && + isArray(comment.to) && + comment.to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 // Only accept public comments } function isVideoCommentDeleteActivityValid (activity: any) {