Restricted embedding of relationships where applicable (statuses / notifications...
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index 24167f66f76f4f8a614b8dbc6439ee2456692b4e..0bcc84d4444e3f055a171946985a3e68bdf480df 100644 (file)
@@ -76,6 +76,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
   end
 
   def render("index.json", opts) do
+    opts = Map.merge(%{skip_relationships: true}, opts)
+
     reading_user = opts[:for]
 
     # To do: check AdminAPIControllerTest on the reasons behind nil activities in the list
@@ -125,6 +127,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
         "show.json",
         %{activity: %{data: %{"type" => "Announce", "object" => _object}} = activity} = opts
       ) do
+    opts = Map.merge(%{skip_relationships: true}, opts)
+
     user = get_user(activity.data["actor"])
     created_at = Utils.to_masto_date(activity.data["published"])
     activity_object = Object.normalize(activity)
@@ -198,6 +202,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
   end
 
   def render("show.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do
+    opts = Map.merge(%{skip_relationships: true}, opts)
+
     object = Object.normalize(activity)
 
     user = get_user(activity.data["actor"])