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