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.
"""
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