mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-27 22:01:35 +01:00
774ac47373
* 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
17 lines
432 B
Ruby
17 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
|