From 1ccbe562c950e588e24822d20f802dd99b01bd79 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 13 Apr 2017 14:56:19 +0200 Subject: [PATCH] Add actor to objects. --- lib/pleroma/web/twitter_api/twitter_api.ex | 3 ++- test/web/twitter_api/twitter_api_test.exs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 0217b28d6..a195301ee 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -37,7 +37,8 @@ def create_status(user = %User{}, data = %{}) do "content" => content_html, "published" => date, "context" => context, - "attachment" => attachments + "attachment" => attachments, + "actor" => user.ap_id }, "published" => date, "context" => context diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index e8853a910..a4c9bd7e7 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -32,6 +32,7 @@ test "create a status" do assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp." assert get_in(activity.data, ["object", "type"]) == "Note" + assert get_in(activity.data, ["object", "actor"]) == user.ap_id assert get_in(activity.data, ["actor"]) == user.ap_id assert Enum.member?(get_in(activity.data, ["to"]), User.ap_followers(user)) assert Enum.member?(get_in(activity.data, ["to"]), "https://www.w3.org/ns/activitystreams#Public")