Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into develop

This commit is contained in:
admin 2021-02-03 11:56:36 -05:00
commit fa9f0ce6f3
1 changed files with 5 additions and 2 deletions

View File

@ -111,11 +111,14 @@ 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')
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