about summary refs log tree commit diff
path: root/app/services/process_command_tags_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/process_command_tags_service.rb')
-rw-r--r--app/services/process_command_tags_service.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/process_command_tags_service.rb b/app/services/process_command_tags_service.rb
new file mode 100644
index 000000000..6b6d46662
--- /dev/null
+++ b/app/services/process_command_tags_service.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class ProcessCommandTagsService < BaseService
+  def call(account, status, raise_if_no_output: true)
+    CommandTag::Processor.new(account, status).process!
+    raise Mastodon::LengthValidationError, 'Text commands were processed successfully.' if raise_if_no_output && status.destroyed?
+
+    status
+  end
+end