diff options
author | 2021-07-06 13:29:11 +0200 | |
---|---|---|
committer | 2021-07-06 13:29:11 +0200 | |
commit | 356857921897c0fb91add7f94e8944dd7e6c57b5 (patch) | |
tree | 2f6d8d42b6eba0ef3bc693c04be712bcef2af1d3 /internal/db/pg/instance.go | |
parent | Domain block (#76) (diff) | |
download | gotosocial-356857921897c0fb91add7f94e8944dd7e6c57b5.tar.xz |
Blocklist import (#77)
* first steps on importing blocklists
* unblock domains properly
Diffstat (limited to 'internal/db/pg/instance.go')
-rw-r--r-- | internal/db/pg/instance.go | 22 |
1 files changed, 20 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>. +*/ + 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 |