]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Sun, 30 Aug 2020 14:13:08 +0000 (16:13 +0200)
committerThibaut Girka <thib@sitedethib.com>
Sun, 30 Aug 2020 14:13:08 +0000 (16:13 +0200)
Conflicts:
- `app/controllers/accounts_controller.rb`:
  Upstream change too close to a glitch-soc change related to
  instance-local toots. Merged upstream changes.
- `app/services/fan_out_on_write_service.rb`:
  Minor conflict due to glitch-soc's handling of Direct Messages,
  merged upstream changes.
- `yarn.lock`:
  Not really a conflict, caused by glitch-soc-only dependencies
  being textually too close to updated upstream dependencies.
  Merged upstream changes.

19 files changed:
1  2 
Gemfile
Gemfile.lock
app/controllers/accounts_controller.rb
app/controllers/api/v1/notifications_controller.rb
app/controllers/api/v1/timelines/public_controller.rb
app/controllers/auth/sessions_controller.rb
app/controllers/concerns/two_factor_authentication_concern.rb
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/lib/activitypub/activity/create.rb
app/models/media_attachment.rb
app/models/user.rb
app/services/fan_out_on_write_service.rb
config/navigation.rb
config/routes.rb
db/schema.rb
package.json
spec/lib/activitypub/activity/create_spec.rb
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
index e023ca5f8052121be4a049ccf79939eaf3715bc2,bf47faabec8fb2f99c97589a961f8c5b501d5bd5..a16cacc70c8947d6564f9724456876a39dd8993f
@@@ -747,9 -773,8 +774,9 @@@ DEPENDENCIE
    rails-i18n (~> 5.1)
    rails-settings-cached (~> 0.6)
    rdf-normalize (~> 0.4)
 +  redcarpet (~> 3.4)
    redis (~> 4.2)
-   redis-namespace (~> 1.7)
+   redis-namespace (~> 1.8)
    redis-rails (~> 5.0)
    rqrcode (~> 1.1)
    rspec-rails (~> 4.0)
index 5c8cdd1745a8fbaf3c5ce219901326ed2b47f986,d97d88fd928e5f459468d99a6c98ebc26524577d..54106933c740f19add93511c7eca4a06514fe1a5
@@@ -28,9 -27,8 +28,8 @@@ class AccountsController < ApplicationC
            return
          end
  
 -        @pinned_statuses = cache_collection(@account.pinned_statuses, Status) if show_pinned_statuses?
 +        @pinned_statuses = cache_collection(@account.pinned_statuses.not_local_only, Status) if show_pinned_statuses?
-         @statuses        = filtered_status_page
-         @statuses        = cache_collection(@statuses, Status)
+         @statuses        = cached_filtered_status_page
          @rss_url         = rss_url
  
          unless @statuses.empty?
index b449bcadf73b7ba66a1dccdc418aa801357950c3,26d877b0023f2d003f725db3c053221ebc5df1b6..52b5cb323b8fe1a9e1f7bfdae6cae11a3ebe831f
@@@ -28,13 -26,13 +26,15 @@@ class Api::V1::Timelines::PublicControl
        limit_param(DEFAULT_STATUSES_LIMIT),
        params_slice(:max_id, :since_id, :min_id)
      )
+   end
+   def public_statuses
+     statuses = public_timeline_statuses
  
 +    statuses = statuses.not_local_only unless truthy_param?(:local) || truthy_param?(:allow_local_only)
 +
      if truthy_param?(:only_media)
-       # `SELECT DISTINCT id, updated_at` is too slow, so pluck ids at first, and then select id, updated_at with ids.
-       status_ids = statuses.joins(:media_attachments).distinct(:id).pluck(:id)
-       statuses.where(id: status_ids)
+       statuses.joins(:media_attachments).group(:id)
      else
        statuses
      end
index 35c0c27cfc11f46f90f3a332cbea8b46fbd5291a,8a2a86a025e3a13d32a8b914d65c6a2987283f0f..6b043a804fbafab5b30e8d6bdfae52ea283f2fa9
@@@ -42,8 -73,13 +73,14 @@@ module TwoFactorAuthenticationConcer
    def prompt_for_two_factor(user)
      set_locale do
        session[:attempt_user_id] = user.id
 +      use_pack 'auth'
        @body_classes = 'lighter'
+       @webauthn_enabled = user.webauthn_enabled?
+       @scheme_type = if user.webauthn_enabled? && user_params[:otp_attempt].blank?
+                        'webauthn'
+                      else
+                        'totp'
+                      end
        render :two_factor
      end
    end
index f09caaae4fcf6d310c4218bac2cd2553944b5b61,f275feefc500e8af6c88944b813c701228440778..3a9f8397883d8a30e2fca97c23b00b806b66cb4b
@@@ -352,14 -352,12 +352,14 @@@ class ActivityPub::Activity::Create < A
    end
  
    def visibility_from_audience
-     if equals_or_includes?(audience_to, ActivityPub::TagManager::COLLECTIONS[:public])
+     if audience_to.include?(ActivityPub::TagManager::COLLECTIONS[:public])
        :public
-     elsif equals_or_includes?(audience_cc, ActivityPub::TagManager::COLLECTIONS[:public])
+     elsif audience_cc.include?(ActivityPub::TagManager::COLLECTIONS[:public])
        :unlisted
-     elsif equals_or_includes?(audience_to, @account.followers_url)
+     elsif audience_to.include?(@account.followers_url)
        :private
 +    elsif direct_message == false
 +      :limited
      else
        :direct
      end
  
    def audience_includes?(account)
      uri = ActivityPub::TagManager.instance.uri_for(account)
-     equals_or_includes?(audience_to, uri) || equals_or_includes?(audience_cc, uri)
+     audience_to.include?(uri) || audience_cc.include?(uri)
    end
  
 +  def direct_message
 +    @object['directMessage']
 +  end
 +
    def replied_to_status
      return @replied_to_status if defined?(@replied_to_status)
  
Simple merge
Simple merge
index dd9c1264da6b123454b634d7efed2e6d67d08046,21931c2f1edcdff634ec59068764e345221de0cd..5f3feeed93e0150a08ed4da13682e6da4eaaef6a
@@@ -6,13 -6,7 +6,11 @@@ class FanOutOnWriteService < BaseServic
    def call(status)
      raise Mastodon::RaceConditionError if status.visibility.nil?
  
-     render_anonymous_payload(status)
 +    deliver_to_self(status) if status.account.local?
 +
      if status.direct_visibility?
 +      deliver_to_mentioned_followers(status)
 +      deliver_to_direct_timelines(status)
        deliver_to_own_conversation(status)
      elsif status.limited_visibility?
        deliver_to_mentioned_followers(status)
        deliver_to_lists(status)
      end
  
 -    return if status.account.silenced? || !status.public_visibility? || status.reblog?
 +    return if status.account.silenced? || !status.public_visibility?
 +    return if status.reblog? && !Setting.show_reblogs_in_public_timelines
  
+     render_anonymous_payload(status)
      deliver_to_hashtags(status)
  
 -    return if status.reply? && status.in_reply_to_account_id != status.account_id
 +    return if status.reply? && status.in_reply_to_account_id != status.account_id && !Setting.show_replies_in_public_timelines
  
      deliver_to_public(status)
      deliver_to_media(status) if status.media_attachments.any?
Simple merge
Simple merge
diff --cc db/schema.rb
Simple merge
diff --cc package.json
index 846828647a52ec50d5c2b3a0aa9f096a5eda1616,078ce1fc98d7782e2656570bd145fe3c336f7fc6..658944c7e47d2a7b2c2164a4e73aa9dea696593a
      "@babel/plugin-proposal-class-properties": "^7.8.3",
      "@babel/plugin-proposal-decorators": "^7.10.5",
      "@babel/plugin-transform-react-inline-elements": "^7.10.4",
-     "@babel/plugin-transform-runtime": "^7.10.5",
+     "@babel/plugin-transform-runtime": "^7.11.0",
      "@babel/preset-env": "^7.11.0",
      "@babel/preset-react": "^7.10.4",
-     "@babel/runtime": "^7.8.4",
-     "@clusterws/cws": "^2.0.0",
+     "@babel/runtime": "^7.11.2",
+     "@clusterws/cws": "^3.0.0",
      "@gamestdio/websocket": "^0.3.2",
+     "@github/webauthn-json": "^0.4.2",
      "@rails/ujs": "^6.0.3",
      "array-includes": "^3.1.1",
 +    "atrament": "0.2.4",
      "arrow-key-navigation": "^1.2.0",
-     "autoprefixer": "^9.8.5",
+     "autoprefixer": "^9.8.6",
      "axios": "^0.19.2",
      "babel-loader": "^8.1.0",
      "babel-plugin-lodash": "^3.3.4",
diff --cc yarn.lock
index 6f0c4e058c5b8c305cf4ec2aa37a564a4adee697,52805ef9bc8548e3ef634e2efbec892a4d5c5b74..bc58b51caa00648e3475b42a0ed946b62b9b9ca6
+++ b/yarn.lock
@@@ -2086,19 -2105,14 +2105,19 @@@ atob@^2.1.2
    resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
    integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
  
- autoprefixer@^9.8.5:
-   version "9.8.5"
-   resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.5.tgz#2c225de229ddafe1d1424c02791d0c3e10ccccaa"
-   integrity sha512-C2p5KkumJlsTHoNv9w31NrBRgXhf6eCMteJuHZi2xhkgC+5Vm40MEtCKPhc0qdgAOhox0YPy1SQHTAky05UoKg==
 +atrament@0.2.4:
 +  version "0.2.4"
 +  resolved "https://registry.yarnpkg.com/atrament/-/atrament-0.2.4.tgz#6f78196edfcd194e568b7c0b9c88201ec371ac66"
 +  integrity sha512-hSA9VwW6COMwvRhSEO4uZweZ91YGOdHqwvslNyrJZG+8mzc4qx/qMsDZBuAeXFeWZO/QKtRjIXguOUy1aNMl3A==
 +
+ autoprefixer@^9.8.6:
+   version "9.8.6"
+   resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f"
+   integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg==
    dependencies:
      browserslist "^4.12.0"
-     caniuse-lite "^1.0.30001097"
-     colorette "^1.2.0"
+     caniuse-lite "^1.0.30001109"
+     colorette "^1.2.1"
      normalize-range "^0.1.2"
      num2fraction "^1.2.2"
      postcss "^7.0.32"