From f22cae919ff0642596952671074aba0865b45921 Mon Sep 17 00:00:00 2001 From: aprilthepink Date: Wed, 17 Jul 2024 01:24:04 +0200 Subject: [PATCH] fix: allow post parsing again --- src/lysand/conversion.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lysand/conversion.rs b/src/lysand/conversion.rs index 096d179..bae6f1f 100644 --- a/src/lysand/conversion.rs +++ b/src/lysand/conversion.rs @@ -32,7 +32,11 @@ pub async fn lysand_post_from_db( let data = FEDERATION_CONFIG.get().unwrap(); let domain = data.domain(); let url = generate_lysand_post_url(domain, &post.id)?; - let author = Url::parse(&post.creator.to_string())?; + let creator = prelude::User::find() + .filter(entities::user::Column::Id.eq(post.creator.clone())) + .one(DB.get().unwrap()) + .await?; + let author = Url::parse(&creator.unwrap().url)?; let visibility = match post.visibility.as_str() { "public" => super::objects::VisibilityType::Public, "followers" => super::objects::VisibilityType::Followers,