- # 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["conversation"])
-
- data
- |> Map.put_new_lazy("published", &Utils.make_date/0)
- |> Map.put_new("context", context)
- |> Map.put_new("context_id", context_id)
- end
-
- defp fix_attribution(data) do
- data
- |> Map.put_new("actor", data["attributedTo"])
- end
-