about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-11-21 11:36:16 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-11-21 11:36:15 +0100
commitc4d45765e373464381ef5817a960b247f148e896 (patch)
treebe92c0b3052a62267b9b9f40100dac16a3f5c4d3 /app/services
parent5bc4edd0784ed26ada36405ec2ba78a972822983 (diff)
Change domain block behavior to update user records before deleting data (#12247)
When suspending or silencing a domain, one probably wants the silence or
suspend parts to take effect as soon as possible. Deleting media files can
take a while (possibly days), so perform silencing as soon as possible, and
clean up media afterwards.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/block_domain_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/block_domain_service.rb b/app/services/block_domain_service.rb
index ae461abf2..9f0860674 100644
--- a/app/services/block_domain_service.rb
+++ b/app/services/block_domain_service.rb
@@ -20,13 +20,13 @@ class BlockDomainService < BaseService
   end
 
   def process_domain_block!
-    clear_media! if domain_block.reject_media?
-
     if domain_block.silence?
       silence_accounts!
     elsif domain_block.suspend?
       suspend_accounts!
     end
+
+    clear_media! if domain_block.reject_media?
   end
 
   def invalidate_association_caches!