diff options
Diffstat (limited to 'app/services/suspend_account_service.rb')
-rw-r--r-- | app/services/suspend_account_service.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb index 958b28cdc..56fa2d8dd 100644 --- a/app/services/suspend_account_service.rb +++ b/app/services/suspend_account_service.rb @@ -22,6 +22,8 @@ class SuspendAccountService < BaseService end def purge_content! + ActivityPub::RawDistributionWorker.perform_async(delete_actor_json, @account.id) if @account.local? + @account.statuses.reorder(nil).find_in_batches do |statuses| BatchedRemoveStatusService.new.call(statuses) end @@ -54,4 +56,14 @@ class SuspendAccountService < BaseService def destroy_all(association) association.in_batches.destroy_all end + + def delete_actor_json + payload = ActiveModelSerializers::SerializableResource.new( + @account, + serializer: ActivityPub::DeleteActorSerializer, + adapter: ActivityPub::Adapter + ).as_json + + Oj.dump(ActivityPub::LinkedDataSignature.new(payload).sign!(@account)) + end end |