Provisionally use global URIs for some endpoints

In the simple-server, use `/inbox` instead of
`/user/inbox`, etc.
This commit is contained in:
Jaidyn Ann 2024-12-09 22:26:50 -06:00
parent 380bc3f525
commit 258315b0d7

View File

@ -150,13 +150,15 @@ The ID and ENDPOINTS are derived using the parameter USERNAME and the global *US
(let ((obj (make-instance 'user))
(uri (format nil *user-id-format*
(getf *config* :host) username)))
(flet ((sub-uri (path)
(format nil "~A/~A" uri path)))
(flet ((sub-user-uri (path)
(format nil "~A/~A" uri path))
(sub-host-uri (path)
(format nil "~A/~A" (getf *config* :host) path)))
(setf (ass:preferred-username obj) username)
(setf (ass:name obj) nickname)
(setf (ass:inbox obj) (sub-uri "inbox"))
(setf (ass:outbox obj) (sub-uri "outbox"))
(setf (ass:following obj) (sub-uri "following"))
(setf (ass:followers obj) (sub-uri "followers"))
(setf (ass:inbox obj) (sub-host-uri "inbox"))
(setf (ass:outbox obj) (sub-host-uri "outbox"))
(setf (ass:following obj) (sub-user-uri "following"))
(setf (ass:followers obj) (sub-user-uri "followers"))
(setf (json-ld:@id obj) uri))
obj))