summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/representers/activity_representer.ex
blob: 32871c0deb3303961549c97b99a7030dd7029431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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