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