aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-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}