mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Improve activity pub actors implementation
This commit is contained in:
parent
9e841674da
commit
6be84cbcea
9 changed files with 32 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
import { ResultList } from '../../shared/models'
|
||||
import { Activity } from '../../shared/models/activitypub'
|
||||
import { Activity, ActivityPubActor } from '../../shared/models/activitypub'
|
||||
import { ACTIVITY_PUB } from '../initializers'
|
||||
import { ActorModel } from '../models/activitypub/actor'
|
||||
import { signObject } from './peertube-crypto'
|
||||
|
@ -98,9 +98,16 @@ function buildSignedActivity (byActor: ActorModel, data: Object) {
|
|||
return signObject(byActor, activity) as Promise<Activity>
|
||||
}
|
||||
|
||||
function getActorUrl (activityActor: string | ActivityPubActor) {
|
||||
if (typeof activityActor === 'string') return activityActor
|
||||
|
||||
return activityActor.id
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
getActorUrl,
|
||||
activityPubContextify,
|
||||
activityPubCollectionPagination,
|
||||
activityPubCollection,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue