]> cat aescling's git repositories - mastodon.git/blobdiff - app/controllers/api/salmon_controller.rb
Merge branch 'master' into french-translation
[mastodon.git] / app / controllers / api / salmon_controller.rb
index 329b258a41f3902b3fe9d60b603b25f871a7cedd..a7872d5422af1335e39032a73cc8ba94664f0cda 100644 (file)
@@ -1,10 +1,18 @@
+# frozen_string_literal: true
+
 class Api::SalmonController < ApiController
   before_action :set_account
   respond_to :txt
 
   def update
-    ProcessInteractionService.new.(request.body.read, @account)
-    head 201
+    body = request.body.read
+
+    if body.nil?
+      head 200
+    else
+      SalmonWorker.perform_async(@account.id, body.force_encoding('UTF-8'))
+      head 201
+    end
   end
 
   private
This page took 0.019769 seconds and 3 git commands to generate.