1 defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
2 use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
3 alias Pleroma.Web.TwitterAPI.Representers.{UserRepresenter, ObjectRepresenter}
6 def to_map(%Activity{} = activity, %{user: user} = opts) do
7 content = get_in(activity.data, ["object", "content"])
8 published = get_in(activity.data, ["object", "published"])
11 "user" => UserRepresenter.to_map(user, opts),
13 "statusnet_html" => content,
16 "is_post_verb" => true,
17 "created_at" => published,
18 "in_reply_to_status_id" => activity.data["object"]["inReplyToStatusId"],
19 "statusnet_conversation_id" => activity.data["object"]["statusnetConversationId"],
20 "attachments" => (activity.data["object"]["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts)