Skip to content
Snippets Groups Projects
Commit 2ef9f36c authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Improve suspend account service

parent f978b06d
No related branches found
Tags v2.3.2
No related merge requests found
......@@ -11,10 +11,10 @@ class RemoveStatusService < BaseService
status.destroy!
if status.account.local?
HubPingWorker.perform_async(status.account.id)
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
end
return unless status.account.local?
HubPingWorker.perform_async(status.account.id)
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
end
private
......
......@@ -12,8 +12,11 @@ class SuspendAccountService < BaseService
private
def purge_content
@account.statuses.find_each do |status|
RemoveStatusService.new.call(status)
end
@account.media_attachments.destroy_all
@account.statuses.destroy_all
@account.stream_entries.destroy_all
@account.mentions.destroy_all
@account.notifications.destroy_all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment