mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-24 18:13:42 +01:00
Improve suspend account service
This commit is contained in:
parent
f978b06dd1
commit
2ef9f36cf2
2 changed files with 8 additions and 5 deletions
|
@ -11,11 +11,11 @@ class RemoveStatusService < BaseService
|
|||
|
||||
status.destroy!
|
||||
|
||||
if status.account.local?
|
||||
return unless status.account.local?
|
||||
|
||||
HubPingWorker.perform_async(status.account.id)
|
||||
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
|
||||
end
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue