From 0f2ad25a7b1125c1e945d474a1873773fdfee26a Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 17 Feb 2018 20:47:45 +0100 Subject: [PATCH] AcitvityPub: Outgoing Announces. --- lib/pleroma/web/activity_pub/transmogrifier.ex | 2 +- lib/pleroma/web/activity_pub/views/object_view.ex | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index b5a126cb6..c1d7cb3ae 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -96,7 +96,7 @@ def prepare_outgoing(%{"type" => "Create", "object" => %{"type" => "Note"} = obj {:ok, data} end - def prepare_outgoing(%{"type" => type} = data) when type in ["Follow", "Accept", "Like"] do + def prepare_outgoing(%{"type" => type} = data) when type in ["Follow", "Accept", "Like", "Announce"] do data = data |> Map.put("@context", "https://www.w3.org/ns/activitystreams") diff --git a/lib/pleroma/web/activity_pub/views/object_view.ex b/lib/pleroma/web/activity_pub/views/object_view.ex index 403f8cb17..c39f99454 100644 --- a/lib/pleroma/web/activity_pub/views/object_view.ex +++ b/lib/pleroma/web/activity_pub/views/object_view.ex @@ -21,6 +21,7 @@ def render("object.json", %{object: object}) do } additional = Map.take(object.data, ["id", "to", "cc", "actor", "content", "summary", "type"]) + |> Map.put("attributedTo", object.data["actor"]) Map.merge(base, additional) end end