From 93ad2850f647a26086ec28339133d727f376fd53 Mon Sep 17 00:00:00 2001 From: kim Date: Fri, 25 Apr 2025 16:57:10 +0100 Subject: [PATCH] some small re-orderings to confirm query params in correct places --- internal/db/bundb/timeline.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/db/bundb/timeline.go b/internal/db/bundb/timeline.go index 9448e1b74..8278de647 100644 --- a/internal/db/bundb/timeline.go +++ b/internal/db/bundb/timeline.go @@ -162,12 +162,12 @@ func (t *timelineDB) GetLocalTimeline(ctx context.Context, page *paging.Page) ([ // Public only. q = q.Where("? = ?", bun.Ident("visibility"), gtsmodel.VisibilityPublic) - // Ignore boosts. - q = q.Where("? IS NULL", bun.Ident("boost_of_id")) - // Only include statuses that aren't pending approval. q = q.Where("? = ?", bun.Ident("pending_approval"), false) + // Ignore boosts. + q = q.Where("? IS NULL", bun.Ident("boost_of_id")) + return q, nil }, ) @@ -332,6 +332,13 @@ func loadStatusTimelinePage( Table("statuses"). Column("id") + // Append caller + // query details. + q, err := query(q) + if err != nil { + return nil, err + } + if maxID != "" { // Set a maximum ID boundary if was given. q = q.Where("? < ?", bun.Ident("id"), maxID) @@ -342,13 +349,6 @@ func loadStatusTimelinePage( q = q.Where("? > ?", bun.Ident("id"), minID) } - // Append caller - // query details. - q, err := query(q) - if err != nil { - return nil, err - } - // Set query ordering. if order.Ascending() { q = q.OrderExpr("? ASC", bun.Ident("id"))