0
0
Fork 0

Fix too many forwards (#5854)

* Avoid sending explicit Undo->Announce when original deleted

* Do not forward a reply back to the server that sent it

* Deduplicate inboxes of rebloggers' followers for delete forwarding

* Adjust test

* Fix wrong class, bad SQL, wrong variable, outdated comment
This commit is contained in:
Eugen Rochko 2017-11-30 03:50:05 +01:00 committed by GitHub
parent dc1ebd45a3
commit 85e97ecab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 15 deletions

View file

@ -5,10 +5,10 @@ class ActivityPub::RawDistributionWorker
sidekiq_options queue: 'push'
def perform(json, source_account_id)
def perform(json, source_account_id, exclude_inboxes = [])
@account = Account.find(source_account_id)
ActivityPub::DeliveryWorker.push_bulk(inboxes) do |inbox_url|
ActivityPub::DeliveryWorker.push_bulk(inboxes - exclude_inboxes) do |inbox_url|
[json, @account.id, inbox_url]
end
rescue ActiveRecord::RecordNotFound