diff options
author | 2024-11-21 10:06:06 +0000 | |
---|---|---|
committer | 2024-11-21 11:06:06 +0100 | |
commit | 9ace025da1c51bf6b2f21ebc5d7dce2f7171906b (patch) | |
tree | e6ade361fa3e59ed020c70e33833198fa124bae3 /internal/db/bundb/instance.go | |
parent | [docs] Include link to a live instance in README (#3549) (diff) | |
download | gotosocial-9ace025da1c51bf6b2f21ebc5d7dce2f7171906b.tar.xz |
[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
Diffstat (limited to 'internal/db/bundb/instance.go')
-rw-r--r-- | internal/db/bundb/instance.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 |