- if (isOrigin) return broadcastToFollowers(data, byActor, actorsInvolvedInComment, t, actorsException)
-
- // Send to origin
- return unicastTo(data, byActor, comment.Video.VideoChannel.Account.Actor.sharedInboxUrl)
-}
-
-async function sendCreateView (byActor: ActorModel, video: VideoModel, t: Transaction) {
- const url = getVideoViewActivityPubUrl(byActor, video)
- const viewActivityData = createViewActivityData(byActor, video)
-
- const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)
-
- // Send to origin
- if (video.isOwned() === false) {
- const audience = getVideoAudience(video, actorsInvolvedInVideo)
- const data = createActivityData(url, byActor, viewActivityData, audience)
-
- return unicastTo(data, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl)
- }
-
- // Send to followers
- const audience = getObjectFollowersAudience(actorsInvolvedInVideo)
- const data = createActivityData(url, byActor, viewActivityData, audience)
-
- // Use the server actor to send the view
- const serverActor = await getServerActor()
- const actorsException = [ byActor ]
- return broadcastToFollowers(data, serverActor, actorsInvolvedInVideo, t, actorsException)
-}
-
-async function sendCreateDislike (byActor: ActorModel, video: VideoModel, t: Transaction) {
- const url = getVideoDislikeActivityPubUrl(byActor, video)
- const dislikeActivityData = createDislikeActivityData(byActor, video)
-
- const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)