mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-24 05:11:18 +00:00
Nutomic
28d6370c35
* Limit type/method visibility in apub code * Simplify db_queries traits by removing generics * Simplify delete activity implementation * Rewrite delete activities * Implement helper functions for websocket message sending * When receiving delete reason as empty string, change to none
28 lines
765 B
Rust
28 lines
765 B
Rust
use activitystreams::{base::AnyBase, context, primitives::OneOrMany};
|
|
use serde_json::json;
|
|
use url::Url;
|
|
|
|
pub(crate) fn lemmy_context() -> OneOrMany<AnyBase> {
|
|
let context_ext = AnyBase::from_arbitrary_json(json!(
|
|
{
|
|
"sc": "http://schema.org#",
|
|
"sensitive": "as:sensitive",
|
|
"stickied": "as:stickied",
|
|
"pt": "https://join-lemmy.org#",
|
|
"comments_enabled": {
|
|
"type": "sc:Boolean",
|
|
"id": "pt:commentsEnabled"
|
|
},
|
|
"moderators": "as:moderators",
|
|
"matrixUserId": {
|
|
"type": "sc:Text",
|
|
"id": "as:alsoKnownAs"
|
|
},
|
|
}))
|
|
.expect("parse context");
|
|
OneOrMany::from(vec![
|
|
AnyBase::from(context()),
|
|
context_ext,
|
|
AnyBase::from(Url::parse("https://w3id.org/security/v1").expect("parse context")),
|
|
])
|
|
}
|