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