Fix sending spurious Rejects when processing remote account deletion (#15104)
* Fix sending spurious Rejects when processing remote account deletion * Make skip_side_effects imply skip_activitypub
This commit is contained in:
parent
df1653174b
commit
2f6831f318
4 changed files with 8 additions and 4 deletions
|
@ -41,6 +41,7 @@ class DeleteAccountService < BaseService
|
|||
# @option [Boolean] :reserve_email Keep user record. Only applicable for local accounts
|
||||
# @option [Boolean] :reserve_username Keep account record
|
||||
# @option [Boolean] :skip_side_effects Side effects are ActivityPub and streaming API payloads
|
||||
# @option [Boolean] :skip_activitypub Skip sending ActivityPub payloads. Implied by :skip_side_effects
|
||||
# @option [Time] :suspended_at Only applicable when :reserve_username is true
|
||||
def call(account, **options)
|
||||
@account = account
|
||||
|
@ -52,6 +53,8 @@ class DeleteAccountService < BaseService
|
|||
@options[:skip_side_effects] = true
|
||||
end
|
||||
|
||||
@options[:skip_activitypub] = true if @options[:skip_side_effects]
|
||||
|
||||
reject_follows!
|
||||
purge_user!
|
||||
purge_profile!
|
||||
|
@ -62,7 +65,7 @@ class DeleteAccountService < BaseService
|
|||
private
|
||||
|
||||
def reject_follows!
|
||||
return if @account.local? || !@account.activitypub?
|
||||
return if @account.local? || !@account.activitypub? || @options[:skip_activitypub]
|
||||
|
||||
# When deleting a remote account, the account obviously doesn't
|
||||
# actually become deleted on its origin server, i.e. unlike a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue