From 6d9bc1fa5bfa17c91458a61068c26b369aaf7ee6 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 6 Jul 2024 05:08:29 +0200 Subject: [PATCH] fix: dont personalize global timelines so they can stay cached for everyone, also queries should be faster --- upub/routes/src/activitypub/inbox.rs | 4 ++-- upub/routes/src/activitypub/outbox.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/upub/routes/src/activitypub/inbox.rs b/upub/routes/src/activitypub/inbox.rs index 72145e90..bcd8f7b6 100644 --- a/upub/routes/src/activitypub/inbox.rs +++ b/upub/routes/src/activitypub/inbox.rs @@ -1,6 +1,6 @@ use apb::{Activity, ActivityType, Base}; use axum::{extract::{Query, State}, http::StatusCode, Json}; -use sea_orm::{ActiveValue::{NotSet, Set}, EntityTrait}; +use sea_orm::{sea_query::IntoCondition, ActiveValue::{NotSet, Set}, ColumnTrait, EntityTrait}; use upub::{model::job::JobType, Context}; use crate::{AuthIdentity, Identity, builders::JsonLD}; @@ -21,7 +21,7 @@ pub async fn page( ) -> crate::ApiResult> { crate::builders::paginate_feed( upub::url!(ctx, "/inbox/page"), - auth.filter(), + upub::model::addressing::Column::Actor.is_null().into_condition(), ctx.db(), page, auth.my_id(), diff --git a/upub/routes/src/activitypub/outbox.rs b/upub/routes/src/activitypub/outbox.rs index b502ed88..edec93fa 100644 --- a/upub/routes/src/activitypub/outbox.rs +++ b/upub/routes/src/activitypub/outbox.rs @@ -16,7 +16,7 @@ pub async fn page( crate::builders::paginate_feed( upub::url!(ctx, "/outbox/page"), Condition::all() - .add(auth.filter()) + .add(upub::model::addressing::Column::Actor.is_null()) .add(upub::model::actor::Column::Domain.eq(ctx.domain().to_string())), ctx.db(), page,