1
0
Fork 0

Only accept public comments

This commit is contained in:
Chocobozzz 2018-01-26 11:20:46 +01:00
parent ce487e1e3b
commit 66ee325f57
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 6 additions and 2 deletions

View file

@ -206,6 +206,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
this.videoService.updateVideo(video) this.videoService.updateVideo(video)
.subscribe( .subscribe(
() => { () => {
this.isUploadingVideo = false
this.notificationsService.success('Success', 'Video published.') this.notificationsService.success('Success', 'Video published.')
this.router.navigate([ '/videos/watch', video.uuid ]) this.router.navigate([ '/videos/watch', video.uuid ])
}, },

View file

@ -1,5 +1,6 @@
import * as validator from 'validator' 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' import { isActivityPubUrlValid, isBaseActivityValid } from './misc'
function isVideoCommentCreateActivityValid (activity: any) { function isVideoCommentCreateActivityValid (activity: any) {
@ -13,7 +14,9 @@ function isVideoCommentObjectValid (comment: any) {
isCommentContentValid(comment.content) && isCommentContentValid(comment.content) &&
isActivityPubUrlValid(comment.inReplyTo) && isActivityPubUrlValid(comment.inReplyTo) &&
isDateValid(comment.published) && 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) { function isVideoCommentDeleteActivityValid (activity: any) {