Instead of refusing to create accounts, domain blocks auto-suspend new accounts from that domain

This commit is contained in:
Eugen Rochko
2017-01-20 20:14:02 +01:00
parent 05abd977c1
commit 9bd3b11cfb
4 changed files with 6 additions and 3 deletions

View File

@ -14,7 +14,6 @@ class FollowRemoteAccountService < BaseService
username, domain = uri.split('@')
return Account.find_local(username) if TagManager.instance.local_domain?(domain)
return nil if DomainBlock.blocked?(domain)
account = Account.find_remote(username, domain)
return account unless account.nil?
@ -41,6 +40,7 @@ class FollowRemoteAccountService < BaseService
account.url = data.link('http://webfinger.net/rel/profile-page').href
account.public_key = magic_key_to_pem(data.link('magic-public-key').href)
account.private_key = nil
account.suspended = true if DomainBlock.blocked?(domain)
xml = get_feed(account.remote_url)
hubs = get_hubs(xml)