about summary refs log tree commit diff
path: root/app/services/delete_account_service.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-11-20 13:27:48 +0100
committerThibaut Girka <thib@sitedethib.com>2020-11-20 13:27:48 +0100
commit48f0f3ffeeb2b3dfb8af7d4d0fba3b64697d125c (patch)
tree665a41c2543505b75b24b41761bc5d0ff9e9b458 /app/services/delete_account_service.rb
parentdb01f8b942b72eaa2eacbb144261b002f8079c9c (diff)
parent8b8004a9626442ae31e4dffd79e874e9cde050c6 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `.github/ISSUE_TEMPLATE/bug_report.md`:
  Upstream added the `bug` label to bug reports.
  Did the same.
- `app/services/fan_out_on_write_service.rb`:
  Upstream put DMs back into timelines, glitch-soc was already doing it.
  Ignored upstream changes.
Diffstat (limited to 'app/services/delete_account_service.rb')
-rw-r--r--app/services/delete_account_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb
index de6488c78..778d064de 100644
--- a/app/services/delete_account_service.rb
+++ b/app/services/delete_account_service.rb
@@ -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