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)
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?
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
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
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)
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?
"@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",
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"