1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.AdminAPI.StatusView do
8 require Pleroma.Constants
11 alias Pleroma.Web.AdminAPI
12 alias Pleroma.Web.MastodonAPI
13 alias Pleroma.Web.MastodonAPI.StatusView
15 def render("index.json", opts) do
16 safe_render_many(opts.activities, __MODULE__, "show.json", opts)
19 def render("show.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do
20 user = StatusView.get_user(activity.data["actor"])
22 StatusView.render("show.json", opts)
23 |> Map.merge(%{account: merge_account_views(user)})
26 defp merge_account_views(%User{} = user) do
27 MastodonAPI.AccountView.render("show.json", %{user: user, skip_relationships: true})
28 |> Map.merge(AdminAPI.AccountView.render("show.json", %{user: user}))
31 defp merge_account_views(_), do: %{}