diff options
author | lain <lain@soykaf.club> | 2020-05-17 12:14:49 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-17 12:14:49 +0200 |
commit | 9c171097653abce49b9847fff66bc39b35719a1c (patch) | |
tree | e89ab9245f0844bfb3334f62f67f8ab9f0949580 /lib/pleroma/web/admin_api/views/status_view.ex | |
parent | f012c3a202ef43d1a8a1dc88f08057b7a41d3d78 (diff) | |
parent | b0ccdb5af4baa119b336298d38f34746cdce0111 (diff) | |
download | pleroma-9c171097653abce49b9847fff66bc39b35719a1c.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'lib/pleroma/web/admin_api/views/status_view.ex')
-rw-r--r-- | lib/pleroma/web/admin_api/views/status_view.ex | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/pleroma/web/admin_api/views/status_view.ex b/lib/pleroma/web/admin_api/views/status_view.ex index 3637dee24..500800be2 100644 --- a/lib/pleroma/web/admin_api/views/status_view.ex +++ b/lib/pleroma/web/admin_api/views/status_view.ex @@ -7,24 +7,19 @@ defmodule Pleroma.Web.AdminAPI.StatusView do require Pleroma.Constants - alias Pleroma.User - alias Pleroma.Web.MastodonAPI.StatusView + alias Pleroma.Web.AdminAPI + alias Pleroma.Web.MastodonAPI + + defdelegate merge_account_views(user), to: AdminAPI.AccountView def render("index.json", opts) do safe_render_many(opts.activities, __MODULE__, "show.json", opts) end def render("show.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do - user = StatusView.get_user(activity.data["actor"]) + user = MastodonAPI.StatusView.get_user(activity.data["actor"]) - StatusView.render("show.json", opts) + MastodonAPI.StatusView.render("show.json", opts) |> Map.merge(%{account: merge_account_views(user)}) 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})) - end - - defp merge_account_views(_), do: %{} end |