]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/http/person.rs
Federation tests replication round1 - demonstrate absent replication of comment delet...
[lemmy.git] / crates / apub / src / http / person.rs
index 79696660ce5bc8e2b8b9ac4a96a304446b8c8949..2543136348dd185e858be07cbf53932676f3ab48 100644 (file)
@@ -1,5 +1,5 @@
 use crate::{
-  activity_lists::PersonInboxActivitiesWithAnnouncable,
+  activity_lists::PersonInboxActivities,
   fetcher::user_or_community::UserOrCommunity,
   http::{create_apub_response, create_apub_tombstone_response},
   objects::person::ApubPerson,
@@ -30,16 +30,16 @@ pub(crate) async fn get_apub_person_http(
 ) -> Result<HttpResponse, LemmyError> {
   let user_name = info.into_inner().user_name;
   // TODO: this needs to be able to read deleted persons, so that it can send tombstones
-  let person: ApubPerson = Person::read_from_name(context.pool(), &user_name, true)
+  let person: ApubPerson = Person::read_from_name(&mut context.pool(), &user_name, true)
     .await?
     .into();
 
   if !person.deleted {
     let apub = person.into_json(&context).await?;
 
-    Ok(create_apub_response(&apub))
+    create_apub_response(&apub)
   } else {
-    Ok(create_apub_tombstone_response(person.actor_id.clone()))
+    create_apub_tombstone_response(person.actor_id.clone())
   }
 }
 
@@ -49,7 +49,7 @@ pub async fn person_inbox(
   body: Bytes,
   data: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
-  receive_activity::<WithContext<PersonInboxActivitiesWithAnnouncable>, UserOrCommunity, LemmyContext>(
+  receive_activity::<WithContext<PersonInboxActivities>, UserOrCommunity, LemmyContext>(
     request, body, &data,
   )
   .await
@@ -60,8 +60,8 @@ pub(crate) async fn get_apub_person_outbox(
   info: web::Path<PersonQuery>,
   context: Data<LemmyContext>,
 ) -> Result<HttpResponse, LemmyError> {
-  let person = Person::read_from_name(context.pool(), &info.user_name, false).await?;
+  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)?;
-  Ok(create_apub_response(&outbox))
+  create_apub_response(&outbox)
 }