1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Put ap:public in cc for unlisted data

This commit is contained in:
Chocobozzz 2025-06-16 11:00:47 +02:00
parent 24b59a2560
commit 0c7a89a70a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
15 changed files with 90 additions and 69 deletions

View file

@ -54,10 +54,10 @@ export function getAPPublicValue (): 'https://www.w3.org/ns/activitystreams#Publ
return 'https://www.w3.org/ns/activitystreams#Public'
}
export function hasAPPublic (toOrCC: string[] | string) {
export function hasAPPublic (collection: string[] | string) {
const publicValue = getAPPublicValue()
return arrayify(toOrCC).some(f => f === 'as:Public' || publicValue)
return arrayify(collection).some(f => f === 'as:Public' || publicValue)
}
// ---------------------------------------------------------------------------

View file

@ -24,7 +24,7 @@ function sanitizeAndCheckVideoCommentObject (comment: VideoCommentObject | Activ
isDateValid(comment.published) &&
isActivityPubUrlValid(comment.url) &&
(!exists(comment.replyApproval) || isActivityPubUrlValid(comment.replyApproval)) &&
(hasAPPublic(comment.to) || hasAPPublic(comment.cc)) // Only accept public comments
(hasAPPublic(comment.to) || hasAPPublic(comment.cc)) // Only accept public or unlisted comments
}
// ---------------------------------------------------------------------------