From 356857921897c0fb91add7f94e8944dd7e6c57b5 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 6 Jul 2021 13:29:11 +0200 Subject: Blocklist import (#77) * first steps on importing blocklists * unblock domains properly --- internal/db/pg/instance.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'internal/db/pg/instance.go') diff --git a/internal/db/pg/instance.go b/internal/db/pg/instance.go index 2de0c5366..c551b2a49 100644 --- a/internal/db/pg/instance.go +++ b/internal/db/pg/instance.go @@ -1,3 +1,21 @@ +/* + GoToSocial + Copyright (C) 2021 GoToSocial Authors admin@gotosocial.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + package pg import ( @@ -42,8 +60,8 @@ func (ps *postgresService) GetDomainCountForInstance(domain string) (int, error) if domain == ps.config.Host { // if the domain is *this* domain, just count other instances it knows about - // TODO: exclude domains that are blocked or silenced - q = q.Where("domain != ?", domain) + // exclude domains that are blocked + q = q.Where("domain != ?", domain).Where("? IS NULL", pg.Ident("suspended_at")) } else { // TODO: implement federated domain counting properly for remote domains return 0, nil -- cgit v1.2.3