From a04935f5c1a0456acaafed40996a18ccb4d6f962 Mon Sep 17 00:00:00 2001 From: Z Date: Mon, 28 Oct 2019 15:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=91=E6=B4=9E=E8=AF=84=E8=AE=BA=E5=8C=BF?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/statuses_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index bba3c0651..e640dc6a3 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -34,9 +34,11 @@ class Api::V1::StatusesController < Api::BaseController end def create - @status = PostStatusService.new.call(current_user.account, + thread = status_params[:in_reply_to_id].blank? ? nil : Status.find(status_params[:in_reply_to_id]) + sender = thread && thread.account.username == 'tree_hole_bot' ? thread.account : current_account + @status = PostStatusService.new.call(sender, text: status_params[:status], - thread: status_params[:in_reply_to_id].blank? ? nil : Status.find(status_params[:in_reply_to_id]), + thread: thread, media_ids: status_params[:media_ids], sensitive: status_params[:sensitive], spoiler_text: status_params[:spoiler_text],