diff --git a/lib/search.rb b/lib/search.rb index 6bb40781217..31b0f270f56 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -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