diff options
author | kaniini <nenolod@gmail.com> | 2019-02-28 10:08:31 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-02-28 10:08:31 +0000 |
commit | 3c849d0438b9c8e2954c46455b8f37a3ee71c25c (patch) | |
tree | 8c717b935da48d9548187bd74d446d2be8a8759c /lib | |
parent | 9cc98b496ee378a2d6459b080e1d0067ac216911 (diff) | |
parent | 6b11011039dca5090c3a7b7b2a01f32b666be380 (diff) | |
download | pleroma-3c849d0438b9c8e2954c46455b8f37a3ee71c25c.tar.gz |
Merge branch 'deactivated-in-user-view' into 'develop'
Add activation status to the regular user view
See merge request pleroma/pleroma!874
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/twitter_api/views/user_view.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex index c5034cf36..22f33e0b5 100644 --- a/lib/pleroma/web/twitter_api/views/user_view.ex +++ b/lib/pleroma/web/twitter_api/views/user_view.ex @@ -132,6 +132,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do "confirmation_pending" => user_info.confirmation_pending, "tags" => user.tags } + |> maybe_with_activation_status(user, for_user) |> maybe_with_follow_request_count(user, for_user) } @@ -148,6 +149,12 @@ defmodule Pleroma.Web.TwitterAPI.UserView do end end + defp maybe_with_activation_status(data, user, %User{info: %{is_admin: true}}) do + Map.put(data, "deactivated", user.info.deactivated) + end + + defp maybe_with_activation_status(data, _, _), do: data + defp maybe_with_follow_request_count(data, %User{id: id, info: %{locked: true}} = user, %User{ id: id }) do |