Refactoring relations_map (#24195)
This commit is contained in:
parent
9f8d1601a4
commit
38c84f57b6
4 changed files with 18 additions and 35 deletions
|
@ -120,7 +120,7 @@ class ImportService < BaseService
|
|||
end
|
||||
|
||||
account_ids = statuses.map(&:account_id)
|
||||
preloaded_relations = relations_map_for_account(@account, account_ids)
|
||||
preloaded_relations = @account.relations_map(account_ids, skip_blocking_and_muting: true)
|
||||
|
||||
statuses.keep_if { |status| StatusPolicy.new(@account, status, preloaded_relations).show? }
|
||||
|
||||
|
@ -138,14 +138,4 @@ class ImportService < BaseService
|
|||
def import_data
|
||||
Paperclip.io_adapters.for(@import.data).read.force_encoding(Encoding::UTF_8)
|
||||
end
|
||||
|
||||
def relations_map_for_account(account, account_ids)
|
||||
{
|
||||
blocking: {},
|
||||
blocked_by: Account.blocked_by_map(account_ids, account.id),
|
||||
muting: {},
|
||||
following: Account.following_map(account_ids, account.id),
|
||||
domain_blocking_by_domain: {},
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue