1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Activity Pub improvements

This commit is contained in:
Chocobozzz 2018-01-11 19:17:43 +01:00
parent 05bc4dfa06
commit 9a8cbd8278
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 10 additions and 6 deletions

View file

@ -166,14 +166,14 @@ async function computeFollowerUris (toActorFollower: ActorModel[], actorsExcepti
const toActorFollowerIds = toActorFollower.map(a => a.id)
const result = await ActorFollowModel.listAcceptedFollowerSharedInboxUrls(toActorFollowerIds, t)
const sharedInboxesException = actorsException.map(f => f.sharedInboxUrl)
const sharedInboxesException = actorsException.map(f => f.sharedInboxUrl || f.inboxUrl)
return result.data.filter(sharedInbox => sharedInboxesException.indexOf(sharedInbox) === -1)
}
async function computeUris (toActors: ActorModel[], actorsException: ActorModel[] = []) {
const toActorSharedInboxesSet = new Set(toActors.map(a => a.sharedInboxUrl))
const toActorSharedInboxesSet = new Set(toActors.map(a => a.sharedInboxUrl || a.inboxUrl))
const sharedInboxesException = actorsException.map(f => f.sharedInboxUrl)
const sharedInboxesException = actorsException.map(f => f.sharedInboxUrl || f.inboxUrl)
return Array.from(toActorSharedInboxesSet)
.filter(sharedInbox => sharedInboxesException.indexOf(sharedInbox) === -1)
}