akkoma/lib/pleroma/web/twitter_api/representers/activity_representer.ex

18 lines
525 B
Elixir
Raw Normal View History

2017-03-21 10:53:20 -06:00
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
alias Pleroma.Web.TwitterAPI.Representers.UserRepresenter
def to_map(activity, %{user: user}) do
content = get_in(activity.data, ["object", "content"])
%{
"id" => activity.id,
"user" => UserRepresenter.to_map(user),
"attentions" => [],
"statusnet_html" => content,
"text" => content,
"is_local" => true,
"is_post_verb" => true
}
end
end