aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/activitypub.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-23 16:55:13 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:53 +0100
commit16b90975941b78d01d7202d441bf731a10048c16 (patch)
tree11709f51ec79785f32282dfbdd33277af483b2e6 /server/helpers/activitypub.ts
parentd8553faa4939889fa7b7ef7329aa474a81cbbdb9 (diff)
downloadPeerTube-16b90975941b78d01d7202d441bf731a10048c16.tar.gz
PeerTube-16b90975941b78d01d7202d441bf731a10048c16.tar.zst
PeerTube-16b90975941b78d01d7202d441bf731a10048c16.zip
Fetch video likes/dislikes too
Diffstat (limited to 'server/helpers/activitypub.ts')
-rw-r--r--server/helpers/activitypub.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index 54c460200..1ea6422ca 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -24,6 +24,14 @@ function activityPubContextify <T> (data: T) {
24 }) 24 })
25} 25}
26 26
27function activityPubCollection (results: any[]) {
28 return {
29 type: 'OrderedCollection',
30 totalItems: results.length,
31 orderedItems: results
32 }
33}
34
27function activityPubCollectionPagination (url: string, page: any, result: ResultList<any>) { 35function activityPubCollectionPagination (url: string, page: any, result: ResultList<any>) {
28 let next: string 36 let next: string
29 let prev: string 37 let prev: string
@@ -74,5 +82,6 @@ function buildSignedActivity (byAccount: AccountInstance, data: Object) {
74export { 82export {
75 activityPubContextify, 83 activityPubContextify,
76 activityPubCollectionPagination, 84 activityPubCollectionPagination,
85 activityPubCollection,
77 buildSignedActivity 86 buildSignedActivity
78} 87}