mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Fix retrieving of deleted comments when subscribing to a new instance
This commit is contained in:
parent
69222afac8
commit
b5206dfc45
5 changed files with 87 additions and 19 deletions
|
@ -3,11 +3,28 @@ 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 || comment.type !== 'Note') return false
|
||||
if (!comment) return false
|
||||
|
||||
if (!isTypeValid(comment)) return false
|
||||
|
||||
normalizeComment(comment)
|
||||
|
||||
if (comment.type === 'Tombstone') {
|
||||
return isActivityPubUrlValid(comment.id) &&
|
||||
isDateValid(comment.published) &&
|
||||
isDateValid(comment.deleted) &&
|
||||
isActivityPubUrlValid(comment.url)
|
||||
}
|
||||
|
||||
return isActivityPubUrlValid(comment.id) &&
|
||||
isCommentContentValid(comment.content) &&
|
||||
isActivityPubUrlValid(comment.inReplyTo) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue