1
0

unmute_service.rb 536 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. class UnmuteService < BaseService
  3. def call(account, target_account)
  4. return unless account.muting?(target_account)
  5. account.unmute!(target_account)
  6. if account.following?(target_account)
  7. MergeWorker.perform_async(target_account.id, account.id, 'home')
  8. MergeWorker.push_bulk(List.where(account: account).joins(:list_accounts).where(list_accounts: { account_id: target_account.id }).pluck(:id)) do |list_id|
  9. [target_account.id, list_id, 'list']
  10. end
  11. end
  12. end
  13. end