qb_akkoma/lib/pleroma/web/activity_pub/activity_pub_controller.ex
2017-12-11 10:37:22 +01:00

17 lines
513 B
Elixir

defmodule Pleroma.Web.ActivityPub.ActivityPubController do
use Pleroma.Web, :controller
alias Pleroma.{User, Repo}
alias Pleroma.Web.ActivityPub.UserView
alias Pleroma.Web.ActivityPub.ActivityPub
def user(conn, %{"nickname" => nickname}) do
with %User{} = user <- User.get_cached_by_nickname(nickname) do
json(conn, UserView.render("user.json", %{user: user}))
end
end
def inbox(conn, params) do
{:ok, activity} = ActivityPub.insert(params, false)
json(conn, "ok")
end
end