diff --git a/src/routes/activitypub/activity.rs b/src/routes/activitypub/activity.rs index 0d4ecdc8..a66b053c 100644 --- a/src/routes/activitypub/activity.rs +++ b/src/routes/activitypub/activity.rs @@ -39,7 +39,7 @@ pub async fn view( .await? { Some(activity) => Ok(JsonLD(serde_json::Value::from(activity).ld_context())), - None => if auth.is_local() && query.fetch { + None => if auth.is_local() && query.fetch && !ctx.is_local(&aid) { Ok(JsonLD(ap_activity(ctx.fetch().activity(&aid).await?).ld_context())) } else { Err(UpubError::not_found()) diff --git a/src/routes/activitypub/object.rs b/src/routes/activitypub/object.rs index 72301fe6..65555422 100644 --- a/src/routes/activitypub/object.rs +++ b/src/routes/activitypub/object.rs @@ -44,7 +44,7 @@ pub async fn view( { Some(EmbeddedActivity { activity: _, object: Some(object) }) => Ok(JsonLD(ap_object(object).ld_context())), Some(EmbeddedActivity { activity: _, object: None }) => Err(UpubError::not_found()), - None => if auth.is_local() && query.fetch { + None => if auth.is_local() && query.fetch && !ctx.is_local(&oid) { Ok(JsonLD(ap_object(ctx.fetch().object(&oid).await?).ld_context())) } else { Err(UpubError::not_found()) diff --git a/src/routes/activitypub/user/mod.rs b/src/routes/activitypub/user/mod.rs index 19d1a4fd..b2aa438e 100644 --- a/src/routes/activitypub/user/mod.rs +++ b/src/routes/activitypub/user/mod.rs @@ -102,7 +102,7 @@ pub async fn view( }, // remote user TODDO doesn't work? Some((user, None)) => Ok(JsonLD(ap_user(user).ld_context())), - None => if auth.is_local() && query.fetch { + None => if auth.is_local() && query.fetch && !ctx.is_local(&uid) { Ok(JsonLD(ap_user(ctx.fetch().user(&uid).await?).ld_context())) } else { Err(UpubError::not_found())