akkoma/lib/pleroma/web/ostatus/user_representer.ex

16 lines
461 B
Elixir
Raw Normal View History

2017-04-17 12:12:36 +00:00
defmodule Pleroma.Web.OStatus.UserRepresenter do
alias Pleroma.User
2017-04-18 16:41:51 +00:00
def to_simple_form(user) do
ap_id = to_charlist(user.ap_id)
nickname = to_charlist(user.nickname)
avatar_url = to_charlist(User.avatar_url(user))
[
{ :id, [ap_id] },
{ :"activity:object", ['http://activitystrea.ms/schema/1.0/person'] },
{ :uri, [ap_id] },
{ :name, [nickname] },
{ :link, [rel: 'avatar', href: avatar_url], []}
]
2017-04-17 12:12:36 +00:00
end
end