You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
445 B

  1. # frozen_string_literal: true
  2. class AccountReachFinder
  3. def initialize(account)
  4. @account = account
  5. end
  6. def inboxes
  7. (followers_inboxes + reporters_inboxes + relay_inboxes).uniq
  8. end
  9. private
  10. def followers_inboxes
  11. @account.followers.inboxes
  12. end
  13. def reporters_inboxes
  14. Account.where(id: @account.targeted_reports.select(:account_id)).inboxes
  15. end
  16. def relay_inboxes
  17. Relay.enabled.pluck(:inbox_url)
  18. end
  19. end