+ def outbox(conn, %{"nickname" => nickname, "max_id" => max_id}) do
+ with %User{} = user <- User.get_cached_by_nickname(nickname),
+ {:ok, user} <- Pleroma.Web.WebFinger.ensure_keys_present(user) do
+ conn
+ |> put_resp_header("content-type", "application/activity+json")
+ |> json(UserView.render("outbox.json", %{user: user, max_id: max_id}))
+ end
+ end
+
+ def outbox(conn, %{"nickname" => nickname}) do
+ outbox(conn, %{"nickname" => nickname, "max_id" => nil})
+ end
+