Account deletion (#3728)
* Add form for account deletion * If avatar or header are gone from source, remove them * Add option to have SuspendAccountService remove user record, add tests * Exclude suspended accounts from search
This commit is contained in:
parent
a208e7d655
commit
4a618908e8
15 changed files with 183 additions and 7 deletions
|
@ -1,9 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SuspendAccountService < BaseService
|
||||
def call(account)
|
||||
def call(account, remove_user = false)
|
||||
@account = account
|
||||
|
||||
purge_user if remove_user
|
||||
purge_content
|
||||
purge_profile
|
||||
unsubscribe_push_subscribers
|
||||
|
@ -11,6 +12,10 @@ class SuspendAccountService < BaseService
|
|||
|
||||
private
|
||||
|
||||
def purge_user
|
||||
@account.user.destroy
|
||||
end
|
||||
|
||||
def purge_content
|
||||
@account.statuses.reorder(nil).find_each do |status|
|
||||
# This federates out deletes to previous followers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue