Return visilility in twitter api, too.
authorlain <lain@soykaf.club>
Sun, 20 May 2018 16:01:24 +0000 (18:01 +0200)
committerlain <lain@soykaf.club>
Sun, 20 May 2018 16:01:24 +0000 (18:01 +0200)
lib/pleroma/web/twitter_api/views/activity_view.ex
test/web/twitter_api/views/activity_view_test.exs

index 580d4648cfd59f3d7bdea948faf73ad8e89bc31d..62ce3b7b5d0d152c1558099f13ee270f63ed68c0 100644 (file)
@@ -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
index 7f2017d3cf6fed72652c23dfc73ca49ede55463f..5b2a7466bd6011bb79257ffd749490146b2b8bf4 100644 (file)
@@ -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