From: lain Date: Sun, 20 May 2018 16:01:24 +0000 (+0200) Subject: Return visilility in twitter api, too. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=ff007af0c2f229fa20cd4b83b94de89cd9fce29c;p=akkoma Return visilility in twitter api, too. --- diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex index 580d4648c..62ce3b7b5 100644 --- a/lib/pleroma/web/twitter_api/views/activity_view.ex +++ b/lib/pleroma/web/twitter_api/views/activity_view.ex @@ -262,7 +262,8 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do "external_url" => object["external_url"] || object["id"], "tags" => tags, "activity_type" => "post", - "possibly_sensitive" => possibly_sensitive + "possibly_sensitive" => possibly_sensitive, + "visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object) } end end diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs index 7f2017d3c..5b2a7466b 100644 --- a/test/web/twitter_api/views/activity_view_test.exs +++ b/test/web/twitter_api/views/activity_view_test.exs @@ -18,7 +18,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do user = insert(:user) 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) @@ -47,7 +47,8 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do "tags" => [], "text" => "Hey @shp!", "uri" => activity.data["object"]["id"], - "user" => UserView.render("show.json", %{user: user}) + "user" => UserView.render("show.json", %{user: user}), + "visibility" => "direct" } assert result == expected