- # based on Pleroma.Web.ActivityPub.Utils.lazy_put_objects_defaults
- defp fix_defaults(data) do
- %{data: %{"id" => context}, id: context_id} = Utils.create_context(data["context"])
-
- data
- |> Map.put_new_lazy("id", &Utils.generate_object_id/0)
- |> Map.put_new_lazy("published", &Utils.make_date/0)
- |> Map.put_new("context", context)
- |> Map.put_new("context_id", context_id)
- end
-