diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-05-27 09:10:46 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-06-11 22:15:53 +0000 |
commit | f328de8eb77ced729a46e12cbcf898bcfaec78c1 (patch) | |
tree | e8f6a96e758ea962c3295cec254c74c96bcbb01a | |
parent | 876ad6aa380dcc7ef4888fe31f3b7da567d6f490 (diff) | |
download | pleroma-f328de8eb77ced729a46e12cbcf898bcfaec78c1.tar.gz |
activitypub transmogrifier: send Rejects in the format Mastodon wants
-rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 5f5ed7b8e..170bfbc03 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -456,6 +456,26 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end end + def prepare_outgoing(%{"type" => "Reject"} = data) do + with follow_activity <- Activity.get_by_ap_id(data["object"]) do + object = %{ + "actor" => follow_activity.actor, + "object" => follow_activity.data["object"], + "id" => follow_activity.data["id"], + "type" => "Follow" + } + + data = + data + |> Map.put("object", object) + |> Map.put("@context", "https://www.w3.org/ns/activitystreams") + + IO.inspect(data) + + {:ok, data} + end + end + def prepare_outgoing(%{"type" => _type} = data) do data = data |