Backend changes to allow handling local-only toots not based on emoji

This commit is contained in:
Thibaut Girka 2018-05-21 20:21:52 +02:00
parent 284a1562fb
commit 71b1d4c694
2 changed files with 4 additions and 1 deletions

View file

@ -45,7 +45,8 @@ class Api::V1::StatusesController < Api::BaseController
application: doorkeeper_token.application, application: doorkeeper_token.application,
poll: status_params[:poll], poll: status_params[:poll],
content_type: status_params[:content_type], content_type: status_params[:content_type],
idempotency: request.headers['Idempotency-Key']) idempotency: request.headers['Idempotency-Key'],
local_only: status_params[:local_only])
render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
end end
@ -77,6 +78,7 @@ class Api::V1::StatusesController < Api::BaseController
:visibility, :visibility,
:scheduled_at, :scheduled_at,
:content_type, :content_type,
:local_only,
media_ids: [], media_ids: [],
poll: [ poll: [
:multiple, :multiple,

View file

@ -164,6 +164,7 @@ class PostStatusService < BaseService
language: language_from_option(@options[:language]) || @account.user&.setting_default_language&.presence || LanguageDetector.instance.detect(@text, @account), language: language_from_option(@options[:language]) || @account.user&.setting_default_language&.presence || LanguageDetector.instance.detect(@text, @account),
application: @options[:application], application: @options[:application],
content_type: @options[:content_type] || @account.user&.setting_default_content_type, content_type: @options[:content_type] || @account.user&.setting_default_content_type,
local_only: @options[:local_only],
}.compact }.compact
end end