From 36e84f4102ec2a5133e8e53ff310ac47cb3128e7 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 23 Jan 2024 18:42:23 -0500 Subject: [PATCH] Removing the conditioned site return. --- crates/api_common/src/utils.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/crates/api_common/src/utils.rs b/crates/api_common/src/utils.rs index f3dbc6a5d..605733efc 100644 --- a/crates/api_common/src/utils.rs +++ b/crates/api_common/src/utils.rs @@ -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 pub async fn read_site_for_actor( @@ -576,17 +576,7 @@ pub async fn read_site_for_actor( ) -> Result, LemmyError> { 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?; - // 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) - } - } else { - Ok(site) - } + Ok(site) } pub async fn purge_image_posts_for_person(