Merge commit '34bbb474822391445c8681ef898991e0c6e32e38' into glitch-soc/merge-upstream
Conflicts: - `lib/mastodon/version.rb`: Upstream bumped the Mastodon API version. Did it as well.
This commit is contained in:
commit
f9d1e9a183
13 files changed
+66
-9
No files matched your search
@@ -27,7 +27,9 @@ class Api::V1::Accounts::CredentialsController < Api::BaseController
|
||||
:display_name,
|
||||
:note,
|
||||
:avatar,
|
||||
:avatar_description,
|
||||
:header,
|
||||
:header_description,
|
||||
:locked,
|
||||
:bot,
|
||||
:discoverable,
|
||||
|
||||
@@ -185,7 +185,7 @@ class SwitchingColumnsArea extends PureComponent {
|
||||
|
||||
return (
|
||||
<ColumnsContextProvider multiColumn={!singleColumn}>
|
||||
<ColumnsArea ref={this.setRef} singleColumn={singleColumn} domain={domain} minimalShell={!signedIn && landingPage === 'overview'}>
|
||||
<ColumnsArea ref={this.setRef} singleColumn={singleColumn} domain={domain} minimalShell={!signedIn && landingPage === 'overview' && pathName.startsWith('/overview')}>
|
||||
<WrappedSwitch>
|
||||
<Redirect from='/' to={{pathname: rootRedirect, state: {...this.props.location.state, focusTarget: false}}} exact />
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
"account.familiar_followers_two": "Sekvita de {name1} kaj {name2}",
|
||||
"account.featured": "Elstarigitaj",
|
||||
"account.featured.accounts": "Profiloj",
|
||||
"account.featured.collections": "Kolektoj",
|
||||
"account.follow": "Sekvi",
|
||||
"account.follow_back": "Sekvu reen",
|
||||
"account.follow_back_short": "Sekvu reen",
|
||||
|
||||
@@ -1138,6 +1138,9 @@
|
||||
"report.categories.spam": "Rämpspost",
|
||||
"report.categories.violation": "Sisu, mis rikub ühte või enamat serveri reeglit",
|
||||
"report.category.subtitle": "Vali parim vaste",
|
||||
"report.category.title_account": "Selgita, mis on selle profiiliga valesti",
|
||||
"report.category.title_collection": "Selgita, mis on selle kogumikuga valesti",
|
||||
"report.category.title_status": "Selgita, mis on selle postitusega valesti",
|
||||
"report.close": "Valmis",
|
||||
"report.comment.title": "Kas arvad, et on veel midagi, mida me peaks teadma?",
|
||||
"report.forward": "Edasta ka {target} domeeni",
|
||||
|
||||
@@ -58,7 +58,7 @@ module User::LdapAuthenticable
|
||||
if [:simple_tls, :start_tls].include?(Devise.ldap_method)
|
||||
opts[:encryption] = {
|
||||
method: Devise.ldap_method,
|
||||
tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.tap { |options| options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if Devise.ldap_tls_no_verify },
|
||||
tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.dup.tap { |options| options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if Devise.ldap_tls_no_verify },
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
+3
-2
@@ -46,6 +46,7 @@ class Tag < ApplicationRecord
|
||||
HASHTAG_INVALID_CHARS_RE = /[^[:alnum:]\u0E47-\u0E4E#{HASHTAG_SEPARATORS}]/
|
||||
|
||||
RECENT_STATUS_LIMIT = 1000
|
||||
RECENT_STATUS_MAX_AGE = 1.year
|
||||
|
||||
validates :name, presence: true, format: { with: HASHTAG_NAME_RE }
|
||||
validates :display_name, format: { with: HASHTAG_NAME_RE }
|
||||
@@ -58,11 +59,11 @@ class Tag < ApplicationRecord
|
||||
scope :listable, -> { where(listable: [true, nil]) }
|
||||
scope :trendable, -> { Setting.trendable_by_default ? where(trendable: [true, nil]) : where(trendable: true) }
|
||||
scope :not_trendable, -> { where(trendable: false) }
|
||||
scope :suggestions_for_account, ->(account) { recently_used(account).not_featured_by(account) }
|
||||
scope :suggestions_for_account, ->(account) { recently_used(account).having('count(statuses.id) > 1').not_featured_by(account) }
|
||||
scope :not_featured_by, ->(account) { where.not(id: account.featured_tags.select(:tag_id)) }
|
||||
scope :recently_used, lambda { |account|
|
||||
joins(:statuses)
|
||||
.where(statuses: { id: account.statuses.select(:id).limit(RECENT_STATUS_LIMIT) })
|
||||
.where(statuses: { id: account.statuses.select(:id).where(id: (Mastodon::Snowflake.id_at(RECENT_STATUS_MAX_AGE.ago)..)).limit(RECENT_STATUS_LIMIT) })
|
||||
.group(:id).order(Arel.star.count.desc)
|
||||
}
|
||||
scope :matches_name, ->(term) { where(arel_table[:name].lower.matches(arel_table.lower("#{sanitize_sql_like(normalize_value_for(:name, term))}%"), nil, true)) } # Search with case-sensitive to use B-tree index
|
||||
|
||||
@@ -9,10 +9,10 @@ zh-CN:
|
||||
already_authenticated: 你已登录。
|
||||
closed_registrations: 你的注册因为网络政策已被阻止。若你认为这是错误,请联系 %{email}。
|
||||
inactive: 你还没有激活账号。
|
||||
invalid: "%{authentication_keys} 无效或密码错误。"
|
||||
invalid: "%{authentication_keys}无效或密码错误。"
|
||||
last_attempt: 你只有最后一次尝试机会,若未通过,账号将被锁定。
|
||||
locked: 你的账号已被锁定。
|
||||
not_found_in_database: "%{authentication_keys}或密码错误。"
|
||||
not_found_in_database: "%{authentication_keys}无效或密码错误。"
|
||||
omniauth_user_creation_failure: 为此身份创建账号时出错。
|
||||
pending: 你的账号仍在审核中。
|
||||
timeout: 你的会话已过期。请重新登录再继续操作。
|
||||
|
||||
@@ -514,6 +514,7 @@ et:
|
||||
hint: Mitte keegi pole seda kontot veel tellinud.
|
||||
no_subscribers_yet: Tellijaid veel pole
|
||||
enable_feature: Lülita funktsionaalsus sisse
|
||||
view_account: Vaata kasutajakontot
|
||||
status: Olek
|
||||
subscribers: Tellijad
|
||||
title: Meililistid
|
||||
@@ -723,6 +724,8 @@ et:
|
||||
new:
|
||||
title: Uue IP-reegli lisamine
|
||||
no_ip_block_selected: Ühtegi IP-reeglit ei muudetud, kuna midagi polnud valitud
|
||||
reset: Lähtesta
|
||||
search: Otsi
|
||||
title: IP-reeglid
|
||||
relationships:
|
||||
title: "%{acct}-i suhted"
|
||||
|
||||
@@ -1886,7 +1886,7 @@ gl:
|
||||
mention:
|
||||
action: Responder
|
||||
body: "%{name} mencionoute en:"
|
||||
subject: Foches mencionada por %{name}
|
||||
subject: "%{name} mencionoute"
|
||||
title: Nova mención
|
||||
moderation_warning:
|
||||
subject: Recibiches unha advertencia da moderación
|
||||
|
||||
@@ -542,7 +542,7 @@ zh-CN:
|
||||
index:
|
||||
disabled:
|
||||
cannot_be_enabled: 你的技术提供商尚未为你的服务器启用此功能。
|
||||
description: 此功能允许指定账号在个人资料页添加微件小工具,使没有 Mastodon 账号的访客也能通过电子邮件接受此账号的嘟文。
|
||||
description: 此功能允许指定账号在个人资料页添加小组件,使没有 Mastodon 账号的访客也能通过电子邮件接受此账号的嘟文。
|
||||
get_started: 开始使用
|
||||
lead: 允许访客通过电子邮件接收此服务器上指定账号的内容。
|
||||
title: 邮件电子报
|
||||
|
||||
@@ -45,7 +45,7 @@ module Mastodon
|
||||
|
||||
def api_versions
|
||||
{
|
||||
mastodon: 10,
|
||||
mastodon: 11,
|
||||
glitch: 1,
|
||||
}
|
||||
end
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe User::LdapAuthenticable do
|
||||
describe '::ldap_options' do
|
||||
subject { User.ldap_options }
|
||||
|
||||
it 'returns a hash' do
|
||||
expect(subject).to be_a Hash
|
||||
end
|
||||
|
||||
context 'when `Devise.ldap_method` is `simple_tls`' do
|
||||
before do
|
||||
Devise.ldap_method = :simple_tls
|
||||
end
|
||||
|
||||
after do
|
||||
Devise.ldap_method = nil
|
||||
end
|
||||
|
||||
it 'includes `encryption` key' do
|
||||
expect(subject).to have_key :encryption
|
||||
end
|
||||
|
||||
context 'when `Devise.ldap_tls_no_verify` is set to `true`' do
|
||||
before do
|
||||
Devise.ldap_tls_no_verify = true
|
||||
end
|
||||
|
||||
after do
|
||||
Devise.ldap_tls_no_verify = false
|
||||
end
|
||||
|
||||
it 'sets `verify_mode` correctly' do
|
||||
expect(subject[:encryption][:tls_options][:verify_mode]).to eq OpenSSL::SSL::VERIFY_NONE
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -12,6 +12,7 @@ RSpec.describe 'Featured Tags Suggestions API' do
|
||||
describe 'GET /api/v1/featured_tags/suggestions' do
|
||||
let!(:unused_featured_tag) { Fabricate(:tag, name: 'unused_featured_tag') }
|
||||
let!(:used_tag) { Fabricate(:tag, name: 'used_tag') }
|
||||
let!(:used_tag_once) { Fabricate(:tag, name: 'used_tag_once') }
|
||||
let!(:used_featured_tag) { Fabricate(:tag, name: 'used_featured_tag') }
|
||||
|
||||
before do
|
||||
@@ -20,8 +21,13 @@ RSpec.describe 'Featured Tags Suggestions API' do
|
||||
# Make relevant tags used by account
|
||||
status = Fabricate(:status, account: account)
|
||||
status.tags << used_tag
|
||||
status.tags << used_tag_once
|
||||
status.tags << used_featured_tag
|
||||
|
||||
status2 = Fabricate(:status, account: account)
|
||||
status2.tags << used_tag
|
||||
status2.tags << used_featured_tag
|
||||
|
||||
# Feature the relevant tags
|
||||
Fabricate :featured_tag, account: account, name: unused_featured_tag.name
|
||||
Fabricate :featured_tag, account: account, name: used_featured_tag.name
|
||||
|
||||
Reference in new issue
Block a user