From ff007af0c2f229fa20cd4b83b94de89cd9fce29c Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 20 May 2018 18:01:24 +0200 Subject: [PATCH] Return visilility in twitter api, too. --- lib/pleroma/web/twitter_api/views/activity_view.ex | 3 ++- test/web/twitter_api/views/activity_view_test.exs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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