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.
lolsob-rspec
ThibG 2019-11-21 11:36:16 +01:00 committed by Eugen Rochko
parent 0fe0be988e
commit 27b7ec1043
1 changed files with 2 additions and 2 deletions

View File

@ -20,13 +20,13 @@ class BlockDomainService < BaseService
end end
def process_domain_block! def process_domain_block!
clear_media! if domain_block.reject_media?
if domain_block.silence? if domain_block.silence?
silence_accounts! silence_accounts!
elsif domain_block.suspend? elsif domain_block.suspend?
suspend_accounts! suspend_accounts!
end end
clear_media! if domain_block.reject_media?
end end
def invalidate_association_caches! def invalidate_association_caches!