use crate::{
fetcher::{fetch::fetch_remote_object, is_deleted, should_refetch_actor},
- objects::FromApub,
- PersonExt,
+ objects::{person::Person as ApubPerson, FromApub},
};
use anyhow::anyhow;
use diesel::result::Error::NotFound;
Ok(u) if !u.local && should_refetch_actor(u.last_refreshed_at) => {
debug!("Fetching and updating from remote person: {}", apub_id);
let person =
- fetch_remote_object::<PersonExt>(context.client(), apub_id, recursion_counter).await;
+ fetch_remote_object::<ApubPerson>(context.client(), apub_id, recursion_counter).await;
if is_deleted(&person) {
// TODO: use Person::update_deleted() once implemented
return Ok(u);
}
- let person = Person::from_apub(
- &person?,
- context,
- apub_id.to_owned(),
- recursion_counter,
- false,
- )
- .await?;
+ let person = Person::from_apub(&person?, context, apub_id, recursion_counter).await?;
let person_id = person.id;
blocking(context.pool(), move |conn| {
Err(NotFound {}) => {
debug!("Fetching and creating remote person: {}", apub_id);
let person =
- fetch_remote_object::<PersonExt>(context.client(), apub_id, recursion_counter).await?;
+ fetch_remote_object::<ApubPerson>(context.client(), apub_id, recursion_counter).await?;
- let person = Person::from_apub(
- &person,
- context,
- apub_id.to_owned(),
- recursion_counter,
- false,
- )
- .await?;
+ let person = Person::from_apub(&person, context, apub_id, recursion_counter).await?;
Ok(person)
}