Merge branch 'deactivated-in-user-view' into 'develop'

Add activation status to the regular user view

See merge request pleroma/pleroma!874
This commit is contained in:
kaniini 2019-02-28 10:08:31 +00:00
commit 3c849d0438
2 changed files with 14 additions and 0 deletions

View file

@ -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