闭社主体 forked from https://github.com/tootsuite/mastodon
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.

15 lines
943 B

  1. # frozen_string_literal: true
  2. class AccountRelationshipsPresenter
  3. attr_reader :following, :followed_by, :blocking,
  4. :muting, :requested, :domain_blocking
  5. def initialize(account_ids, current_account_id, options = {})
  6. @following = Account.following_map(account_ids, current_account_id).merge(options[:following_map] || {})
  7. @followed_by = Account.followed_by_map(account_ids, current_account_id).merge(options[:followed_by_map] || {})
  8. @blocking = Account.blocking_map(account_ids, current_account_id).merge(options[:blocking_map] || {})
  9. @muting = Account.muting_map(account_ids, current_account_id).merge(options[:muting_map] || {})
  10. @requested = Account.requested_map(account_ids, current_account_id).merge(options[:requested_map] || {})
  11. @domain_blocking = Account.domain_blocking_map(account_ids, current_account_id).merge(options[:domain_blocking_map] || {})
  12. end
  13. end