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