1
0
Fork 0
forked from alemi/upub

fix: dont personalize global timelines

so they can stay cached for everyone, also queries should be faster
This commit is contained in:
əlemi 2024-07-06 05:08:29 +02:00
parent 68effabbd6
commit 6d9bc1fa5b
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
use apb::{Activity, ActivityType, Base}; use apb::{Activity, ActivityType, Base};
use axum::{extract::{Query, State}, http::StatusCode, Json}; 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 upub::{model::job::JobType, Context};
use crate::{AuthIdentity, Identity, builders::JsonLD}; use crate::{AuthIdentity, Identity, builders::JsonLD};
@ -21,7 +21,7 @@ pub async fn page(
) -> crate::ApiResult<JsonLD<serde_json::Value>> { ) -> crate::ApiResult<JsonLD<serde_json::Value>> {
crate::builders::paginate_feed( crate::builders::paginate_feed(
upub::url!(ctx, "/inbox/page"), upub::url!(ctx, "/inbox/page"),
auth.filter(), upub::model::addressing::Column::Actor.is_null().into_condition(),
ctx.db(), ctx.db(),
page, page,
auth.my_id(), auth.my_id(),

View file

@ -16,7 +16,7 @@ pub async fn page(
crate::builders::paginate_feed( crate::builders::paginate_feed(
upub::url!(ctx, "/outbox/page"), upub::url!(ctx, "/outbox/page"),
Condition::all() Condition::all()
.add(auth.filter()) .add(upub::model::addressing::Column::Actor.is_null())
.add(upub::model::actor::Column::Domain.eq(ctx.domain().to_string())), .add(upub::model::actor::Column::Domain.eq(ctx.domain().to_string())),
ctx.db(), ctx.db(),
page, page,