From c883db6d038a8510205f5f13ef46fb5a1c9e8288 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Dec 2019 11:48:12 +0100 Subject: Move deleted comment on new follow tests --- .../custom-validators/activitypub/video-comments.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/custom-validators/activitypub/video-comments.ts b/server/helpers/custom-validators/activitypub/video-comments.ts index 96655c3f8..ea780ca46 100644 --- a/server/helpers/custom-validators/activitypub/video-comments.ts +++ b/server/helpers/custom-validators/activitypub/video-comments.ts @@ -3,18 +3,10 @@ import { ACTIVITY_PUB } from '../../../initializers/constants' import { exists, isArray, isDateValid } from '../misc' import { isActivityPubUrlValid } from './misc' -function isTypeValid (comment: any): boolean { - if (comment.type === 'Note') return true - - if (comment.type === 'Tombstone' && comment.formerType === 'Note') return true - - return false -} - function sanitizeAndCheckVideoCommentObject (comment: any) { if (!comment) return false - if (!isTypeValid(comment)) return false + if (!isCommentTypeValid(comment)) return false normalizeComment(comment) @@ -59,3 +51,11 @@ function normalizeComment (comment: any) { return } + +function isCommentTypeValid (comment: any): boolean { + if (comment.type === 'Note') return true + + if (comment.type === 'Tombstone' && comment.formerType === 'Note') return true + + return false +} -- cgit v1.2.3