mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Avoid too many requests and fetching outbox
This commit is contained in:
parent
f05a1c30c1
commit
54e740594b
6 changed files with 72 additions and 20 deletions
|
@ -143,6 +143,10 @@ async function getActorsInvolvedInVideo (video: VideoModel, t: Transaction) {
|
|||
async function getAudience (actorSender: ActorModel, t: Transaction, isPublic = true) {
|
||||
const followerInboxUrls = await actorSender.getFollowerSharedInboxUrls(t)
|
||||
|
||||
return buildAudience(followerInboxUrls, isPublic)
|
||||
}
|
||||
|
||||
function buildAudience (followerInboxUrls: string[], isPublic = true) {
|
||||
// Thanks Mastodon: https://github.com/tootsuite/mastodon/blob/master/app/lib/activitypub/tag_manager.rb#L47
|
||||
let to = []
|
||||
let cc = []
|
||||
|
@ -183,6 +187,7 @@ async function computeUris (toActors: ActorModel[], actorsException: ActorModel[
|
|||
export {
|
||||
broadcastToFollowers,
|
||||
unicastTo,
|
||||
buildAudience,
|
||||
getAudience,
|
||||
getOriginVideoAudience,
|
||||
getActorsInvolvedInVideo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue