mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-14 17:38:04 -05:00
Quarantine: Remove from search results.
This commit is contained in:
@@ -693,14 +693,20 @@ class SearchBuilder(IDBuilder):
|
||||
# doesn't use the default keep_item because we want to keep
|
||||
# things that were voted on, even if they've chosen to hide
|
||||
# them in normal listings
|
||||
user = c.user if c.user_is_loggedin else None
|
||||
|
||||
if item._spam or item._deleted:
|
||||
return False
|
||||
# If checking (wrapped) links, filter out banned subreddits
|
||||
elif hasattr(item, 'subreddit') and item.subreddit.spammy():
|
||||
return False
|
||||
elif hasattr(item, 'subreddit') and not item.subreddit.is_exposed(user):
|
||||
return False
|
||||
elif (self.skip_deleted_authors and
|
||||
getattr(item, "author", None) and item.author._deleted):
|
||||
return False
|
||||
elif isinstance(item.lookups[0], Subreddit) and not item.is_exposed(user):
|
||||
return False
|
||||
|
||||
# show NSFW to API and RSS users unless obey_over18=true
|
||||
is_api_or_rss = (c.render_style in API_TYPES
|
||||
|
||||
Reference in New Issue
Block a user