Browse Source

树洞评论匿名

pull/4/head
欧醚 4 years ago
parent
commit
a04935f5c1
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      app/controllers/api/v1/statuses_controller.rb

+ 4
- 2
app/controllers/api/v1/statuses_controller.rb View File

@ -34,9 +34,11 @@ class Api::V1::StatusesController < Api::BaseController
end end
def create 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], 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], media_ids: status_params[:media_ids],
sensitive: status_params[:sensitive], sensitive: status_params[:sensitive],
spoiler_text: status_params[:spoiler_text], spoiler_text: status_params[:spoiler_text],

Loading…
Cancel
Save