diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-23 16:14:33 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-24 09:40:46 +0100 |
commit | a219c9100b3ce8774d454497d46be87465bf664e (patch) | |
tree | caa869e47919a9e23cc86dcece1100e239683b8c /server/lib/activitypub/send/send-announce.ts | |
parent | 7e98a7df7d04e19ba67163a86c7b876d78d76839 (diff) | |
download | PeerTube-a219c9100b3ce8774d454497d46be87465bf664e.tar.gz PeerTube-a219c9100b3ce8774d454497d46be87465bf664e.tar.zst PeerTube-a219c9100b3ce8774d454497d46be87465bf664e.zip |
Refactor AP context builder
Diffstat (limited to 'server/lib/activitypub/send/send-announce.ts')
-rw-r--r-- | server/lib/activitypub/send/send-announce.ts | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server/lib/activitypub/send/send-announce.ts b/server/lib/activitypub/send/send-announce.ts index 7897beb75..6c078b047 100644 --- a/server/lib/activitypub/send/send-announce.ts +++ b/server/lib/activitypub/send/send-announce.ts | |||
@@ -23,13 +23,19 @@ async function buildAnnounceWithVideoAudience ( | |||
23 | return { activity, actorsInvolvedInVideo } | 23 | return { activity, actorsInvolvedInVideo } |
24 | } | 24 | } |
25 | 25 | ||
26 | async function sendVideoAnnounce (byActor: MActorLight, videoShare: MVideoShare, video: MVideo, t: Transaction) { | 26 | async function sendVideoAnnounce (byActor: MActorLight, videoShare: MVideoShare, video: MVideo, transaction: Transaction) { |
27 | const { activity, actorsInvolvedInVideo } = await buildAnnounceWithVideoAudience(byActor, videoShare, video, t) | 27 | const { activity, actorsInvolvedInVideo } = await buildAnnounceWithVideoAudience(byActor, videoShare, video, transaction) |
28 | 28 | ||
29 | logger.info('Creating job to send announce %s.', videoShare.url) | 29 | logger.info('Creating job to send announce %s.', videoShare.url) |
30 | 30 | ||
31 | const followersException = [ byActor ] | 31 | return broadcastToFollowers({ |
32 | return broadcastToFollowers(activity, byActor, actorsInvolvedInVideo, t, followersException, 'Announce') | 32 | data: activity, |
33 | byActor, | ||
34 | toFollowersOf: actorsInvolvedInVideo, | ||
35 | transaction, | ||
36 | actorsException: [ byActor ], | ||
37 | contextType: 'Announce' | ||
38 | }) | ||
33 | } | 39 | } |
34 | 40 | ||
35 | function buildAnnounceActivity (url: string, byActor: MActorLight, object: string, audience?: ActivityAudience): ActivityAnnounce { | 41 | function buildAnnounceActivity (url: string, byActor: MActorLight, object: string, audience?: ActivityAudience): ActivityAnnounce { |