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:
parent
b5206dfc45
commit
c883db6d03
6 changed files with 124 additions and 92 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue