Merge branch 'fix/credo-issues' into 'develop'
[akkoma] / lib / pleroma / web / mastodon_api / views / account_view.ex
index 555383503605bcbe2eb29308a46db6fe0870bd00..9df9f14b2a04ff352750e2d7f85a73a6224d09d3 100644 (file)
@@ -1,14 +1,15 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.MastodonAPI.AccountView do
   use Pleroma.Web, :view
+
+  alias Pleroma.HTML
   alias Pleroma.User
-  alias Pleroma.Web.MastodonAPI.AccountView
   alias Pleroma.Web.CommonAPI.Utils
+  alias Pleroma.Web.MastodonAPI.AccountView
   alias Pleroma.Web.MediaProxy
-  alias Pleroma.HTML
 
   def render("accounts.json", %{users: users} = opts) do
     users
@@ -112,7 +113,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountView 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