2017-02-06 02:51:56 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class UnmuteService < BaseService
|
|
|
|
def call(account, target_account)
|
|
|
|
return unless account.muting?(target_account)
|
|
|
|
|
2024-01-26 13:30:19 +01:00
|
|
|
unmute = account.unmute!(target_account)
|
|
|
|
|
|
|
|
TriggerWebhookWithObjectWorker.perform_async('mute.removed', Oj.to_json({ 'account_id': unmute.account_id, 'target_account_id': unmute.target_account_id, 'id': unmute.id }))
|
2017-03-02 18:49:32 +01:00
|
|
|
|
|
|
|
MergeWorker.perform_async(target_account.id, account.id) if account.following?(target_account)
|
2017-02-06 02:51:56 +01:00
|
|
|
end
|
|
|
|
end
|