]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/activitypub.ts
Avoids easy cheating on vidoe views
[github/Chocobozzz/PeerTube.git] / server / helpers / activitypub.ts
index b6207c9153e15eac5f61ed35146ab621572bbde6..d64a6dd78fd6bb849e92952415303ff591756a3a 100644 (file)
@@ -15,17 +15,38 @@ function activityPubContextify <T> (data: T) {
         'uuid': 'http://schema.org/identifier',
         'category': 'http://schema.org/category',
         'licence': 'http://schema.org/license',
-        'nsfw': 'as:sensitive',
+        'sensitive': 'as:sensitive',
         'language': 'http://schema.org/inLanguage',
         'views': 'http://schema.org/Number',
-        'size': 'http://schema.org/Number'
+        'size': 'http://schema.org/Number',
+        'commentsEnabled': 'http://schema.org/Boolean',
+        'support': 'http://schema.org/Text'
+      },
+      {
+        likes: {
+          '@id': 'as:likes',
+          '@type': '@id'
+        },
+        dislikes: {
+          '@id': 'as:dislikes',
+          '@type': '@id'
+        },
+        shares: {
+          '@id': 'as:shares',
+          '@type': '@id'
+        },
+        comments: {
+          '@id': 'as:comments',
+          '@type': '@id'
+        }
       }
     ]
   })
 }
 
-function activityPubCollection (results: any[]) {
+function activityPubCollection (url: string, results: any[]) {
   return {
+    id: url,
     type: 'OrderedCollection',
     totalItems: results.length,
     orderedItems: results