Add actor to objects.

This commit is contained in:
Roger Braun 2017-04-13 14:56:19 +02:00
parent d2bf099ae6
commit 1ccbe562c9
2 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,8 @@ def create_status(user = %User{}, data = %{}) do
"content" => content_html, "content" => content_html,
"published" => date, "published" => date,
"context" => context, "context" => context,
"attachment" => attachments "attachment" => attachments,
"actor" => user.ap_id
}, },
"published" => date, "published" => date,
"context" => context "context" => context

View File

@ -32,6 +32,7 @@ test "create a status" do
assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>." assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>."
assert get_in(activity.data, ["object", "type"]) == "Note" 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 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"]), User.ap_followers(user))
assert Enum.member?(get_in(activity.data, ["to"]), "https://www.w3.org/ns/activitystreams#Public") assert Enum.member?(get_in(activity.data, ["to"]), "https://www.w3.org/ns/activitystreams#Public")