Shared inbox endpoint
This commit is contained in:
@@ -4,6 +4,7 @@ use rocket_contrib::Template;
|
||||
use serde_json;
|
||||
|
||||
use BASE_URL;
|
||||
use activity_pub::inbox::Inbox;
|
||||
use db_conn::DbConn;
|
||||
use models::posts::Post;
|
||||
use models::users::User;
|
||||
@@ -65,3 +66,11 @@ fn post_config(conn: DbConn, data: Form<NewInstanceForm>) -> Redirect {
|
||||
Redirect::to("/users/new")
|
||||
}
|
||||
}
|
||||
|
||||
#[post("/inbox", data = "<data>")]
|
||||
fn shared_inbox(conn: DbConn, data: String) -> String {
|
||||
let act: serde_json::Value = serde_json::from_str(&data[..]).unwrap();
|
||||
let instance = Instance::get_local(&*conn).unwrap();
|
||||
instance.received(&*conn, act);
|
||||
String::from("")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user