logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

raw_distribution_worker.rb (503B)


  1. # frozen_string_literal: true
  2. class ActivityPub::RawDistributionWorker
  3. include Sidekiq::Worker
  4. sidekiq_options queue: 'push'
  5. def perform(json, source_account_id, exclude_inboxes = [])
  6. @account = Account.find(source_account_id)
  7. ActivityPub::DeliveryWorker.push_bulk(inboxes - exclude_inboxes) do |inbox_url|
  8. [json, @account.id, inbox_url]
  9. end
  10. rescue ActiveRecord::RecordNotFound
  11. true
  12. end
  13. private
  14. def inboxes
  15. @inboxes ||= @account.followers.inboxes
  16. end
  17. end