lemmy/crates/apub/src/extensions/context.rs

19 lines
544 B
Rust
Raw Normal View History

use activitystreams::{base::AnyBase, context};
use lemmy_utils::LemmyError;
use serde_json::json;
pub(crate) fn lemmy_context() -> Result<Vec<AnyBase>, LemmyError> {
let context_ext = AnyBase::from_arbitrary_json(json!(
{
"sc": "http://schema.org#",
"sensitive": "as:sensitive",
"stickied": "as:stickied",
2021-03-21 01:03:53 +00:00
"pt": "https://join.lemmy.ml#",
"comments_enabled": {
2021-03-21 01:00:32 +00:00
"type": "sc:Boolean",
"id": "pt:commentsEnabled"
}
}))?;
2021-03-21 01:00:32 +00:00
Ok(vec![AnyBase::from(context()), context_ext, "https://w3id.org/security/v1"])
}