Add basic Ostatus user representer.
This commit is contained in:
parent
ce6cc84a4a
commit
36e883cd4b
4 changed files with 39 additions and 5 deletions
|
|
@ -18,6 +18,13 @@ defmodule Pleroma.User do
|
|||
timestamps()
|
||||
end
|
||||
|
||||
def avatar_url(user) do
|
||||
case user.avatar do
|
||||
%{"url" => [%{"href" => href} | _]} -> href
|
||||
_ -> "https://placehold.it/48x48"
|
||||
end
|
||||
end
|
||||
|
||||
def ap_id(%User{nickname: nickname}) do
|
||||
"#{Pleroma.Web.base_url}/users/#{nickname}"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue