From fafb765c4808f111a98a307a148f635eb42af891 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 18 Jun 2017 14:43:44 +0200 Subject: [PATCH] Output tags list in TwAPI. --- .../web/twitter_api/representers/activity_representer.ex | 3 ++- .../web/twitter_api/representers/activity_representer_test.exs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex index 6f22e45fa..a36b873e4 100644 --- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex +++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex @@ -118,7 +118,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do "repeat_num" => announcement_count, "favorited" => to_boolean(favorited), "repeated" => to_boolean(repeated), - "external_url" => activity.data["id"] + "external_url" => activity.data["id"], + "tags" => activity.data["object"]["tag"] || [] } end diff --git a/test/web/twitter_api/representers/activity_representer_test.exs b/test/web/twitter_api/representers/activity_representer_test.exs index 022595b91..db5981b58 100644 --- a/test/web/twitter_api/representers/activity_representer_test.exs +++ b/test/web/twitter_api/representers/activity_representer_test.exs @@ -124,7 +124,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "repeat_num" => 3, "favorited" => false, "repeated" => false, - "external_url" => activity.data["id"] + "external_url" => activity.data["id"], + "tags" => ["content", "mentioning", "nsfw"] } assert ActivityRepresenter.to_map(activity, %{user: user, for: follower, mentioned: [mentioned_user]}) == expected_status -- 2.45.2