mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Follow works
This commit is contained in:
parent
e34c85e527
commit
350e31d6b6
39 changed files with 431 additions and 169 deletions
|
@ -23,10 +23,12 @@ function isActivityPubUrlValid (url: string) {
|
|||
function isBaseActivityValid (activity: any, type: string) {
|
||||
return Array.isArray(activity['@context']) &&
|
||||
activity.type === type &&
|
||||
validator.isURL(activity.id) &&
|
||||
validator.isURL(activity.actor) &&
|
||||
Array.isArray(activity.to) &&
|
||||
activity.to.every(t => validator.isURL(t))
|
||||
isActivityPubUrlValid(activity.id) &&
|
||||
isActivityPubUrlValid(activity.actor) &&
|
||||
(
|
||||
activity.to === undefined ||
|
||||
(Array.isArray(activity.to) && activity.to.every(t => isActivityPubUrlValid(t)))
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue