Verified Commit ef4f982e authored by Haelwenn's avatar Haelwenn

Pleroma.Web.ActivityPub.Transmogrifier: Fix actor being a list of objects (Peertube)

parent c1b8a6a7
......@@ -18,18 +18,18 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
end
def get_actor(%{"actor" => actor}) when is_list(actor) do
Enum.at(actor, 0)
if is_binary(Enum.at(actor, 0)) do
Enum.at(actor, 0)
else
Enum.find(actor, fn %{"type" => type} -> type == "Person" end)
|> Map.get("id")
end
end
def get_actor(%{"actor" => actor}) when is_map(actor) do
actor["id"]
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.
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment