diff --git a/crates/api_crud/src/community/read.rs b/crates/api_crud/src/community/read.rs index 85b22da03..d4a28b781 100644 --- a/crates/api_crud/src/community/read.rs +++ b/crates/api_crud/src/community/read.rs @@ -6,7 +6,10 @@ use lemmy_api_common::{ community::*, get_local_user_view_from_jwt_opt, }; -use lemmy_apub::{fetcher::resolve_actor_identifier, objects::community::ApubCommunity}; +use lemmy_apub::{ + fetcher::resolve_actor_identifier, + objects::{community::ApubCommunity, instance::instance_actor_id_from_url}, +}; use lemmy_db_schema::{ from_opt_str_to_opt_enum, source::{community::Community, site::Site}, @@ -20,7 +23,6 @@ use lemmy_db_views_actor::{ }; use lemmy_utils::{ConnectionId, LemmyError}; use lemmy_websocket::{messages::GetCommunityUsersOnline, LemmyContext}; -use url::Url; #[async_trait::async_trait(?Send)] impl PerformCrud for GetCommunity { @@ -76,8 +78,7 @@ impl PerformCrud for GetCommunity { .await .unwrap_or(1); - let mut site_id: Url = community_view.community.actor_id.clone().into(); - site_id.set_path(""); + let site_id = instance_actor_id_from_url(community_view.community.actor_id.clone().into()); let mut site: Option = blocking(context.pool(), move |conn| { Site::read_from_apub_id(conn, site_id) })