1718781625f7c55b92f21f92e21cb13e7473e4c3
[akkoma] / lib / pleroma / web / twitter_api / representers / activity_representer.ex
1 defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
2 use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
3 alias Pleroma.Web.TwitterAPI.Representers.UserRepresenter
4 alias Pleroma.Activity
5
6 def to_map(%Activity{} = activity, %{user: user}) do
7 content = get_in(activity.data, ["object", "content"])
8 published = get_in(activity.data, ["object", "published"])
9 %{
10 "id" => activity.id,
11 "user" => UserRepresenter.to_map(user),
12 "attentions" => [],
13 "statusnet_html" => content,
14 "text" => content,
15 "is_local" => true,
16 "is_post_verb" => true,
17 "created_at" => published
18 }
19 end
20 end