diff options
author | ThibG <thib@sitedethib.com> | 2018-12-30 19:00:04 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-12-30 19:00:04 +0100 |
commit | 6fb6a539389d82caf1a55ea517919977d8ee6e88 (patch) | |
tree | 2447579ddb476b63c68d95ca5b0d51b2093376d1 /app/workers/activitypub/distribution_worker.rb | |
parent | b2f4114550d8cc3af929736c122d69b6e76fcea8 (diff) |
Avoid duplicate work by merging ReplyDistributionWorker into DistributionWorker (#9660)
Diffstat (limited to 'app/workers/activitypub/distribution_worker.rb')
-rw-r--r-- | app/workers/activitypub/distribution_worker.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/workers/activitypub/distribution_worker.rb b/app/workers/activitypub/distribution_worker.rb index 59aacabfd..d83f01700 100644 --- a/app/workers/activitypub/distribution_worker.rb +++ b/app/workers/activitypub/distribution_worker.rb @@ -31,7 +31,14 @@ class ActivityPub::DistributionWorker end def inboxes - @inboxes ||= @account.followers.inboxes + # Deliver the status to all followers. + # If the status is a reply to another local status, also forward it to that + # status' authors' followers. + @inboxes ||= if @status.reply? && @status.thread.account.local? && @status.distributable? + @account.followers.or(@status.thread.account.followers).inboxes + else + @account.followers.inboxes + end end def signed_payload |