- context: web::Data<LemmyContext>,
-) -> Result<HttpResponse<Body>, LemmyError> {
- let person = blocking(context.pool(), move |conn| {
- Person::find_by_name(conn, &info.user_name)
- })
- .await??;
- // TODO: populate the person outbox
- let mut collection = OrderedCollection::new();
- collection
- .set_many_items(Vec::<Url>::new())
- .set_many_contexts(lemmy_context()?)
- .set_id(person.get_outbox_url()?)
- .set_total_items(0_u64);
- Ok(create_apub_response(&collection))
-}
-
-pub(crate) async fn get_apub_person_inbox(
- info: web::Path<PersonQuery>,
- context: web::Data<LemmyContext>,
-) -> Result<HttpResponse<Body>, LemmyError> {
- let person = blocking(context.pool(), move |conn| {
- Person::find_by_name(conn, &info.user_name)
- })
- .await??;
-
- let mut collection = OrderedCollection::new();
- collection
- .set_id(person.inbox_url.into())
- .set_many_contexts(lemmy_context()?);
- Ok(create_apub_response(&collection))
+ context: Data<LemmyContext>,
+) -> Result<HttpResponse, LemmyError> {
+ let person = Person::read_from_name(&mut context.pool(), &info.user_name, false).await?;
+ let outbox_id = generate_outbox_url(&person.actor_id)?.into();
+ let outbox = EmptyOutbox::new(outbox_id)?;
+ create_apub_response(&outbox)