mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-27 06:03:42 +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
|