Use LitePub for user-class in example server

Now that LitePub has its own classes (rather than
modifying those of Activity-Vocabulary), this is
necessary.
This commit is contained in:
Jaidyn Ann 2024-10-21 04:20:54 -05:00
parent 2182eb4ebe
commit 71fa674ce3

View File

@ -16,7 +16,8 @@
(:export :start-server :seed) (:export :start-server :seed)
;; Note that we use a nickname for the ActivityStreams vocab! ;; Note that we use a nickname for the ActivityStreams vocab!
;; I recommend doing likewise; save yourself some typing! ;; I recommend doing likewise; save yourself some typing!
(:local-nicknames (:as :activity-servist/vocab/activity))) (:local-nicknames (:ass :activity-servist/vocab/activity)
(:lp :activity-servist/vocab/litepub)))
(in-package #:activitypub-example) (in-package #:activitypub-example)
@ -115,7 +116,7 @@ Otherwise, assume “https”."
;;; Users ;;; Users
;;; ———————————————————————————————————————— ;;; ————————————————————————————————————————
(defclass user (as:person) (defclass user (ass:person lp:object)
((inbox ((inbox
:accessor user-inbox :accessor user-inbox
:initform nil :initform nil
@ -141,10 +142,10 @@ The ID and ENDPOINTS are derived using the parameter USERNAME and the global *US
(getf *config* :host) username))) (getf *config* :host) username)))
(flet ((sub-uri (path) (flet ((sub-uri (path)
(format nil "~A/~A" uri path))) (format nil "~A/~A" uri path)))
(setf (as:name obj) username) (setf (ass:name obj) username)
(setf (json-ld:@id obj) uri) (setf (json-ld:@id obj) uri)
(setf (as:inbox obj) (sub-uri "inbox")) (setf (ass:inbox obj) (sub-uri "inbox"))
(setf (as:outbox obj) (sub-uri "outbox")) (setf (ass:outbox obj) (sub-uri "outbox"))
(setf (as:following obj) (sub-uri "following")) (setf (ass:following obj) (sub-uri "following"))
(setf (as:followers obj) (sub-uri "followers"))) (setf (ass:followers obj) (sub-uri "followers")))
obj)) obj))