diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-02-21 03:05:51 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-21 03:05:51 -0600 |
commit | 218f1df6704d8c0a50746d7260e1eafb328634e1 (patch) | |
tree | 462bd9fe3ec6e9258d0fba90ca7dc38234a30d75 /app/services/activitypub/process_account_service.rb | |
parent | 137fe956550867761c6a053676779354edb28997 (diff) |
get rid of refereces to now-rejected autoreject helper (& unbreak the server)
Diffstat (limited to 'app/services/activitypub/process_account_service.rb')
-rw-r--r-- | app/services/activitypub/process_account_service.rb | 19 |
1 files changed, 1 insertions, 18 deletions
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! |