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.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index 79b76fa0b..62d78373e 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -15,7 +15,7 @@ function activityPubContextify <T> (data: T) {
15 'https://w3id.org/security/v1', 15 'https://w3id.org/security/v1',
16 { 16 {
17 RsaSignature2017: 'https://w3id.org/security#RsaSignature2017', 17 RsaSignature2017: 'https://w3id.org/security#RsaSignature2017',
18 pt: 'https://joinpeertube.org/ns', 18 pt: 'https://joinpeertube.org/ns#',
19 sc: 'http://schema.org#', 19 sc: 'http://schema.org#',
20 Hashtag: 'as:Hashtag', 20 Hashtag: 'as:Hashtag',
21 uuid: 'sc:identifier', 21 uuid: 'sc:identifier',
@@ -29,10 +29,12 @@ function activityPubContextify <T> (data: T) {
29 size: 'sc:Number', 29 size: 'sc:Number',
30 fps: 'sc:Number', 30 fps: 'sc:Number',
31 commentsEnabled: 'sc:Boolean', 31 commentsEnabled: 'sc:Boolean',
32 downloadEnabled: 'sc:Boolean',
32 waitTranscoding: 'sc:Boolean', 33 waitTranscoding: 'sc:Boolean',
33 expires: 'sc:expires', 34 expires: 'sc:expires',
34 support: 'sc:Text', 35 support: 'sc:Text',
35 CacheFile: 'pt:CacheFile' 36 CacheFile: 'pt:CacheFile',
37 Infohash: 'pt:Infohash'
36 }, 38 },
37 { 39 {
38 likes: { 40 likes: {
@@ -106,7 +108,7 @@ function buildSignedActivity (byActor: ActorModel, data: Object) {
106 return signJsonLDObject(byActor, activity) as Promise<Activity> 108 return signJsonLDObject(byActor, activity) as Promise<Activity>
107} 109}
108 110
109function getAPUrl (activity: string | { id: string }) { 111function getAPId (activity: string | { id: string }) {
110 if (typeof activity === 'string') return activity 112 if (typeof activity === 'string') return activity
111 113
112 return activity.id 114 return activity.id
@@ -123,7 +125,7 @@ function checkUrlsSameHost (url1: string, url2: string) {
123 125
124export { 126export {
125 checkUrlsSameHost, 127 checkUrlsSameHost,
126 getAPUrl, 128 getAPId,
127 activityPubContextify, 129 activityPubContextify,
128 activityPubCollectionPagination, 130 activityPubCollectionPagination,
129 buildSignedActivity 131 buildSignedActivity