Tweak Litepub package to define LP:PERSON
… and switch DEFCONSTANT→DEFVAR for +NEW-CLASSES+ & +NEW-SLOTS+.
This commit is contained in:
parent
a84872309c
commit
b05f9e765e
|
@ -39,15 +39,13 @@ canonical URL for it. This URI will be used in encoded LITEPUB:OBJECTs in the
|
||||||
@CONTEXT.
|
@CONTEXT.
|
||||||
Defaults to a copy at jam.xwx.moe — because why not? ¯\_(ツ)_/¯")
|
Defaults to a copy at jam.xwx.moe — because why not? ¯\_(ツ)_/¯")
|
||||||
|
|
||||||
(unless +new-classes+
|
(defvar +new-classes+ '(chat-message emoji emoji-react hashtag property-value)
|
||||||
(defconstant +new-classes+ '(chat-message emoji emoji-react hashtag property-value)
|
|
||||||
"Simple list of classes/JSON types defined in this package.
|
"Simple list of classes/JSON types defined in this package.
|
||||||
Used by our overloaded JSON-LD:@CONTEXT to help choose the appropriate JSON-LD context."))
|
Used by our overloaded JSON-LD:@CONTEXT to help choose the appropriate JSON-LD context.")
|
||||||
|
|
||||||
;; This isn’t pretty… but it helps us avoid bringing in another dependency! :^)
|
;; This isn’t pretty… but it helps us avoid bringing in another dependency! :^)
|
||||||
;; (closer-mop, that is.)
|
;; (closer-mop, that is.)
|
||||||
(unless +new-slots+
|
(defvar +new-slots+
|
||||||
(defconstant +new-slots+
|
|
||||||
'(atom-uri sensitivep non-anonymous direct-message-p former-representations
|
'(atom-uri sensitivep non-anonymous direct-message-p former-representations
|
||||||
public-key discoverablep manually-approves-followers-p also-known-as
|
public-key discoverablep manually-approves-followers-p also-known-as
|
||||||
capabilities ; Object ←↑
|
capabilities ; Object ←↑
|
||||||
|
@ -56,7 +54,7 @@ Used by our overloaded JSON-LD:@CONTEXT to help choose the appropriate JSON-LD c
|
||||||
quote-url quote-uri) ; Note
|
quote-url quote-uri) ; Note
|
||||||
"List of slots added to subclasses corresponding AS/VOCAB/ACTIVITY classes.
|
"List of slots added to subclasses corresponding AS/VOCAB/ACTIVITY classes.
|
||||||
For example, slots in our OBJECT that aren’t in AS/V/A:OBJECT.
|
For example, slots in our OBJECT that aren’t in AS/V/A:OBJECT.
|
||||||
Used by our overloaded JSON-LD:@CONTEXT to help choose the appropriate JSON-LD context."))
|
Used by our overloaded JSON-LD:@CONTEXT to help choose the appropriate JSON-LD context.")
|
||||||
|
|
||||||
|
|
||||||
;;; Core types
|
;;; Core types
|
||||||
|
@ -117,6 +115,12 @@ One known capabilitity-name is Pleroma’s “acceptsChatMessages”.")))
|
||||||
(call-next-method)))))
|
(call-next-method)))))
|
||||||
|
|
||||||
|
|
||||||
|
;; We want our new Actor-specific slots to take effect.
|
||||||
|
(json-ld:define-json-type (person "Person") (as/v/a:actor object) *litepub-uri*
|
||||||
|
()
|
||||||
|
(:documentation "Represents an individual person."))
|
||||||
|
|
||||||
|
|
||||||
(json-ld:define-json-type (activity "Activity") (as/v/a:activity object) *litepub-uri*
|
(json-ld:define-json-type (activity "Activity") (as/v/a:activity object) *litepub-uri*
|
||||||
(;; https://blog.dereferenced.org/leveraging-json-ld-compound-typing-for-behavioural-hinting-in-activitypub
|
(;; https://blog.dereferenced.org/leveraging-json-ld-compound-typing-for-behavioural-hinting-in-activitypub
|
||||||
(invisiblep
|
(invisiblep
|
||||||
|
|
Ŝarĝante…
Reference in New Issue