From 29643fd6c42bcee5a1d6a4a137256b33996c60f2 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 15 Jul 2019 12:56:00 -0500 Subject: make blocking domains actually block the accounts --- app/services/activitypub/process_account_service.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/services/activitypub') diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 8064fcb00..414dbfda7 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -20,8 +20,10 @@ class ActivityPub::ProcessAccountService < BaseService @account = Account.find_remote(@username, @domain) @old_public_key = @account&.public_key - create_account if @account.nil? + is_new_account = @account.nil? + create_account if is_new_account update_account + update_account_domain_blocks if is_new_account process_tags process_attachments else @@ -105,6 +107,11 @@ class ActivityPub::ProcessAccountService < BaseService VerifyAccountLinksWorker.perform_async(@account.id) end + def update_account_domain_blocks + return if @account.domain.nil? || @account.local? + UpdateAccountDomainBlocksWorker.perform_async(@account.id) + end + def actor_type if @json['type'].is_a?(Array) @json['type'].find { |type| ActivityPub::FetchRemoteAccountService::SUPPORTED_TYPES.include?(type) } -- cgit