import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object'
-import { isVideoCommentObjectValid } from '../../helpers/custom-validators/activitypub/video-comments'
+import { sanitizeAndCheckVideoCommentObject } from '../../helpers/custom-validators/activitypub/video-comments'
import { logger } from '../../helpers/logger'
import { doRequest } from '../../helpers/requests'
import { ACTIVITY_PUB } from '../../initializers'
}
}
-async function addVideoComments (instance: VideoModel, commentUrls: string[]) {
+async function addVideoComments (commentUrls: string[], instance: VideoModel) {
for (const commentUrl of commentUrls) {
await addVideoComment(instance, commentUrl)
}
activityPub: true
})
- if (isVideoCommentObjectValid(body) === false) {
+ if (sanitizeAndCheckVideoCommentObject(body) === false) {
logger.debug('Remote video comment JSON is not valid.', { body })
return undefined
}
activityPub: true
})
- if (isVideoCommentObjectValid(body) === false) {
+ if (sanitizeAndCheckVideoCommentObject(body) === false) {
throw new Error('Remote video comment JSON is not valid :' + JSON.stringify(body))
}