X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Ftransmogrifier.ex;h=aece77a5401fbe71177e1a2c584ee00163aefeba;hb=c739737998538632f595c03fcedbdb5178ad83b6;hp=7bdb9594a0c390a3dc3e1515b03c981a6c8356d3;hpb=e53da692fbdae3bcf9a7d528bf0d6bd170669052;p=akkoma diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 7bdb9594a..aece77a54 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -30,6 +30,10 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do id end + def get_actor(%{"actor" => nil, "attributedTo" => actor}) when not is_nil(actor) do + get_actor(%{"actor" => actor}) + end + @doc """ Checks that an imported AP object's actor matches the domain it came from. """ @@ -159,12 +163,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end def fix_attachments(%{"attachment" => attachment} = object) when is_map(attachment) do - attachment = - Map.put(attachment, "url", [ - %{"type" => "Link", "mediaType" => attachment["mediaType"], "href" => attachment["url"]} - ]) - - Map.put(object, "attachment", attachment) + Map.put(object, "attachment", [attachment]) + |> fix_attachments() end def fix_attachments(object), do: object