aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/activitypub.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-22 18:40:33 +0100
committerChocobozzz <me@florianbigard.com>2018-03-22 18:40:56 +0100
commit6be84cbcea99518e8eca58c76259effd0dd992fd (patch)
treec2b4b22c8b60528025b172013d72c12f8ba06192 /server/helpers/activitypub.ts
parent9e841674da612b68bf84a427a8710a44347083f5 (diff)
downloadPeerTube-6be84cbcea99518e8eca58c76259effd0dd992fd.tar.gz
PeerTube-6be84cbcea99518e8eca58c76259effd0dd992fd.tar.zst
PeerTube-6be84cbcea99518e8eca58c76259effd0dd992fd.zip
Improve activity pub actors implementation
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,