1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Move deleted comment on new follow tests

This commit is contained in:
Chocobozzz 2019-12-04 11:48:12 +01:00
parent b5206dfc45
commit c883db6d03
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 124 additions and 92 deletions

View file

@ -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
}