From 218f1df6704d8c0a50746d7260e1eafb328634e1 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 21 Feb 2020 03:05:51 -0600 Subject: get rid of refereces to now-rejected autoreject helper (& unbreak the server) --- app/services/activitypub/process_account_service.rb | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'app/services/activitypub/process_account_service.rb') diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 96a2c4b0b..9f529ed52 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -24,7 +24,6 @@ class ActivityPub::ProcessAccountService < BaseService is_new_account = @account.nil? if is_new_account - copy_policy_of_parent_domain set_reject_unknown_policy if Setting.auto_reject_unknown && new_domain? create_account end @@ -105,29 +104,13 @@ class ActivityPub::ProcessAccountService < BaseService @account.moved_to_account = @json['movedTo'].present? ? moved_account : nil end - def copy_policy_of_parent_domain - domain_parts = @domain.split('.') - domains = (1..domain_parts.count-1).map { |i| domain_parts[i..-1].join('.') } - return if domains.empty? - - existing_policy = DomainBlock.find_by(domain: domains) - return if existing_policy.nil? - - policy_attributes = existing_policy.template - policy_attributes['domain'] = @domain - policy = DomainBlock.create!(policy_attributes) - user_friendly_action_log(existing_policy, :create, policy) - - @new_domain = false - end - def set_reject_unknown_policy DomainBlock.create!(domain: @domain, severity: :noop, reject_unknown: true) user_friendly_action_log(nil, :mark_unknown, @domain) end def new_domain? - @new_domain ||= !(Account.where(domain: @domain).exists? || DomainBlock.where(domain: @domain).exists?) + @new_domain ||= !(Account.where(domain: @domain).exists? || DomainBlock.rule_for(@domain)) || DomainAllow.rule_for(@domain) end def after_key_change! -- cgit