1
0
Fork 1
forked from fedi/mastodon
mastodon/app/services/mute_service.rb
Eugen Rochko 774ac47373
Add conversations API (#8832)
* Add conversations API

* Add web UI for conversations

* Add test for conversations API

* Add tests for ConversationAccount

* Improve web UI

* Rename ConversationAccount to AccountConversation

* Remove conversations on block and mute

* Change last_status_id to be a denormalization of status_ids

* Add optimistic locking
2018-10-07 23:44:58 +02:00

18 lines
432 B
Ruby

# frozen_string_literal: true
class MuteService < BaseService
def call(account, target_account, notifications: nil)
return if account.id == target_account.id
mute = account.mute!(target_account, notifications: notifications)
if mute.hide_notifications?
BlockWorker.perform_async(account.id, target_account.id)
else
MuteWorker.perform_async(account.id, target_account.id)
end
mute
end
end