From 263ead73616dba43a0337c2a3edaf96a6382d533 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Tue, 21 Jul 2020 01:44:16 -0500 Subject: [Feature] Add post and thread (un)hiding to backend --- app/services/mute_conversation_service.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/services/mute_conversation_service.rb (limited to 'app/services/mute_conversation_service.rb') diff --git a/app/services/mute_conversation_service.rb b/app/services/mute_conversation_service.rb new file mode 100644 index 000000000..46adb98dc --- /dev/null +++ b/app/services/mute_conversation_service.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class MuteConversationService < BaseService + def call(account, conversation, hidden: false) + return if account.blank? || conversation.blank? + + account.mute_conversation!(conversation, hidden: hidden) + MuteConversationWorker.perform_async(account.id, conversation.id) if hidden + end +end -- cgit