3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/mastodon_command/statuses_controller_patch.rb', line 3
def create
status = MastodonCommand.convert_toot(status_params[:status])
@status = PostStatusService.new.call(
current_user.account,
text: status,
thread: @thread,
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
)
render json: @status, serializer: serializer_for_status
rescue PostStatusService::UnexpectedMentionsError => e
render json: unexpected_accounts_error_json(e), status: 422
end
|