2021-07-29 08:58:29 +00:00
|
|
|
use activitystreams::{base::AnyBase, context, primitives::OneOrMany};
|
2020-11-25 17:44:49 +00:00
|
|
|
use serde_json::json;
|
2021-03-22 12:11:32 +00:00
|
|
|
use url::Url;
|
2020-11-25 17:44:49 +00:00
|
|
|
|
2021-08-17 18:04:58 +00:00
|
|
|
pub(crate) fn lemmy_context() -> OneOrMany<AnyBase> {
|
2020-11-25 17:44:49 +00:00
|
|
|
let context_ext = AnyBase::from_arbitrary_json(json!(
|
|
|
|
{
|
|
|
|
"sc": "http://schema.org#",
|
|
|
|
"sensitive": "as:sensitive",
|
|
|
|
"stickied": "as:stickied",
|
2021-06-07 21:10:47 +00:00
|
|
|
"pt": "https://join-lemmy.org#",
|
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
|
|
|
},
|
2021-03-24 16:43:18 +00:00
|
|
|
"moderators": "as:moderators",
|
|
|
|
"matrixUserId": {
|
|
|
|
"type": "sc:Text",
|
|
|
|
"id": "as:alsoKnownAs"
|
|
|
|
},
|
2021-07-29 08:58:29 +00:00
|
|
|
}))
|
|
|
|
.expect("parse context");
|
|
|
|
OneOrMany::from(vec![
|
2021-03-22 12:11:32 +00:00
|
|
|
AnyBase::from(context()),
|
|
|
|
context_ext,
|
2021-07-29 08:58:29 +00:00
|
|
|
AnyBase::from(Url::parse("https://w3id.org/security/v1").expect("parse context")),
|
2021-03-22 12:11:32 +00:00
|
|
|
])
|
2020-11-25 17:44:49 +00:00
|
|
|
}
|