about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/services/after_block_service.rb4
-rw-r--r--app/services/mute_service.rb2
-rw-r--r--app/workers/block_worker.rb5
3 files changed, 7 insertions, 4 deletions
diff --git a/app/services/after_block_service.rb b/app/services/after_block_service.rb
index 3ee7e2e56..36f891988 100644
--- a/app/services/after_block_service.rb
+++ b/app/services/after_block_service.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 class AfterBlockService < BaseService
-  def call(account, target_account)
+  def call(account, target_account, defederate: true)
     @account        = account
     @target_account = target_account
 
@@ -9,6 +9,8 @@ class AfterBlockService < BaseService
     clear_notifications!
     clear_conversations!
 
+    return unless defederate
+
     defederate_interactions!
     unlink_interactions!
   end
diff --git a/app/services/mute_service.rb b/app/services/mute_service.rb
index 67df92f5c..5e7e1d292 100644
--- a/app/services/mute_service.rb
+++ b/app/services/mute_service.rb
@@ -7,7 +7,7 @@ class MuteService < BaseService
     mute = account.mute!(target_account, notifications: notifications, timelines_only: timelines_only, duration: duration)
 
     if mute.hide_notifications?
-      BlockWorker.perform_async(account.id, target_account.id)
+      BlockWorker.perform_async(account.id, target_account.id, defederate: false)
     else
       MuteWorker.perform_async(account.id, target_account.id)
     end
diff --git a/app/workers/block_worker.rb b/app/workers/block_worker.rb
index 25f5dd808..89ba11b55 100644
--- a/app/workers/block_worker.rb
+++ b/app/workers/block_worker.rb
@@ -3,10 +3,11 @@
 class BlockWorker
   include Sidekiq::Worker
 
-  def perform(account_id, target_account_id)
+  def perform(account_id, target_account_id, defederate: true)
     AfterBlockService.new.call(
       Account.find(account_id),
-      Account.find(target_account_id)
+      Account.find(target_account_id),
+      defederate: defederate
     )
   end
 end