Output tags list in TwAPI.
authorRoger Braun <roger@rogerbraun.net>
Sun, 18 Jun 2017 12:43:44 +0000 (14:43 +0200)
committerRoger Braun <roger@rogerbraun.net>
Sun, 18 Jun 2017 12:43:44 +0000 (14:43 +0200)
lib/pleroma/web/twitter_api/representers/activity_representer.ex
test/web/twitter_api/representers/activity_representer_test.exs

index 6f22e45faf048ad8b2cb1ce4e09b79cc11ecf23b..a36b873e411d21a2f2cd9b26b02fc1750bb294bd 100644 (file)
@@ -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
 
index 022595b915a5d93e2391815b01a185acfc21b458..db5981b5812b54dcd25a9eeaa1017bcc02d898ca 100644 (file)
@@ -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