Forward ActivityPub deletes to followers of rebloggers (#4706)
This commit is contained in:
parent
884b085f53
commit
0397c58b61
2 changed files with 41 additions and 1 deletions
23
app/workers/activitypub/raw_distribution_worker.rb
Normal file
23
app/workers/activitypub/raw_distribution_worker.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::RawDistributionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
sidekiq_options queue: 'push'
|
||||
|
||||
def perform(json, source_account_id)
|
||||
@account = Account.find(source_account_id)
|
||||
|
||||
ActivityPub::DeliveryWorker.push_bulk(inboxes) do |inbox_url|
|
||||
[json, @account.id, inbox_url]
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def inboxes
|
||||
@inboxes ||= @account.followers.inboxes
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue