aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/activitypub.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/activitypub.ts')
-rw-r--r--server/helpers/activitypub.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index d64a6dd78..1934fa0f0 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -1,5 +1,5 @@
1import { ResultList } from '../../shared/models' 1import { ResultList } from '../../shared/models'
2import { Activity } from '../../shared/models/activitypub' 2import { Activity, ActivityPubActor } from '../../shared/models/activitypub'
3import { ACTIVITY_PUB } from '../initializers' 3import { ACTIVITY_PUB } from '../initializers'
4import { ActorModel } from '../models/activitypub/actor' 4import { ActorModel } from '../models/activitypub/actor'
5import { signObject } from './peertube-crypto' 5import { signObject } from './peertube-crypto'
@@ -98,9 +98,16 @@ function buildSignedActivity (byActor: ActorModel, data: Object) {
98 return signObject(byActor, activity) as Promise<Activity> 98 return signObject(byActor, activity) as Promise<Activity>
99} 99}
100 100
101function getActorUrl (activityActor: string | ActivityPubActor) {
102 if (typeof activityActor === 'string') return activityActor
103
104 return activityActor.id
105}
106
101// --------------------------------------------------------------------------- 107// ---------------------------------------------------------------------------
102 108
103export { 109export {
110 getActorUrl,
104 activityPubContextify, 111 activityPubContextify,
105 activityPubCollectionPagination, 112 activityPubCollectionPagination,
106 activityPubCollection, 113 activityPubCollection,