FEATURE: in:private keyword for searching private messages

This commit is contained in:
Sam 2014-12-05 10:22:39 +11:00
parent bc772233a7
commit b08f724e2b

View file

@ -106,6 +106,12 @@ class Search
@search_context = @opts[:search_context]
@include_blurbs = @opts[:include_blurbs] || false
@limit = Search.per_facet
if @search_pms && @guardian.user
@opts[:type_filter] = "private_messages"
@search_context = @guardian.user
end
if @opts[:type_filter].present?
@limit = Search.per_filter
end
@ -183,6 +189,9 @@ class Search
elsif word == 'in:tracking'
@notification_level = TopicUser.notification_levels[:tracking]
nil
elsif word == 'in:private'
@search_pms = true
nil
else
word
end