X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Ftwitter_api%2Fviews%2Fuser_view.ex;h=0791ed7608e1be3b3318d63a456f067d4d41ea02;hb=d0e94d5f1baac7a19d6cdd33b1f54470041e7227;hp=df73844761af4cfb3e02044ca8b8da7ef827e6af;hpb=f53dc5ee08b5db336738fa73677533785fb7351f;p=akkoma diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex index df7384476..0791ed760 100644 --- a/lib/pleroma/web/twitter_api/views/user_view.ex +++ b/lib/pleroma/web/twitter_api/views/user_view.ex @@ -118,7 +118,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do "confirmation_pending" => user_info.confirmation_pending, "tags" => user.tags } - |> maybe_with_follow_request_count(user, for_user) + |> maybe_with_activation_status(user, for_user) } data = @@ -134,13 +134,11 @@ defmodule Pleroma.Web.TwitterAPI.UserView do end end - defp maybe_with_follow_request_count(data, %User{id: id, info: %{locked: true}} = user, %User{ - id: id - }) do - Map.put(data, "follow_request_count", user.info.follow_request_count) + defp maybe_with_activation_status(data, user, %User{info: %{is_admin: true}}) do + Map.put(data, "deactivated", user.info.deactivated) end - defp maybe_with_follow_request_count(data, _, _), do: data + defp maybe_with_activation_status(data, _, _), do: data defp maybe_with_role(data, %User{id: id} = user, %User{id: id}) do Map.merge(data, %{"role" => role(user), "show_role" => user.info.show_role})