From ec4a8d81b141c46a6fa967f8416724d0162cd6c7 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 16 Apr 2022 21:20:07 +0200 Subject: Revert DM support in HomeFeed#from_database Fixes #1746 Queries could get prohibitively expensive. --- app/models/home_feed.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/models') 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) } -- cgit