diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 5c96bf060..742dcb385 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -919,9 +919,13 @@ def add_attributed_to(object) do end def prepare_attachments(object) do + attachments = case Map.get(object, "attachment", []) do + [_ | _] = list -> list + _ -> [] + end + attachments = - object - |> Map.get("attachment", []) + attachments |> Enum.map(fn data -> [%{"mediaType" => media_type, "href" => href} = url | _] = data["url"]