From 21cde13f9623acdb0fbf0a2058ab47bbbde59f7c Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 13 May 2024 02:01:07 +0200 Subject: [PATCH] fix: webfinger/fetch if checks --- src/routes/activitypub/user/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/activitypub/user/mod.rs b/src/routes/activitypub/user/mod.rs index d474c24..2b37819 100644 --- a/src/routes/activitypub/user/mod.rs +++ b/src/routes/activitypub/user/mod.rs @@ -20,13 +20,15 @@ pub async fn view( Query(query): Query, ) -> crate::Result> { let mut uid = ctx.uri("users", id.clone()); - if auth.is_local() && query.fetch && !ctx.is_local(&uid) { + if auth.is_local() { if id.starts_with('@') { if let Some((user, host)) = id.replacen('@', "", 1).split_once('@') { uid = ctx.webfinger(user, host).await?; } } - ctx.fetch_user(&uid).await?; + if query.fetch && !ctx.is_local(&uid) { + ctx.fetch_user(&uid).await?; + } } let (followed_by_me, following_me) = match auth.my_id() {