before_action :require_user!
after_action :insert_pagination_headers
- respond_to :json
-
def index
- @accounts = load_accounts
+ @data = @accounts = load_accounts
render json: @accounts, each_serializer: REST::AccountSerializer
end
scheduled_at: status_params[:scheduled_at],
application: doorkeeper_token.application,
poll: status_params[:poll],
- idempotency: request.headers['Idempotency-Key'])
+ content_type: status_params[:content_type],
+ idempotency: request.headers['Idempotency-Key'],
+ with_rate_limit: true)
render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
end
</ul>
<div className='poll__footer'>
- <button disabled={options.size >= 4} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
+ <button disabled={options.size >= 5} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
+ {/* eslint-disable-next-line jsx-a11y/no-onchange */}
<select value={expiresIn} onChange={this.handleSelectDuration}>
<option value={300}>{intl.formatMessage(messages.minutes, { number: 5 })}</option>
<option value={1800}>{intl.formatMessage(messages.minutes, { number: 30 })}</option>
private
def preprocess_attributes!
- @text = @options.delete(:spoiler_text) if @text.blank? && @options[:spoiler_text].present?
+ if @text.blank? && @options[:spoiler_text].present?
+ @text = '.'
+ if @media.find(&:video?) || @media.find(&:gifv?)
+ @text = '📹'
+ elsif @media.find(&:audio?)
+ @text = '🎵'
+ elsif @media.find(&:image?)
+ @text = '🖼'
+ end
+ end
@visibility = @options[:visibility] || @account.user&.setting_default_privacy
- @visibility = :unlisted if @visibility == :public && @account.silenced?
+ @visibility = :unlisted if @visibility&.to_sym == :public && @account.silenced?
@scheduled_at = @options[:scheduled_at]&.to_datetime
@scheduled_at = nil if scheduled_in_the_past?
rescue ArgumentError
visibility: @visibility,
language: language_from_option(@options[:language]) || @account.user&.setting_default_language&.presence || LanguageDetector.instance.detect(@text, @account),
application: @options[:application],
+ content_type: @options[:content_type] || @account.user&.setting_default_content_type,
+ rate_limit: @options[:with_rate_limit],
}.compact
end
return reblog unless reblog.nil?
- visibility = options[:visibility] || account.user&.setting_default_privacy
- visibility = reblogged_status.visibility if reblogged_status.hidden?
- reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility)
+ visibility = begin
+ if reblogged_status.hidden?
+ reblogged_status.visibility
+ else
+ options[:visibility] || account.user&.setting_default_privacy
+ end
+ end
+
+ reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility, rate_limit: options[:with_rate_limit])
DistributionWorker.perform_async(reblog.id)
- ActivityPub::DistributionWorker.perform_async(reblog.id)
+ ActivityPub::DistributionWorker.perform_async(reblog.id) unless reblogged_status.local_only?
create_notification(reblog)
bump_potential_friendship(account, reblog)
- content_for :page_title do
= t('settings.appearance')
- = simple_form_for current_user, url: settings_preferences_appearance_path, html: { method: :put } do |f|
+ - content_for :heading_actions do
+ = button_tag t('generic.save_changes'), class: 'button', form: 'edit_user'
+
+ = simple_form_for current_user, url: settings_preferences_appearance_path, html: { method: :put, id: 'edit_user' } do |f|
- .fields-row
- .fields-group.fields-row__column.fields-row__column-6
- = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, selected: I18n.locale, hint: false
- .fields-group.fields-row__column.fields-row__column-6
- = f.input :setting_theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false, hint: false
+ .fields-group
+ = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, selected: I18n.locale, hint: false
- unless I18n.locale == :en
.flash-message{ style: "text-align: unset; color: unset" }
phrase: Will be matched regardless of casing in text or content warning of a toot
scopes: Which APIs the application will be allowed to access. If you select a top-level scope, you don't need to select individual ones.
setting_aggregate_reblogs: Do not show new boosts for toots that have been recently boosted (only affects newly-received boosts)
+ setting_default_content_type_html: When writing toots, assume they are written in raw HTML, unless specified otherwise
+ setting_default_content_type_markdown: When writing toots, assume they are using Markdown for rich text formatting, unless specified otherwise
+ setting_default_content_type_plain: When writing toots, assume they are plain text with no special formatting, unless specified otherwise (default Mastodon behavior)
+ setting_default_language: The language of your toots can be detected automatically, but it's not always accurate
setting_default_sensitive: Sensitive media is hidden by default and can be revealed with a click
setting_display_media_default: Hide media marked as sensitive
- setting_display_media_hide_all: Always hide all media
- setting_display_media_show_all: Always show media marked as sensitive
+ setting_display_media_hide_all: Always hide media
+ setting_display_media_show_all: Always show media
setting_hide_network: Who you follow and who follows you will not be shown on your profile
setting_noindex: Affects your public profile and status pages
setting_show_application: The application you use to toot will be displayed in the detailed view of your toots