2020-11-25 17:44:49 +00:00
|
|
|
use activitystreams::{base::AnyBase, context};
|
|
|
|
use lemmy_utils::LemmyError;
|
|
|
|
use serde_json::json;
|
2021-03-22 12:11:32 +00:00
|
|
|
use url::Url;
|
2020-11-25 17:44:49 +00:00
|
|
|
|
|
|
|
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#",
|
2020-11-25 17:44:49 +00:00
|
|
|
"comments_enabled": {
|
2021-03-21 01:00:32 +00:00
|
|
|
"type": "sc:Boolean",
|
2021-03-02 16:12:45 +00:00
|
|
|
"id": "pt:commentsEnabled"
|
2021-03-05 13:45:30 +00:00
|
|
|
},
|
|
|
|
"moderators": "as:moderators"
|
2020-11-25 17:44:49 +00:00
|
|
|
}))?;
|
2021-03-22 12:11:32 +00:00
|
|
|
Ok(vec![
|
|
|
|
AnyBase::from(context()),
|
|
|
|
context_ext,
|
|
|
|
AnyBase::from(Url::parse("https://w3id.org/security/v1")?),
|
|
|
|
])
|
2020-11-25 17:44:49 +00:00
|
|
|
}
|