1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.AdminAPI.StatusView do
8 require Pleroma.Constants
10 alias Pleroma.Web.AdminAPI
11 alias Pleroma.Web.CommonAPI
12 alias Pleroma.Web.MastodonAPI
14 defdelegate merge_account_views(user), to: AdminAPI.AccountView
16 def render("index.json", %{total: total} = opts) do
17 %{total: total, activities: safe_render_many(opts.activities, __MODULE__, "show.json", opts)}
20 def render("index.json", opts) do
21 safe_render_many(opts.activities, __MODULE__, "show.json", opts)
24 def render("show.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do
25 user = CommonAPI.get_user(activity.data["actor"])
27 MastodonAPI.StatusView.render("show.json", opts)
28 |> Map.merge(%{account: merge_account_views(user)})