2017-04-16 11:51:30 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class UnblockDomainService < BaseService
|
|
|
|
def call(domain_block, retroactive)
|
|
|
|
if retroactive
|
2017-05-06 16:03:34 +01:00
|
|
|
accounts = Account.where(domain: domain_block.domain).in_batches
|
|
|
|
|
2017-04-16 11:51:30 +01:00
|
|
|
if domain_block.silence?
|
2017-05-06 16:03:34 +01:00
|
|
|
accounts.update_all(silenced: false)
|
2017-04-16 11:51:30 +01:00
|
|
|
else
|
2017-05-06 16:03:34 +01:00
|
|
|
accounts.update_all(suspended: false)
|
2017-04-16 11:51:30 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
domain_block.destroy
|
|
|
|
end
|
|
|
|
end
|