User outbox

This commit is contained in:
Bat
2018-04-29 19:01:42 +01:00
parent e592e692ff
commit 80472506ca
3 changed files with 18 additions and 0 deletions
+10
View File
@@ -3,7 +3,9 @@ use diesel::{self, QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection};
use rocket::request::{self, FromRequest, Request};
use rocket::outcome::IntoOutcome;
use activity_pub::activity::Activity;
use activity_pub::actor::{ActorType, Actor};
use activity_pub::outbox::Outbox;
use activity_pub::webfinger::Webfinger;
use db_conn::DbConn;
use models::instance::Instance;
@@ -94,6 +96,14 @@ impl User {
.get_result::<User>(conn).expect("Couldn't update outbox URL");
}
}
pub fn outbox(&self, conn: &PgConnection) -> Outbox {
Outbox::new(self.compute_outbox(conn), self.get_activities())
}
fn get_activities(&self) -> Vec<Activity> {
vec![]
}
}
impl<'a, 'r> FromRequest<'a, 'r> for User {