[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.
This commit is contained in:
Booklordofthedings 2024-11-21 00:56:50 +01:00
parent ffa67ac1ae
commit b3bf853409

View file

@ -103,7 +103,11 @@ 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
}