mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Support raw strings for AP to/cc
This commit is contained in:
parent
5138e28ff8
commit
8d3bc24c4b
9 changed files with 76 additions and 66 deletions
|
@ -1,3 +1,4 @@
|
|||
import { arrayify } from '@peertube/peertube-core-utils'
|
||||
import { ContextType } from '@peertube/peertube-models'
|
||||
import { ACTIVITY_PUB, REMOTE_SCHEME } from '@server/initializers/constants.js'
|
||||
import { isArray } from './custom-validators/misc.js'
|
||||
|
@ -53,12 +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[]) {
|
||||
if (!isArray(toOrCC)) return false
|
||||
|
||||
export function hasAPPublic (toOrCC: string[] | string) {
|
||||
const publicValue = getAPPublicValue()
|
||||
|
||||
return toOrCC.some(f => f === 'as:Public' || publicValue)
|
||||
return arrayify(toOrCC).some(f => f === 'as:Public' || publicValue)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue