diff options
Diffstat (limited to 'server/lib/activitypub/send/send-announce.ts')
-rw-r--r-- | server/lib/activitypub/send/send-announce.ts | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/server/lib/activitypub/send/send-announce.ts b/server/lib/activitypub/send/send-announce.ts index fa1d47259..dfc099ff2 100644 --- a/server/lib/activitypub/send/send-announce.ts +++ b/server/lib/activitypub/send/send-announce.ts | |||
@@ -11,7 +11,7 @@ async function buildVideoAnnounce (byActor: ActorModel, videoShare: VideoShareMo | |||
11 | 11 | ||
12 | const accountsToForwardView = await getActorsInvolvedInVideo(video, t) | 12 | const accountsToForwardView = await getActorsInvolvedInVideo(video, t) |
13 | const audience = getObjectFollowersAudience(accountsToForwardView) | 13 | const audience = getObjectFollowersAudience(accountsToForwardView) |
14 | return announceActivityData(videoShare.url, byActor, announcedObject, t, audience) | 14 | return announceActivityData(videoShare.url, byActor, announcedObject, audience) |
15 | } | 15 | } |
16 | 16 | ||
17 | async function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) { | 17 | async function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) { |
@@ -20,16 +20,8 @@ async function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareMod | |||
20 | return broadcastToFollowers(data, byActor, [ byActor ], t) | 20 | return broadcastToFollowers(data, byActor, [ byActor ], t) |
21 | } | 21 | } |
22 | 22 | ||
23 | async function announceActivityData ( | 23 | function announceActivityData (url: string, byActor: ActorModel, object: string, audience?: ActivityAudience): ActivityAnnounce { |
24 | url: string, | 24 | if (!audience) audience = getAudience(byActor) |
25 | byActor: ActorModel, | ||
26 | object: string, | ||
27 | t: Transaction, | ||
28 | audience?: ActivityAudience | ||
29 | ): Promise<ActivityAnnounce> { | ||
30 | if (!audience) { | ||
31 | audience = await getAudience(byActor, t) | ||
32 | } | ||
33 | 25 | ||
34 | return { | 26 | return { |
35 | type: 'Announce', | 27 | type: 'Announce', |