Shared inbox endpoint

This commit is contained in:
Bat
2018-05-13 18:39:18 +01:00
parent 91b19bccb5
commit dfab0290e4
4 changed files with 21 additions and 1 deletions
+9
View File
@@ -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("")
}