From 22217993d1a0cba4d419ddf2867e1751df9248bc Mon Sep 17 00:00:00 2001 From: Vika Date: Fri, 23 Aug 2024 18:24:31 +0300 Subject: Fix private posts with no defined audience not being shown in feeds --- src/frontend/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index c4a86b4..81a03ed 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -245,9 +245,9 @@ pub async fn homepage( let hcard_url: url::Url = format!("https://{}/", host).parse().unwrap(); let feed_path = format!("https://{}/feeds/main", host); - let user = session.as_ref().map(|s| &s.0.me); + let user = session.as_deref().map(|s| &s.me); match tokio::try_join!( - get_post_from_database(&db, &hcard_url.as_str(), None, user), + get_post_from_database(&db, hcard_url.as_str(), None, user), get_post_from_database(&db, &feed_path, query.after, user) ) { Ok(((hcard, _), (hfeed, cursor))) => { @@ -339,7 +339,7 @@ pub async fn catchall( session: Option, uri: Uri, ) -> impl IntoResponse { - let user: Option<&url::Url> = session.as_deref().map(|p| &p.me); // TODO authentication + let user: Option<&url::Url> = session.as_deref().map(|p| &p.me); let host = url::Url::parse(&format!("https://{}/", host)).unwrap(); let path = host .clone() -- cgit 1.4.1