about summary refs log tree commit diff
path: root/app/models/concerns/status_threading_concern.rb
diff options
context:
space:
mode:
authorStarfall <root@starfall.blue>2020-02-04 17:44:29 -0600
committerStarfall <root@starfall.blue>2020-02-04 17:44:29 -0600
commit6d24d3bcb84abd04f31da95f97f6d60ef0afdc00 (patch)
treee7c38251a9e92bdf3a464b4aa7f1880aa5139bf0 /app/models/concerns/status_threading_concern.rb
parentc0c9529df269816f52915a9802e5e30fbce9576b (diff)
parent885e9227c6e8e1ce5e4a5625d5126ba76dce2c00 (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/models/concerns/status_threading_concern.rb')
-rw-r--r--app/models/concerns/status_threading_concern.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb
index 15eb695cd..a0ead1995 100644
--- a/app/models/concerns/status_threading_concern.rb
+++ b/app/models/concerns/status_threading_concern.rb
@@ -81,12 +81,12 @@ module StatusThreadingConcern
   end
 
   def find_statuses_from_tree_path(ids, account, promote: false)
-    statuses    = statuses_with_accounts(ids).to_a
+    statuses    = Status.with_accounts(ids).to_a
     account_ids = statuses.map(&:account_id).uniq
     domains     = statuses.map(&:account_domain).compact.uniq
     relations   = relations_map_for_account(account, account_ids, domains)
 
-    statuses.reject! { |status| filter_from_context?(status, account, relations) }
+    statuses.reject! { |status| StatusFilter.new(status, account, relations).filtered? }
 
     # Order ancestors/descendants by tree path
     statuses.sort_by! { |status| ids.index(status.id) }
@@ -125,12 +125,4 @@ module StatusThreadingConcern
       domain_blocking_by_domain: Account.domain_blocking_map_by_domain(domains, account.id),
     }
   end
-
-  def statuses_with_accounts(ids)
-    Status.where(id: ids).includes(:account)
-  end
-
-  def filter_from_context?(status, account, relations)
-    StatusFilter.new(status, account, relations).filtered?
-  end
 end