diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-18 14:59:27 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-18 15:42:20 +0100 |
commit | 54e740594bc2eacd8026b5d2d6cfdfc06416a65b (patch) | |
tree | 486ce489a59653c667728be8f54ab038d37e1a99 /server/lib/activitypub | |
parent | f05a1c30c15d2ae35c11e241ca039a72eeb7d6ad (diff) | |
download | PeerTube-54e740594bc2eacd8026b5d2d6cfdfc06416a65b.tar.gz PeerTube-54e740594bc2eacd8026b5d2d6cfdfc06416a65b.tar.zst PeerTube-54e740594bc2eacd8026b5d2d6cfdfc06416a65b.zip |
Avoid too many requests and fetching outbox
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/send/misc.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/lib/activitypub/send/misc.ts b/server/lib/activitypub/send/misc.ts index 261586ae4..dc0d3de57 100644 --- a/server/lib/activitypub/send/misc.ts +++ b/server/lib/activitypub/send/misc.ts | |||
@@ -143,6 +143,10 @@ async function getActorsInvolvedInVideo (video: VideoModel, t: Transaction) { | |||
143 | async function getAudience (actorSender: ActorModel, t: Transaction, isPublic = true) { | 143 | async function getAudience (actorSender: ActorModel, t: Transaction, isPublic = true) { |
144 | const followerInboxUrls = await actorSender.getFollowerSharedInboxUrls(t) | 144 | const followerInboxUrls = await actorSender.getFollowerSharedInboxUrls(t) |
145 | 145 | ||
146 | return buildAudience(followerInboxUrls, isPublic) | ||
147 | } | ||
148 | |||
149 | function buildAudience (followerInboxUrls: string[], isPublic = true) { | ||
146 | // Thanks Mastodon: https://github.com/tootsuite/mastodon/blob/master/app/lib/activitypub/tag_manager.rb#L47 | 150 | // Thanks Mastodon: https://github.com/tootsuite/mastodon/blob/master/app/lib/activitypub/tag_manager.rb#L47 |
147 | let to = [] | 151 | let to = [] |
148 | let cc = [] | 152 | let cc = [] |
@@ -183,6 +187,7 @@ async function computeUris (toActors: ActorModel[], actorsException: ActorModel[ | |||
183 | export { | 187 | export { |
184 | broadcastToFollowers, | 188 | broadcastToFollowers, |
185 | unicastTo, | 189 | unicastTo, |
190 | buildAudience, | ||
186 | getAudience, | 191 | getAudience, |
187 | getOriginVideoAudience, | 192 | getOriginVideoAudience, |
188 | getActorsInvolvedInVideo, | 193 | getActorsInvolvedInVideo, |