Only accept public comments
This commit is contained in:
parent
ce487e1e3b
commit
66ee325f57
2 changed files with 6 additions and 2 deletions
|
@ -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 ])
|
||||
},
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue