From 576e809b696e3fffcc1393f71d906adf6a10d85b Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 12 Apr 2024 22:41:04 +0200 Subject: [PATCH] fix: timelines ordering what??? ASCENDING goes from most recent to least recent?? maybe ascending oldness?????? --- src/routes/activitypub/outbox.rs | 2 +- src/routes/activitypub/user/inbox.rs | 3 ++- src/routes/activitypub/user/outbox.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/activitypub/outbox.rs b/src/routes/activitypub/outbox.rs index 9823ff6f..77aee700 100644 --- a/src/routes/activitypub/outbox.rs +++ b/src/routes/activitypub/outbox.rs @@ -18,7 +18,7 @@ pub async fn page( match model::addressing::Entity::find_activities() .filter(auth.filter_condition()) // TODO also limit to only local activities - .order_by(model::addressing::Column::Published, Order::Desc) + .order_by(model::addressing::Column::Published, Order::Asc) .limit(limit) .offset(offset) .into_model::() diff --git a/src/routes/activitypub/user/inbox.rs b/src/routes/activitypub/user/inbox.rs index 52b9fc01..4eaf2180 100644 --- a/src/routes/activitypub/user/inbox.rs +++ b/src/routes/activitypub/user/inbox.rs @@ -1,6 +1,6 @@ use axum::{extract::{Path, Query, State}, http::StatusCode, Json}; -use sea_orm::{ColumnTrait, Condition, QueryFilter, QuerySelect}; +use sea_orm::{ColumnTrait, Condition, Order, QueryFilter, QueryOrder, QuerySelect}; use crate::{errors::UpubError, model::{self, addressing::EmbeddedActivity}, routes::activitypub::{jsonld::LD, JsonLD, Pagination}, server::{auth::{AuthIdentity, Identity}, Context}, url}; pub async fn get( @@ -34,6 +34,7 @@ pub async fn page( let offset = page.offset.unwrap_or(0); match model::addressing::Entity::find_activities() .filter(Condition::all().add(model::addressing::Column::Actor.eq(&user))) + .order_by(model::addressing::Column::Published, Order::Asc) .offset(offset) .limit(limit) .into_model::() diff --git a/src/routes/activitypub/user/outbox.rs b/src/routes/activitypub/user/outbox.rs index 396553cd..c4fe7fdc 100644 --- a/src/routes/activitypub/user/outbox.rs +++ b/src/routes/activitypub/user/outbox.rs @@ -26,7 +26,7 @@ pub async fn page( match model::addressing::Entity::find_activities() .filter(Condition::all().add(model::activity::Column::Actor.eq(&uid))) .filter(auth.filter_condition()) - .order_by(model::addressing::Column::Published, Order::Desc) + .order_by(model::addressing::Column::Published, Order::Asc) .limit(limit) .offset(offset) .into_model::()