2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/newsmast_mastodon/api/v1/statuses_controller_extension.rb', line 2
def create
@status = PostStatusService.new.call(
current_user.account,
text: status_params[:status],
thread: @thread,
quoted_status: @quoted_status,
quote_approval_policy: quote_approval_policy,
media_ids: status_params[:media_ids],
sensitive: status_params[:sensitive],
spoiler_text: status_params[:spoiler_text],
visibility: status_params[:visibility],
language: status_params[:language],
scheduled_at: status_params[:scheduled_at],
application: doorkeeper_token.application,
poll: status_params[:poll],
allowed_mentions: status_params[:allowed_mentions],
idempotency: request.['Idempotency-Key'],
with_rate_limit: true,
local_only: status_params[:local_only]
)
render json: @status, serializer: serializer_for_status
rescue PostStatusService::UnexpectedMentionsError => e
render json: unexpected_accounts_error_json(e), status: 422
end
|