nulla/lib/nulla_web/controllers/inbox_controller.ex
2025-06-08 10:58:48 +02:00

25 lines
643 B
Elixir

defmodule NullaWeb.InboxController do
use NullaWeb, :controller
def receive(conn, %{"type" => "Follow"} = activity) do
# Check signature
# Verify actor and object
# Save follow to db
# Send Accept or Reject
json(conn, %{"status" => "Follow received"})
end
def receive(conn, %{"type" => "Like"} = activity) do
# Process Like
json(conn, %{"status" => "Like received"})
end
def receive(conn, %{"type" => "Create"} = activity) do
# Create object and save
json(conn, %{"status" => "Object created"})
end
def receive(conn, _params) do
json(conn, %{"status" => "Unhandled type"})
end
end