- image = User.avatar_url(user)
- following = if assigns[:for] do
- User.following?(assigns[:for], user)
+ render_one(user, Pleroma.Web.TwitterAPI.UserView, "user.json", assigns)
+ end
+
+ def render("index.json", %{users: users, for: user}) do
+ render_many(users, Pleroma.Web.TwitterAPI.UserView, "user.json", for: user)
+ end
+
+ def render("user.json", %{user: user = %User{}} = assigns) do
+ image = User.avatar_url(user) |> MediaProxy.url()
+ {following, follows_you, statusnet_blocking} = if assigns[:for] do
+ {
+ User.following?(assigns[:for], user),
+ User.following?(user, assigns[:for]),
+ User.blocks?(assigns[:for], user)
+ }