Merge branch 'fix/dont-show-dms-in-mentions-timeline' into 'develop'
[akkoma] / lib / pleroma / web / twitter_api / views / user_view.ex
index c5034cf3674b9236fb240b3d0044c9dd9c11f215..22f33e0b5d984bae61ad0269f1103705ec5b932d 100644 (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