Domain blocks now have varying severity - auto-suspend vs auto-silence

This commit is contained in:
Eugen Rochko 2017-01-23 17:38:38 +01:00
parent ef2b924679
commit 6d98a73180
8 changed files with 25 additions and 12 deletions

View file

@ -35,12 +35,15 @@ class FollowRemoteAccountService < BaseService
Rails.logger.debug "Creating new remote account for #{uri}"
domain_block = DomainBlock.find_by(domain: domain)
account.remote_url = data.link('http://schemas.google.com/g/2010#updates-from').href
account.salmon_url = data.link('salmon').href
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)
account.suspended = true if domain_block && domain_block.suspend?
account.silenced = true if domain_block && domain_block.silence?
xml = get_feed(account.remote_url)
hubs = get_hubs(xml)