Restricted embedding of relationships where applicable (statuses / notifications...
[akkoma] / lib / pleroma / web / admin_api / views / report_view.ex
index d50969b2a7a4712e63c619d42dcbb57950cd6006..215e311008fc8c081e461cd8737066341cee8b1c 100644 (file)
@@ -7,8 +7,10 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
 
   alias Pleroma.HTML
   alias Pleroma.User
+  alias Pleroma.Web.AdminAPI
   alias Pleroma.Web.AdminAPI.Report
   alias Pleroma.Web.CommonAPI.Utils
+  alias Pleroma.Web.MastodonAPI
   alias Pleroma.Web.MastodonAPI.StatusView
 
   def render("index.json", %{reports: reports}) do
@@ -41,8 +43,7 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
       statuses:
         StatusView.render("index.json", %{
           activities: statuses,
-          as: :activity,
-          skip_relationships: false
+          as: :activity
         }),
       state: report.data["state"],
       notes: render(__MODULE__, "index_notes.json", %{notes: report.report_notes})
@@ -72,8 +73,8 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
   end
 
   defp merge_account_views(%User{} = user) do
-    Pleroma.Web.MastodonAPI.AccountView.render("show.json", %{user: user})
-    |> Map.merge(Pleroma.Web.AdminAPI.AccountView.render("show.json", %{user: user}))
+    MastodonAPI.AccountView.render("show.json", %{user: user, skip_relationships: true})
+    |> Map.merge(AdminAPI.AccountView.render("show.json", %{user: user}))
   end
 
   defp merge_account_views(_), do: %{}