From a65c18859307f4aacf42eb5dd14e63ad76747a6d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 27 Jan 2019 10:21:13 +0100 Subject: [PATCH] Web.MastodonAPI.AccountView: Add is_moderator and is_admin Closes: https://git.pleroma.social/pleroma/pleroma/issues/557 --- lib/pleroma/web/mastodon_api/views/account_view.ex | 4 +++- test/web/mastodon_api/account_view_test.exs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index bfd6b8b22..0ba4289da 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -112,7 +112,9 @@ defp do_render("account.json", %{user: user} = opts) do # Pleroma extension pleroma: %{ confirmation_pending: user_info.confirmation_pending, - tags: user.tags + tags: user.tags, + is_moderator: user.info.is_moderator, + is_admin: user.info.is_admin } } end diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index d53e11963..f8cd68173 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -61,7 +61,9 @@ test "Represent a user account" do }, pleroma: %{ confirmation_pending: false, - tags: [] + tags: [], + is_admin: false, + is_moderator: false } } @@ -102,7 +104,9 @@ test "Represent a Service(bot) account" do }, pleroma: %{ confirmation_pending: false, - tags: [] + tags: [], + is_admin: false, + is_moderator: false } }