From 9ace025da1c51bf6b2f21ebc5d7dce2f7171906b Mon Sep 17 00:00:00 2001 From: Jannis Date: Thu, 21 Nov 2024 10:06:06 +0000 Subject: [bugfix] post counters should not include direct messages (#3554) * [bugfix] post counters should not include direct messages #3504 The fix is relativly simple, it just adds a line to the relevant function which excludes all private posts. * Formating fix * mb --- internal/db/bundb/instance.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/db/bundb/instance.go') diff --git a/internal/db/bundb/instance.go b/internal/db/bundb/instance.go index 419951253..bbfd82ffb 100644 --- a/internal/db/bundb/instance.go +++ b/internal/db/bundb/instance.go @@ -103,6 +103,9 @@ func (i *instanceDB) CountInstanceStatuses(ctx context.Context, domain string) ( // Ignore statuses that are currently pending approval. q = q.Where("NOT ? = ?", bun.Ident("status.pending_approval"), true) + // Ignore statuses that are direct messages. + q = q.Where("NOT ? = ?", bun.Ident("status.visibility"), "direct") + count, err := q.Count(ctx) if err != nil { return 0, err -- cgit v1.2.3