0
0
Fork 0

Avoid duplicate work by merging ReplyDistributionWorker into DistributionWorker (#9660)

This commit is contained in:
ThibG 2018-12-30 19:00:04 +01:00 committed by Eugen Rochko
parent b2f4114550
commit 6fb6a53938
3 changed files with 8 additions and 44 deletions

View file

@ -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