diff options
Diffstat (limited to 'lib/pleroma/web/twitter_api/representers/activity_representer.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/representers/activity_representer.ex | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex index bc3de0e90..321917e83 100644 --- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex +++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex @@ -96,6 +96,24 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do } end + def to_map(%Activity{data: %{"type" => "Delete", "published" => created_at, "object" => deleted_object }} = activity, %{user: user} = opts) do + created_at = created_at |> Utils.date_to_asctime + + %{ + "id" => activity.data["object"], + "user" => UserView.render("show.json", %{user: user, for: opts[:for]}), + "attentions" => [], + "statusnet_html" => "deleted notice {{tag", + "text" => "deleted notice {{tag" , + "is_local" => activity.local, + "is_post_verb" => false, + "created_at" => created_at, + "in_reply_to_status_id" => nil, + "external_url" => activity.data["id"], + "activity_type" => "delete" + } + end + def to_map(%Activity{data: %{"object" => %{"content" => content} = object}} = activity, %{user: user} = opts) do created_at = object["published"] |> Utils.date_to_asctime like_count = object["like_count"] || 0 |