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:
parent
24b59a2560
commit
0c7a89a70a
15 changed files with 90 additions and 69 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue