diff options
Diffstat (limited to 'internal/db/bundb/instance.go')
-rw-r--r-- | internal/db/bundb/instance.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/internal/db/bundb/instance.go b/internal/db/bundb/instance.go index 24cc6f1be..d16fac90b 100644 --- a/internal/db/bundb/instance.go +++ b/internal/db/bundb/instance.go @@ -22,7 +22,6 @@ import ( "context" "github.com/sirupsen/logrus" - "github.com/spf13/viper" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" @@ -41,8 +40,7 @@ func (i *instanceDB) CountInstanceUsers(ctx context.Context, domain string) (int Where("username != ?", domain). Where("? IS NULL", bun.Ident("suspended_at")) - host := viper.GetString(config.Keys.Host) - if domain == host { + if domain == config.GetHost() { // if the domain is *this* domain, just count where the domain field is null q = q.WhereGroup(" AND ", whereEmptyOrNull("domain")) } else { @@ -61,8 +59,7 @@ func (i *instanceDB) CountInstanceStatuses(ctx context.Context, domain string) ( NewSelect(). Model(&[]*gtsmodel.Status{}) - host := viper.GetString(config.Keys.Host) - if domain == host { + if domain == config.GetHost() { // if the domain is *this* domain, just count where local is true q = q.Where("local = ?", true) } else { @@ -83,8 +80,7 @@ func (i *instanceDB) CountInstanceDomains(ctx context.Context, domain string) (i NewSelect(). Model(&[]*gtsmodel.Instance{}) - host := viper.GetString(config.Keys.Host) - if domain == host { + if domain == config.GetHost() { // if the domain is *this* domain, just count other instances it knows about // exclude domains that are blocked q = q. |