mirror of https://github.com/LemmyNet/lemmy.git
Removing the conditioned site return.
parent
2b2c026ad0
commit
36e84f4102
|
@ -567,7 +567,7 @@ pub fn check_private_instance_and_federation_enabled(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the site for an actor_id, but don't include it if its a local actor.
|
/// Read the site for an actor_id.
|
||||||
///
|
///
|
||||||
/// Used for GetCommunityResponse and GetPersonDetails
|
/// Used for GetCommunityResponse and GetPersonDetails
|
||||||
pub async fn read_site_for_actor(
|
pub async fn read_site_for_actor(
|
||||||
|
@ -576,18 +576,8 @@ pub async fn read_site_for_actor(
|
||||||
) -> Result<Option<Site>, LemmyError> {
|
) -> Result<Option<Site>, LemmyError> {
|
||||||
let site_id = Site::instance_actor_id_from_url(actor_id.clone().into());
|
let site_id = Site::instance_actor_id_from_url(actor_id.clone().into());
|
||||||
let site = Site::read_from_apub_id(&mut context.pool(), &site_id.into()).await?;
|
let site = Site::read_from_apub_id(&mut context.pool(), &site_id.into()).await?;
|
||||||
// no need to include metadata for local site (its already available through other endpoints).
|
|
||||||
// this also prevents us from leaking the federation private key.
|
|
||||||
if let Some(s) = &site {
|
|
||||||
if s.actor_id.domain() == Some(context.settings().hostname.as_ref()) {
|
|
||||||
Ok(None)
|
|
||||||
} else {
|
|
||||||
Ok(site)
|
Ok(site)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Ok(site)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn purge_image_posts_for_person(
|
pub async fn purge_image_posts_for_person(
|
||||||
banned_person_id: PersonId,
|
banned_person_id: PersonId,
|
||||||
|
|
Loading…
Reference in New Issue