From: William Pitcock Date: Sun, 27 May 2018 09:10:46 +0000 (+0000) Subject: activitypub transmogrifier: send Rejects in the format Mastodon wants X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f328de8eb77ced729a46e12cbcf898bcfaec78c1;p=akkoma activitypub transmogrifier: send Rejects in the format Mastodon wants --- 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