Restricted embedding of relationships where applicable (statuses / notifications...
[akkoma] / lib / pleroma / web / mastodon_api / controllers / search_controller.ex
index b54c569675d9e7fe5937c4cbc80ca6d281c7a4b1..85a316762160a95e2cc79b511eda20c235eb04a4 100644 (file)
@@ -21,6 +21,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
   # Note: Mastodon doesn't allow unauthenticated access (requires read:accounts / read:search)
   plug(OAuthScopesPlug, %{scopes: ["read:search"], fallback: :proceed_unauthenticated})
 
+  # Note: on private instances auth is required (EnsurePublicOrAuthenticatedPlug is not skipped)
+
   plug(RateLimiter, [name: :search] when action in [:search, :search2, :account_search])
 
   def account_search(%{assigns: %{user: user}} = conn, %{"q" => query} = params) do
@@ -84,7 +86,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
       users: accounts,
       for: options[:for_user],
       as: :user,
-      skip_relationships: false
+      skip_relationships: true
     )
   end