1 defmodule Pleroma.Web.TwitterAPI.Representers.UserRepresenter do
2 use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
6 def to_map(user, opts) do
7 image = User.avatar_url(user)
8 following = if opts[:for] do
9 User.following?(opts[:for], user)
14 user_info = User.get_cached_user_info(user)
19 "screen_name" => user.nickname,
20 "description" => user.bio,
21 "following" => following,
23 "favourites_count" => 0,
24 "statuses_count" => user_info[:note_count],
25 "friends_count" => user_info[:following_count],
26 "followers_count" => user_info[:follower_count],
27 "profile_image_url" => image,
28 "profile_image_url_https" => image,
29 "profile_image_url_profile_size" => image,
30 "profile_image_url_original" => image,