[#2497] Specified SHELL in .gitlab-ci.yml as required for `exexec`.
[akkoma] / lib / pleroma / web / controller_helper.ex
index f0b4c087a1905e50e4b91d5baec26cf95342b49e..5a1316a5f166f5871be0cb75e059de9299f96735 100644 (file)
@@ -104,8 +104,16 @@ defmodule Pleroma.Web.ControllerHelper do
 
   def put_if_exist(map, key, value), do: Map.put(map, key, value)
 
-  @doc "Whether to skip `account.pleroma.relationship` rendering for statuses/notifications"
-  def skip_relationships?(params) do
-    not truthy_param?(params["with_relationships"])
+  @doc """
+  Returns true if request specifies to include embedded relationships in account objects.
+  May only be used in selected account-related endpoints; has no effect for status- or
+    notification-related endpoints.
+  """
+  # Intended for PleromaFE: https://git.pleroma.social/pleroma/pleroma-fe/-/issues/838
+  def embed_relationships?(params) do
+    # To do once OpenAPI transition mess is over: just `truthy_param?(params[:with_relationships])`
+    params
+    |> Map.get(:with_relationships, params["with_relationships"])
+    |> truthy_param?()
   end
 end