diff options
Diffstat (limited to 'server/helpers/activitypub.ts')
-rw-r--r-- | server/helpers/activitypub.ts | 9 |
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 @@ | |||
1 | import { ResultList } from '../../shared/models' | 1 | import { ResultList } from '../../shared/models' |
2 | import { Activity } from '../../shared/models/activitypub' | 2 | import { Activity, ActivityPubActor } from '../../shared/models/activitypub' |
3 | import { ACTIVITY_PUB } from '../initializers' | 3 | import { ACTIVITY_PUB } from '../initializers' |
4 | import { ActorModel } from '../models/activitypub/actor' | 4 | import { ActorModel } from '../models/activitypub/actor' |
5 | import { signObject } from './peertube-crypto' | 5 | import { 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 | ||
101 | function getActorUrl (activityActor: string | ActivityPubActor) { | ||
102 | if (typeof activityActor === 'string') return activityActor | ||
103 | |||
104 | return activityActor.id | ||
105 | } | ||
106 | |||
101 | // --------------------------------------------------------------------------- | 107 | // --------------------------------------------------------------------------- |
102 | 108 | ||
103 | export { | 109 | export { |
110 | getActorUrl, | ||
104 | activityPubContextify, | 111 | activityPubContextify, |
105 | activityPubCollectionPagination, | 112 | activityPubCollectionPagination, |
106 | activityPubCollection, | 113 | activityPubCollection, |