diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-15 12:56:00 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-15 14:12:16 -0500 |
commit | 29643fd6c42bcee5a1d6a4a137256b33996c60f2 (patch) | |
tree | d1a101068e038d6e0da6d37708f8b1c82c3120df /app/services/activitypub | |
parent | 992bd7c752ff3fc37ff35713420e74dc7ea7b576 (diff) |
make blocking domains actually block the accounts
Diffstat (limited to 'app/services/activitypub')
-rw-r--r-- | app/services/activitypub/process_account_service.rb | 9 |
1 files changed, 8 insertions, 1 deletions
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) } |