diff --git a/apb/src/types/object/mod.rs b/apb/src/types/object/mod.rs index 9f829c13..d439c5d9 100644 --- a/apb/src/types/object/mod.rs +++ b/apb/src/types/object/mod.rs @@ -72,6 +72,8 @@ pub trait Object : Base { #[cfg(feature = "activitypub-miscellaneous-terms")] fn sensitive(&self) -> Option { None } + #[cfg(feature = "activitypub-miscellaneous-terms")] + fn quote_url(&self) -> Node { Node::Empty } #[cfg(feature = "activitypub-fe")] fn liked_by_me(&self) -> Option { None } @@ -121,6 +123,8 @@ pub trait ObjectMut : BaseMut { #[cfg(feature = "activitypub-miscellaneous-terms")] fn set_sensitive(self, val: Option) -> Self; + #[cfg(feature = "activitypub-miscellaneous-terms")] + fn set_quote_url(self, val: Node) -> Self; #[cfg(feature = "activitypub-fe")] fn set_liked_by_me(self, val: Option) -> Self; @@ -166,6 +170,8 @@ impl Object for serde_json::Value { #[cfg(feature = "activitypub-miscellaneous-terms")] crate::getter! { sensitive -> bool } + #[cfg(feature = "activitypub-miscellaneous-terms")] + crate::getter! { quote_url::quoteUrl -> node ::Object } #[cfg(feature = "activitypub-fe")] crate::getter! { liked_by_me::likedByMe -> bool } @@ -250,6 +256,8 @@ impl ObjectMut for serde_json::Value { #[cfg(feature = "activitypub-miscellaneous-terms")] crate::setter! { sensitive -> bool } + #[cfg(feature = "activitypub-miscellaneous-terms")] + crate::setter! { quote_url::quoteUrl -> node ::Object } #[cfg(feature = "activitypub-fe")] crate::setter! { liked_by_me::likedByMe -> bool } diff --git a/src/routes/activitypub/jsonld.rs b/src/routes/activitypub/jsonld.rs index 0c2188e1..d9e2b543 100644 --- a/src/routes/activitypub/jsonld.rs +++ b/src/routes/activitypub/jsonld.rs @@ -19,6 +19,7 @@ impl LD for serde_json::Value { if let Some(obj) = self.as_object_mut() { let mut ctx = serde_json::Map::new(); ctx.insert("sensitive".to_string(), serde_json::Value::String("as:sensitive".into())); + ctx.insert("quoteUrl".to_string(), serde_json::Value::String("as:quoteUrl".into())); match o_type { Some(apb::ObjectType::Actor(_)) => { ctx.insert("counters".to_string(), serde_json::Value::String("https://ns.alemi.dev/as/counters/#".into()));