From 07197db4c567f22bbc9c12339062896dc76bac2f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 27 Mar 2018 13:33:56 +0200 Subject: Try to refractor activities sending There is still a need for work on this part though --- server/lib/activitypub/send/send-announce.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/lib/activitypub/send/send-announce.ts') diff --git a/server/lib/activitypub/send/send-announce.ts b/server/lib/activitypub/send/send-announce.ts index ed551a2b2..4179c9d43 100644 --- a/server/lib/activitypub/send/send-announce.ts +++ b/server/lib/activitypub/send/send-announce.ts @@ -5,7 +5,7 @@ import { VideoModel } from '../../../models/video/video' import { VideoShareModel } from '../../../models/video/video-share' import { broadcastToFollowers, getActorsInvolvedInVideo, getAudience, getObjectFollowersAudience } from './misc' -async function buildVideoAnnounceToFollowers (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) { +async function buildVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) { const announcedObject = video.url const accountsToForwardView = await getActorsInvolvedInVideo(video, t) @@ -13,8 +13,8 @@ async function buildVideoAnnounceToFollowers (byActor: ActorModel, videoShare: V return announceActivityData(videoShare.url, byActor, announcedObject, t, audience) } -async function sendVideoAnnounceToFollowers (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) { - const data = await buildVideoAnnounceToFollowers(byActor, videoShare, video, t) +async function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) { + const data = await buildVideoAnnounce(byActor, videoShare, video, t) return broadcastToFollowers(data, byActor, [ byActor ], t) } @@ -43,7 +43,7 @@ async function announceActivityData ( // --------------------------------------------------------------------------- export { - sendVideoAnnounceToFollowers, + sendVideoAnnounce, announceActivityData, - buildVideoAnnounceToFollowers + buildVideoAnnounce } -- cgit v1.2.3