Fix actor outbox

This commit is contained in:
Chocobozzz 2018-05-28 12:13:00 +02:00
parent 9007daff82
commit e3d5ea4f82
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 19 additions and 10 deletions

View file

@ -59,14 +59,13 @@ async function getAudience (actorSender: ActorModel, t: Transaction, isPublic =
return buildAudience([ actorSender.followersUrl ], isPublic)
}
function buildAudience (followerInboxUrls: string[], isPublic = true) {
// Thanks Mastodon: https://github.com/tootsuite/mastodon/blob/master/app/lib/activitypub/tag_manager.rb#L47
function buildAudience (followerUrls: string[], isPublic = true) {
let to = []
let cc = []
if (isPublic) {
to = [ ACTIVITY_PUB.PUBLIC ]
cc = followerInboxUrls
cc = followerUrls
} else { // Unlisted
to = [ ]
cc = [ ]