mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 02:49:18 +00:00
Output tags list in TwAPI.
This commit is contained in:
parent
8feec8d390
commit
fafb765c48
|
@ -118,7 +118,8 @@ def to_map(%Activity{data: %{"object" => %{"content" => content} = object}} = ac
|
||||||
"repeat_num" => announcement_count,
|
"repeat_num" => announcement_count,
|
||||||
"favorited" => to_boolean(favorited),
|
"favorited" => to_boolean(favorited),
|
||||||
"repeated" => to_boolean(repeated),
|
"repeated" => to_boolean(repeated),
|
||||||
"external_url" => activity.data["id"]
|
"external_url" => activity.data["id"],
|
||||||
|
"tags" => activity.data["object"]["tag"] || []
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,8 @@ test "an activity" do
|
||||||
"repeat_num" => 3,
|
"repeat_num" => 3,
|
||||||
"favorited" => false,
|
"favorited" => false,
|
||||||
"repeated" => 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
|
assert ActivityRepresenter.to_map(activity, %{user: user, for: follower, mentioned: [mentioned_user]}) == expected_status
|
||||||
|
|
Loading…
Reference in a new issue