From 4e0605165dc592c7d085b5e3fde171803573260e Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Wed, 3 Feb 2021 11:32:25 -0500 Subject: [PATCH 1/2] Fix explore page. --- app/lib/sorting_query_builder.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/lib/sorting_query_builder.rb b/app/lib/sorting_query_builder.rb index b4a1ae4d..2cd99c28 100644 --- a/app/lib/sorting_query_builder.rb +++ b/app/lib/sorting_query_builder.rb @@ -111,8 +111,6 @@ class SortingQueryBuilder < BaseService query = query.where('status_stats.replies_count > ?', min_replies) unless sort_type == 'recent' query = query.where('status_stats.reblogs_count > ?', min_reblogs) unless sort_type == 'recent' query = query.where('status_stats.favourites_count > ?', min_likes) unless sort_type == 'recent' - query = query.joins(:account) - query = query.where('accounts.is_flagged_as_spam is false') query = query.joins(:status) query = query.where('statuses.reblog_of_id IS NULL') query = query.where('statuses.in_reply_to_id IS NULL') From 584482f3259328d243dfb966d03dabdac0ceae65 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Wed, 3 Feb 2021 11:55:57 -0500 Subject: [PATCH 2/2] Fix explore page correctly. --- app/lib/sorting_query_builder.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/lib/sorting_query_builder.rb b/app/lib/sorting_query_builder.rb index 2cd99c28..bcc7c23e 100644 --- a/app/lib/sorting_query_builder.rb +++ b/app/lib/sorting_query_builder.rb @@ -114,6 +114,11 @@ class SortingQueryBuilder < BaseService query = query.joins(:status) query = query.where('statuses.reblog_of_id IS NULL') query = query.where('statuses.in_reply_to_id IS NULL') + query = query.joins(<<-SQL). + join accounts + on statuses.account_id = accounts.id + SQL + where('accounts.is_flagged_as_spam is false') if source == "explore" query = query.where('statuses.group_id': nil) else