summaryrefslogtreecommitdiff
path: root/internal/db/bundb/instance.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-29 12:03:08 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-29 12:03:08 +0200
commit53507ac2a32a785b5467b1e58d033780d8e02693 (patch)
tree1c48ac9f5fc47e65450d53d8d26d0dee30753687 /internal/db/bundb/instance.go
parentReplace federating DB locks map, add a cleanup goroutine (#166) (diff)
downloadgotosocial-53507ac2a32a785b5467b1e58d033780d8e02693.tar.xz
Mention fixup (#167)
* rework mention creation a bit * rework mention creation a bit * tidy up status dereferencing * start adding tests for dereferencing * fixups * fix * review changes
Diffstat (limited to 'internal/db/bundb/instance.go')
-rw-r--r--internal/db/bundb/instance.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/db/bundb/instance.go b/internal/db/bundb/instance.go
index ea7ae194b..2813e7e1d 100644
--- a/internal/db/bundb/instance.go
+++ b/internal/db/bundb/instance.go
@@ -41,12 +41,12 @@ func (i *instanceDB) CountInstanceUsers(ctx context.Context, domain string) (int
Where("username != ?", domain).
Where("? IS NULL", bun.Ident("suspended_at"))
- if domain == i.config.Host {
- // if the domain is *this* domain, just count where the domain field is null
- q = q.WhereGroup(" AND ", whereEmptyOrNull("domain"))
- } else {
- q = q.Where("domain = ?", domain)
- }
+ if domain == i.config.Host {
+ // if the domain is *this* domain, just count where the domain field is null
+ q = q.WhereGroup(" AND ", whereEmptyOrNull("domain"))
+ } else {
+ q = q.Where("domain = ?", domain)
+ }
count, err := q.Count(ctx)