summaryrefslogtreecommitdiff
path: root/internal/db/bundb/timeline.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-07-05 12:34:37 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-05 12:34:37 +0200
commitd9c69f6ce05daddf2f6d5d8c6c03b4c3d55df93a (patch)
tree7ee20e4665bdad322321dc10f59175f7b076a7ba /internal/db/bundb/timeline.go
parent[chore/bugfix] Break Websockets logic into smaller read/write functions, don'... (diff)
downloadgotosocial-d9c69f6ce05daddf2f6d5d8c6c03b4c3d55df93a.tar.xz
[chore/performance] Remove remaining 'whereEmptyOrNull' funcs (#1946)
Diffstat (limited to 'internal/db/bundb/timeline.go')
-rw-r--r--internal/db/bundb/timeline.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/db/bundb/timeline.go b/internal/db/bundb/timeline.go
index d492c9584..0859f3ff3 100644
--- a/internal/db/bundb/timeline.go
+++ b/internal/db/bundb/timeline.go
@@ -164,8 +164,10 @@ func (t *timelineDB) GetPublicTimeline(ctx context.Context, maxID string, sinceI
NewSelect().
TableExpr("? AS ?", bun.Ident("statuses"), bun.Ident("status")).
Column("status.id").
+ // Public only.
Where("? = ?", bun.Ident("status.visibility"), gtsmodel.VisibilityPublic).
- WhereGroup(" AND ", whereEmptyOrNull("status.boost_of_id")).
+ // Ignore boosts.
+ Where("? IS NULL", bun.Ident("status.boost_of_id")).
Order("status.id DESC")
if maxID == "" {