about summary refs log tree commit diff
path: root/app/models/home_feed.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-16 21:20:07 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-04-16 21:28:46 +0200
commitec4a8d81b141c46a6fa967f8416724d0162cd6c7 (patch)
tree53048e1695301fe40de56a316b320bd38ba7362d /app/models/home_feed.rb
parent5db3a14388cf780364b213c63aaf97b6f444ca17 (diff)
Revert DM support in HomeFeed#from_database
Fixes #1746

Queries could get prohibitively expensive.
Diffstat (limited to 'app/models/home_feed.rb')
-rw-r--r--app/models/home_feed.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/home_feed.rb b/app/models/home_feed.rb
index 447445092..53550b7db 100644
--- a/app/models/home_feed.rb
+++ b/app/models/home_feed.rb
@@ -44,10 +44,8 @@ class HomeFeed < Feed
   protected
 
   def from_database(limit, max_id, since_id, min_id)
-    scope = Status.where(account: @account.following)
-    scope = scope.left_outer_joins(:mentions)
-    scope = scope.where(visibility: %i(public unlisted private)).or(scope.where(mentions: { account_id: @account.id })).group(Status.arel_table[:id])
-    scope = scope.or(Status.where(account: @account))
+    scope = Status.where(account: @account).or(Status.where(account: @account.following))
+    scope = scope.where(visibility: %i(public unlisted private))
     scope
       .to_a_paginated_by_id(limit, min_id: min_id, max_id: max_id, since_id: since_id)
       .reject { |status| FeedManager.instance.filter?(:home, status, @account) }