From 584482f3259328d243dfb966d03dabdac0ceae65 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Wed, 3 Feb 2021 11:55:57 -0500 Subject: [PATCH] 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