Return visilility in twitter api, too.

This commit is contained in:
lain 2018-05-20 18:01:24 +02:00
parent 434601a5c3
commit ff007af0c2
2 changed files with 5 additions and 3 deletions

View File

@ -262,7 +262,8 @@ def render(
"external_url" => object["external_url"] || object["id"], "external_url" => object["external_url"] || object["id"],
"tags" => tags, "tags" => tags,
"activity_type" => "post", "activity_type" => "post",
"possibly_sensitive" => possibly_sensitive "possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object)
} }
end end
end end

View File

@ -18,7 +18,7 @@ test "a create activity with a note" do
user = insert(:user) user = insert(:user)
other_user = insert(:user, %{nickname: "shp"}) other_user = insert(:user, %{nickname: "shp"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "Hey @shp!"}) {:ok, activity} = CommonAPI.post(user, %{"status" => "Hey @shp!", "visibility" => "direct"})
result = ActivityView.render("activity.json", activity: activity) result = ActivityView.render("activity.json", activity: activity)
@ -47,7 +47,8 @@ test "a create activity with a note" do
"tags" => [], "tags" => [],
"text" => "Hey @shp!", "text" => "Hey @shp!",
"uri" => activity.data["object"]["id"], "uri" => activity.data["object"]["id"],
"user" => UserView.render("show.json", %{user: user}) "user" => UserView.render("show.json", %{user: user}),
"visibility" => "direct"
} }
assert result == expected assert result == expected