about summary refs log tree commit diff
path: root/app/services/mute_conversation_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/mute_conversation_service.rb')
-rw-r--r--app/services/mute_conversation_service.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/mute_conversation_service.rb b/app/services/mute_conversation_service.rb
new file mode 100644
index 000000000..a12bf9533
--- /dev/null
+++ b/app/services/mute_conversation_service.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class MuteConversationService < BaseService
+  def call(account, conversation)
+    return if account.blank? || conversation.blank?
+
+    account.mute_conversation!(conversation)
+    MuteConversationWorker.perform_async(account.id, conversation.id)
+  end
+end