X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Factivitypub.ts;h=f1430055fe93c34a456efc1f220e141a2b3e8df6;hb=848f499def54db2dd36437ef0dfb74dd5041c23b;hp=bcbd9be59d52bb07bb2d19b248698ec96c98e244;hpb=babecc3c09cd4ed06fe643a97fff4bcc31c5a9be;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index bcbd9be59..f1430055f 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts @@ -1,7 +1,7 @@ import * as Bluebird from 'bluebird' import * as validator from 'validator' import { ResultList } from '../../shared/models' -import { Activity, ActivityPubActor } from '../../shared/models/activitypub' +import { Activity } from '../../shared/models/activitypub' import { ACTIVITY_PUB } from '../initializers' import { ActorModel } from '../models/activitypub/actor' import { signJsonLDObject } from './peertube-crypto' @@ -106,10 +106,10 @@ function buildSignedActivity (byActor: ActorModel, data: Object) { return signJsonLDObject(byActor, activity) as Promise } -function getActorUrl (activityActor: string | ActivityPubActor) { - if (typeof activityActor === 'string') return activityActor +function getAPId (activity: string | { id: string }) { + if (typeof activity === 'string') return activity - return activityActor.id + return activity.id } function checkUrlsSameHost (url1: string, url2: string) { @@ -123,7 +123,7 @@ function checkUrlsSameHost (url1: string, url2: string) { export { checkUrlsSameHost, - getActorUrl, + getAPId, activityPubContextify, activityPubCollectionPagination, buildSignedActivity