Merge branch 'grishka_fix_ld_context'

This commit is contained in:
Felix Ableitner 2021-03-22 13:12:05 +01:00
commit e726d1e184

View file

@ -1,6 +1,7 @@
use activitystreams::{base::AnyBase, context}; use activitystreams::{base::AnyBase, context};
use lemmy_utils::LemmyError; use lemmy_utils::LemmyError;
use serde_json::json; use serde_json::json;
use url::Url;
pub(crate) fn lemmy_context() -> Result<Vec<AnyBase>, LemmyError> { pub(crate) fn lemmy_context() -> Result<Vec<AnyBase>, LemmyError> {
let context_ext = AnyBase::from_arbitrary_json(json!( let context_ext = AnyBase::from_arbitrary_json(json!(
@ -8,10 +9,15 @@ pub(crate) fn lemmy_context() -> Result<Vec<AnyBase>, LemmyError> {
"sc": "http://schema.org#", "sc": "http://schema.org#",
"sensitive": "as:sensitive", "sensitive": "as:sensitive",
"stickied": "as:stickied", "stickied": "as:stickied",
"pt": "https://join.lemmy.ml#",
"comments_enabled": { "comments_enabled": {
"kind": "sc:Boolean", "type": "sc:Boolean",
"id": "pt:commentsEnabled" "id": "pt:commentsEnabled"
} }
}))?; }))?;
Ok(vec![AnyBase::from(context()), context_ext]) Ok(vec![
AnyBase::from(context()),
context_ext,
AnyBase::from(Url::parse("https://w3id.org/security/v1")?),
])
} }