akkoma/lib/pleroma/web/activity_pub/activity_pub_controller.ex

18 lines
513 B
Elixir
Raw Normal View History

2017-12-11 02:37:22 -07:00
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