diff options
author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2023-03-21 18:32:58 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 10:32:58 +0100 |
commit | 38c84f57b6d2de1683974f91d726c30ba7f1491b (patch) | |
tree | 35b416ccf1ddbd37aaf07bce0f52e590fb896dd8 /app/models/concerns/status_threading_concern.rb | |
parent | 9f8d1601a4877459b4d332d03796e5b70f07134e (diff) |
Refactoring relations_map (#24195)
Diffstat (limited to 'app/models/concerns/status_threading_concern.rb')
-rw-r--r-- | app/models/concerns/status_threading_concern.rb | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb index 8b628beea..2ca3b66c2 100644 --- a/app/models/concerns/status_threading_concern.rb +++ b/app/models/concerns/status_threading_concern.rb @@ -79,7 +79,7 @@ module StatusThreadingConcern statuses = Status.with_accounts(ids).to_a account_ids = statuses.map(&:account_id).uniq domains = statuses.filter_map(&:account_domain).uniq - relations = relations_map_for_account(account, account_ids, domains) + relations = account&.relations_map(account_ids, domains) || {} statuses.reject! { |status| StatusFilter.new(status, account, relations).filtered? } @@ -108,16 +108,4 @@ module StatusThreadingConcern arr end - - def relations_map_for_account(account, account_ids, domains) - return {} if account.nil? - - { - blocking: Account.blocking_map(account_ids, account.id), - blocked_by: Account.blocked_by_map(account_ids, account.id), - muting: Account.muting_map(account_ids, account.id), - following: Account.following_map(account_ids, account.id), - domain_blocking_by_domain: Account.domain_blocking_map_by_domain(domains, account.id), - } - end end |