mirror of
https://github.com/mastodon/mastodon.git
synced 2024-10-20 09:41:28 +09:00
85e97ecab6
* 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
24 lines
503 B
Ruby
24 lines
503 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::RawDistributionWorker
|
|
include Sidekiq::Worker
|
|
|
|
sidekiq_options queue: 'push'
|
|
|
|
def perform(json, source_account_id, exclude_inboxes = [])
|
|
@account = Account.find(source_account_id)
|
|
|
|
ActivityPub::DeliveryWorker.push_bulk(inboxes - exclude_inboxes) do |inbox_url|
|
|
[json, @account.id, inbox_url]
|
|
end
|
|
rescue ActiveRecord::RecordNotFound
|
|
true
|
|
end
|
|
|
|
private
|
|
|
|
def inboxes
|
|
@inboxes ||= @account.followers.inboxes
|
|
end
|
|
end
|