Commit fafb765c authored by lain's avatar lain
Browse files

Output tags list in TwAPI.

parent 8feec8d3
......@@ -118,7 +118,8 @@ def to_map(%Activity{data: %{"object" => %{"content" => content} = object}} = ac
"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
......
......@@ -124,7 +124,8 @@ test "an activity" 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment