]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Sun, 8 Mar 2020 18:38:53 +0000 (19:38 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 8 Mar 2020 18:38:53 +0000 (19:38 +0100)
Conflicts:
- `app/controllers/api/v1/statuses_controller.rb`:
  Conflict due to upstream adding a new parameter (with_rate_limit),
  too close to glitch-soc's own additional parameter (content_type).
  Added upstream's parameter.
- `app/services/post_status_service.rb`:
  Conflict due to upstream adding a new parameter (rate_limit),
  too close to glitch-soc's own additional parameter (content_type).
  Added upstream's parameter.
- `app/views/settings/preferences/appearance/show.html.haml`:
  Conflict due to us not exposing theme settings here (as we have
  a different flavour/skin menu).
  Took upstream change, while still not exposing theme settings.
- `config/webpack/shared.js`:
  Coding style fixes for a part we have rewritten.
  Discarded upstream changes.

28 files changed:
1  2 
Gemfile
Gemfile.lock
app/controllers/api/v1/mutes_controller.rb
app/controllers/api/v1/notifications_controller.rb
app/controllers/api/v1/statuses_controller.rb
app/controllers/api/v2/search_controller.rb
app/controllers/application_controller.rb
app/controllers/authorize_interactions_controller.rb
app/javascript/mastodon/features/compose/components/poll_form.js
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/styles/mastodon/components.scss
app/models/account.rb
app/models/media_attachment.rb
app/models/status.rb
app/services/post_status_service.rb
app/services/reblog_service.rb
app/views/admin/settings/edit.html.haml
app/views/settings/preferences/appearance/show.html.haml
app/views/settings/preferences/other/show.html.haml
app/views/settings/profiles/show.html.haml
config/locales/en.yml
config/locales/simple_form.en.yml
config/routes.rb
config/webpack/shared.js
lib/mastodon/statuses_cli.rb
package.json
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index 3b3a3994326db50c95c5b14712fda043b20e9e13,65439fe9bc1505e9005b1d8719ab4b1483df1541..5dc047b43d3378f8c72d6ebcd22479c23f6e0d93
@@@ -5,10 -5,8 +5,8 @@@ class Api::V1::MutesController < Api::B
    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
  
index 486004f9cdc98b5dc058dba39c71684d7893cd82,2f55e95fd2a4a1facfb7720bad4e71b65d44655c..544e8e3c932347f42c9a9dd85a6577644985eb72
@@@ -44,8 -44,8 +44,9 @@@ class Api::V1::StatusesController < Api
                                           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
index cac3776bb12d4059bf4125a8d4b13a8944a7dbb2,fa2b0609e2f5f8312c1a71e539e09cac2a6c8654..cc740def21cc739c955cd7b8788c1413967dbeca
@@@ -153,8 -153,9 +153,9 @@@ class PollForm extends ImmutablePureCom
          </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>
Simple merge
Simple merge
Simple merge
index 936e6ac55c9e5f9ee2d4af99a7e86126f25a87a5,2301621ab8b54a0e62ba6419a27d7107b345b28c..5d3b8d725d894ecfb0e7bc847a1ccff82856d3eb
@@@ -47,18 -48,9 +48,18 @@@ class PostStatusService < BaseServic
    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
  
index 0b12f143ca817fe3e6cf25bdf805cd04e1a37472,4b5ae949268e881d98d383ff208a46bbcf940949..0a46509f872726abc653c8e11511b2d0840c0081
@@@ -18,12 -20,18 +20,18 @@@ class ReblogService < BaseServic
  
      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)
index f460cebba38e84ec1ab6232e7e73996b70361ebf,acddf78844e35240436cd6a0481bd7d3fb52f3e4..5453177fdbea22f0e8def72c4e81c6698f9b09de
@@@ -1,9 -1,15 +1,12 @@@
  - 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" }
Simple merge
index ca105defaec5d7c8fc7e1a032b8170f2104769a4,92d51916b0fb8f3aa0afa79a6bb942fca281c5ce..cf8f7120dcc2edd8fb41302e175e4890ff6f8101
@@@ -40,14 -40,10 +40,14 @@@ en
          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
Simple merge
Simple merge
Simple merge
diff --cc package.json
Simple merge
diff --cc yarn.lock
Simple merge