Don't search unlisted statuses
This commit is contained in:
		
							parent
							
								
									a3faf83586
								
							
						
					
					
						commit
						3fa72fd56c
					
				
					 3 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -283,10 +283,10 @@ MAX_POLL_OPTION_CHARS=100
 | 
			
		|||
# Customize the number of hashtags shown in 'Explore'
 | 
			
		||||
# MAX_TRENDING_TAGS=10
 | 
			
		||||
 | 
			
		||||
# Search all visible statuses
 | 
			
		||||
# Search all public statuses
 | 
			
		||||
# (Normally searches only a user's own statuses, favs, bookmarks, and mentions)
 | 
			
		||||
# Only relevant when elasticsearch is installed
 | 
			
		||||
# SEARCH_ALL_VISIBLE_STATUSES=true
 | 
			
		||||
# SEARCH_ALL_PUBLIC_STATUSES=true
 | 
			
		||||
 | 
			
		||||
# Maximum custom emoji file sizes
 | 
			
		||||
# If undefined or smaller than MAX_EMOJI_SIZE, the value
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,6 +71,6 @@ class StatusesIndex < Chewy::Index
 | 
			
		|||
    end
 | 
			
		||||
 | 
			
		||||
    field :searchable_by, type: 'long', value: ->(status, crutches) { status.searchable_by(crutches) }
 | 
			
		||||
    field :searchable_by_anyone, type: 'boolean', value: ->(status) { status.public_visibility? or status.unlisted_visibility? }
 | 
			
		||||
    field :searchable_by_anyone, type: 'boolean', value: ->(status) { status.public_visibility? }
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
class SearchService < BaseService
 | 
			
		||||
  SEARCH_ALL_VISIBLE_STATUSES = ENV['SEARCH_ALL_VISIBLE_STATUSES'] == 'true'
 | 
			
		||||
  SEARCH_ALL_PUBLIC_STATUSES = ENV['SEARCH_ALL_PUBLIC_STATUSES'] == 'true'
 | 
			
		||||
 | 
			
		||||
  def call(query, account, limit, options = {})
 | 
			
		||||
    @query   = query&.strip
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue