]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/send/misc.ts
Improve AP validation for Notes
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / send / misc.ts
index 607822d1623ec8a7f4642a68b4400ef46eb5c778..b2d968c9cc4c6124651e44ed6d4c835c558f2baf 100644 (file)
@@ -96,7 +96,7 @@ function getOriginVideoAudience (video: VideoModel, actorsInvolvedInVideo: Actor
   }
 }
 
-function getOriginVideoCommentAudience (
+function getVideoCommentAudience (
   videoComment: VideoCommentModel,
   threadParentComments: VideoCommentModel[],
   actorsInvolvedInVideo: ActorModel[],
@@ -126,7 +126,7 @@ function getOriginVideoCommentAudience (
 
 function getObjectFollowersAudience (actorsInvolvedInObject: ActorModel[]) {
   return {
-    to: actorsInvolvedInObject.map(a => a.followersUrl),
+    to: [ ACTIVITY_PUB.PUBLIC ].concat(actorsInvolvedInObject.map(a => a.followersUrl)),
     cc: []
   }
 }
@@ -160,7 +160,7 @@ function buildAudience (followerInboxUrls: string[], isPublic = true) {
   return { to, cc }
 }
 
-function audiencify (object: any, audience: ActivityAudience) {
+function audiencify <T> (object: T, audience: ActivityAudience) {
   return Object.assign(object, audience)
 }
 
@@ -192,7 +192,7 @@ export {
   getObjectFollowersAudience,
   forwardActivity,
   audiencify,
-  getOriginVideoCommentAudience,
+  getVideoCommentAudience,
   computeUris,
   broadcastToActors
 }