[Pleroma.Web.ActivityPub.Transmogrifier] Add Person finding

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-07-12 23:25:44 +02:00
parent 8472fba2a7
commit 7501481db4
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE

View File

@ -21,6 +21,11 @@ def get_actor(%{"actor" => actor}) when is_list(actor) do
Enum.at(actor, 0)
end
def get_actor(%{"actor" => actor_list}) do
Enum.find(actor_list, fn %{"type" => type} -> type == "Person" end)
|> Map.get("id")
end
@doc """
Modifies an incoming AP object (mastodon format) to our internal format.
"""