From fadb06ef6e1950a82f08673683e705943b93ba40 Mon Sep 17 00:00:00 2001 From: Starfall Date: Tue, 15 Jun 2021 11:48:08 -0500 Subject: Revert "from monsterfork: [Privacy] Purge and re-download remote accounts if their actor key suddenly changes" This reverts commit a43c1d3f56c128c992f34b8e2b968de14e02ac48. --- app/services/activitypub/process_account_service.rb | 6 ++---- app/workers/reset_account_worker.rb | 16 ---------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 app/workers/reset_account_worker.rb (limited to 'app') diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index ad16b8f1c..4ab6912e5 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -38,14 +38,13 @@ class ActivityPub::ProcessAccountService < BaseService return if @account.nil? after_protocol_change! if protocol_changed? + after_key_change! if key_changed? && !@options[:signed_with_known_key] clear_tombstones! if key_changed? after_suspension_change! if suspension_changed? - return after_key_change! if key_changed? && !@options[:signed_with_known_key] unless @options[:only_key] || @account.suspended? check_featured_collection! if @account.featured_collection_url.present? check_links! unless @account.fields.empty? - process_sync end @account @@ -141,8 +140,7 @@ class ActivityPub::ProcessAccountService < BaseService end def after_key_change! - ResetAccountWorker.perform_async(@account.id) - nil + RefollowWorker.perform_async(@account.id) end def after_suspension_change! diff --git a/app/workers/reset_account_worker.rb b/app/workers/reset_account_worker.rb deleted file mode 100644 index f63d8682a..000000000 --- a/app/workers/reset_account_worker.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class ResetAccountWorker - include Sidekiq::Worker - - def perform(account_id) - account = Account.find(account_id) - return if account.local? - - account_uri = account.uri - SuspendAccountService.new.call(account) - ResolveAccountService.new.call(account_uri) - rescue ActiveRecord::RecordNotFound - true - end -end -- cgit