about summary refs log tree commit diff
path: root/app/services/import_service.rb
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2023-03-21 18:32:58 +0900
committerGitHub <noreply@github.com>2023-03-21 10:32:58 +0100
commit38c84f57b6d2de1683974f91d726c30ba7f1491b (patch)
tree35b416ccf1ddbd37aaf07bce0f52e590fb896dd8 /app/services/import_service.rb
parent9f8d1601a4877459b4d332d03796e5b70f07134e (diff)
Refactoring relations_map (#24195)
Diffstat (limited to 'app/services/import_service.rb')
-rw-r--r--app/services/import_service.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/app/services/import_service.rb b/app/services/import_service.rb
index 940c236d4..56f191c1f 100644
--- a/app/services/import_service.rb
+++ b/app/services/import_service.rb
@@ -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