Merge branch 'chores/bump-copyright' into 'develop'
[akkoma] / lib / pleroma / web / admin_api / views / account_view.ex
index bdab04ad2200098f4ad3f6c44c718b404bf9fcc7..37188bfeb27ef64d8a99c5a1305ffc0268035f18 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.AdminAPI.AccountView do
@@ -39,7 +39,7 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
       :fields,
       :name,
       :nickname,
-      :locked,
+      :is_locked,
       :no_rich_text,
       :default_scope,
       :hide_follows,
@@ -52,7 +52,7 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
       :skip_thread_containment,
       :pleroma_settings_store,
       :raw_fields,
-      :discoverable,
+      :is_discoverable,
       :actor_type
     ])
     |> Map.merge(%{
@@ -69,6 +69,7 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
 
     %{
       "id" => user.id,
+      "email" => user.email,
       "avatar" => avatar,
       "nickname" => user.nickname,
       "display_name" => display_name,
@@ -79,7 +80,8 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
       "confirmation_pending" => user.confirmation_pending,
       "approval_pending" => user.approval_pending,
       "url" => user.uri || user.ap_id,
-      "registration_reason" => user.registration_reason
+      "registration_reason" => user.registration_reason,
+      "actor_type" => user.actor_type
     }
   end
 
@@ -107,7 +109,7 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
   end
 
   def merge_account_views(%User{} = user) do
-    MastodonAPI.AccountView.render("show.json", %{user: user})
+    MastodonAPI.AccountView.render("show.json", %{user: user, skip_visibility_check: true})
     |> Map.merge(AdminAPI.AccountView.render("show.json", %{user: user}))
   end