Display the users avatar if he has one set.

This commit is contained in:
Roger Braun 2017-04-16 15:40:50 +02:00
commit 03a9c11d25
2 changed files with 11 additions and 8 deletions

View file

@ -4,8 +4,10 @@ defmodule Pleroma.Web.TwitterAPI.Representers.UserRepresenter do
alias Pleroma.User
def to_map(user, opts) do
image = "https://placehold.it/48x48"
image = case user.avatar do
%{"url" => [%{"href" => href} | _]} -> href
_ -> "https://placehold.it/48x48"
end
following = if opts[:for] do
User.following?(opts[:for], user)