From d4ed7e466c41f19e5f9352700c76e7ffc4d28119 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 12 Mar 2024 09:09:11 -0400 Subject: [PATCH 01/45] Extract `by_domain_length` scope in `DomainNormalizable` concern (#29517) --- app/models/concerns/domain_normalizable.rb | 12 ++++++++++++ app/models/domain_block.rb | 2 +- app/models/email_domain_block.rb | 2 +- app/models/preview_card_provider.rb | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/domain_normalizable.rb b/app/models/concerns/domain_normalizable.rb index 8e244c1d8..76f91c5b6 100644 --- a/app/models/concerns/domain_normalizable.rb +++ b/app/models/concerns/domain_normalizable.rb @@ -5,6 +5,18 @@ module DomainNormalizable included do before_validation :normalize_domain + + scope :by_domain_length, -> { order(domain_char_length.desc) } + end + + class_methods do + def domain_char_length + Arel.sql( + <<~SQL.squish + CHAR_LENGTH(domain) + SQL + ) + end end private diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb index e310918e9..b5d1f2e07 100644 --- a/app/models/domain_block.rb +++ b/app/models/domain_block.rb @@ -70,7 +70,7 @@ class DomainBlock < ApplicationRecord segments = uri.normalized_host.split('.') variants = segments.map.with_index { |_, i| segments[i..].join('.') } - where(domain: variants).order(Arel.sql('char_length(domain) desc')).first + where(domain: variants).by_domain_length.first rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError nil end diff --git a/app/models/email_domain_block.rb b/app/models/email_domain_block.rb index 40be59420..f3a86eae8 100644 --- a/app/models/email_domain_block.rb +++ b/app/models/email_domain_block.rb @@ -56,7 +56,7 @@ class EmailDomainBlock < ApplicationRecord end def blocking?(allow_with_approval: false) - blocks = EmailDomainBlock.where(domain: domains_with_variants, allow_with_approval: allow_with_approval).order(Arel.sql('char_length(domain) desc')) + blocks = EmailDomainBlock.where(domain: domains_with_variants, allow_with_approval: allow_with_approval).by_domain_length blocks.each { |block| block.history.add(@attempt_ip) } if @attempt_ip.present? blocks.any? end diff --git a/app/models/preview_card_provider.rb b/app/models/preview_card_provider.rb index 8ba24331b..756707e3f 100644 --- a/app/models/preview_card_provider.rb +++ b/app/models/preview_card_provider.rb @@ -54,6 +54,6 @@ class PreviewCardProvider < ApplicationRecord def self.matching_domain(domain) segments = domain.split('.') - where(domain: segments.map.with_index { |_, i| segments[i..].join('.') }).order(Arel.sql('char_length(domain) desc')).first + where(domain: segments.map.with_index { |_, i| segments[i..].join('.') }).by_domain_length.first end end From 00d94f3ffabda89a2f955212e763cdba3f1f54c6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 12 Mar 2024 13:10:37 -0400 Subject: [PATCH 02/45] Use vanilla JS to get Rails CSRF values (#29403) --- app/javascript/mastodon/utils/log_out.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/utils/log_out.ts b/app/javascript/mastodon/utils/log_out.ts index 3a4cc8ecb..b08a61a6a 100644 --- a/app/javascript/mastodon/utils/log_out.ts +++ b/app/javascript/mastodon/utils/log_out.ts @@ -1,5 +1,3 @@ -import Rails from '@rails/ujs'; - export const logOut = () => { const form = document.createElement('form'); @@ -9,13 +7,18 @@ export const logOut = () => { methodInput.setAttribute('type', 'hidden'); form.appendChild(methodInput); - const csrfToken = Rails.csrfToken(); - const csrfParam = Rails.csrfParam(); + const csrfToken = document.querySelector( + 'meta[name=csrf-token]', + ); + + const csrfParam = document.querySelector( + 'meta[name=csrf-param]', + ); if (csrfParam && csrfToken) { const csrfInput = document.createElement('input'); - csrfInput.setAttribute('name', csrfParam); - csrfInput.setAttribute('value', csrfToken); + csrfInput.setAttribute('name', csrfParam.content); + csrfInput.setAttribute('value', csrfToken.content); csrfInput.setAttribute('type', 'hidden'); form.appendChild(csrfInput); } From 96013cd576ec51a41a7fe06a28225a3e43ca8496 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:22:32 -0400 Subject: [PATCH 03/45] Reduce `RSpec/ExampleLength` in CSP request spec (#29104) --- spec/requests/content_security_policy_spec.rb | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/spec/requests/content_security_policy_spec.rb b/spec/requests/content_security_policy_spec.rb index d4cc40bce..d4447dca4 100644 --- a/spec/requests/content_security_policy_spec.rb +++ b/spec/requests/content_security_policy_spec.rb @@ -3,25 +3,38 @@ require 'rails_helper' describe 'Content-Security-Policy' do - it 'sets the expected CSP headers' do - allow(SecureRandom).to receive(:base64).with(16).and_return('ZbA+JmE7+bK8F5qvADZHuQ==') + before { allow(SecureRandom).to receive(:base64).with(16).and_return('ZbA+JmE7+bK8F5qvADZHuQ==') } + it 'sets the expected CSP headers' do get '/' - expect(response.headers['Content-Security-Policy'].split(';').map(&:strip)).to contain_exactly( - "base-uri 'none'", - "default-src 'none'", - "frame-ancestors 'none'", - "font-src 'self' https://cb6e6126.ngrok.io", - "img-src 'self' data: blob: https://cb6e6126.ngrok.io", - "style-src 'self' https://cb6e6126.ngrok.io 'nonce-ZbA+JmE7+bK8F5qvADZHuQ=='", - "media-src 'self' data: https://cb6e6126.ngrok.io", - "frame-src 'self' https:", - "manifest-src 'self' https://cb6e6126.ngrok.io", - "form-action 'self'", - "child-src 'self' blob: https://cb6e6126.ngrok.io", - "worker-src 'self' blob: https://cb6e6126.ngrok.io", - "connect-src 'self' data: blob: https://cb6e6126.ngrok.io ws://cb6e6126.ngrok.io:4000", - "script-src 'self' https://cb6e6126.ngrok.io 'wasm-unsafe-eval'" - ) + + expect(response_csp_headers) + .to match_array(expected_csp_headers) + end + + def response_csp_headers + response + .headers['Content-Security-Policy'] + .split(';') + .map(&:strip) + end + + def expected_csp_headers + <<~CSP.split("\n").map(&:strip) + base-uri 'none' + child-src 'self' blob: https://cb6e6126.ngrok.io + connect-src 'self' data: blob: https://cb6e6126.ngrok.io ws://cb6e6126.ngrok.io:4000 + default-src 'none' + font-src 'self' https://cb6e6126.ngrok.io + form-action 'self' + frame-ancestors 'none' + frame-src 'self' https: + img-src 'self' data: blob: https://cb6e6126.ngrok.io + manifest-src 'self' https://cb6e6126.ngrok.io + media-src 'self' data: https://cb6e6126.ngrok.io + script-src 'self' https://cb6e6126.ngrok.io 'wasm-unsafe-eval' + style-src 'self' https://cb6e6126.ngrok.io 'nonce-ZbA+JmE7+bK8F5qvADZHuQ==' + worker-src 'self' blob: https://cb6e6126.ngrok.io + CSP end end From 19f0590795500c2a93baa317b79b53efaca2ec88 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:33:03 -0400 Subject: [PATCH 04/45] Add basic coverage for `TagSearchService` class (#29319) --- spec/services/tag_search_service_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/services/tag_search_service_spec.rb diff --git a/spec/services/tag_search_service_spec.rb b/spec/services/tag_search_service_spec.rb new file mode 100644 index 000000000..de42e5407 --- /dev/null +++ b/spec/services/tag_search_service_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe TagSearchService do + describe '#call' do + let!(:one) { Fabricate(:tag, name: 'one') } + + before { Fabricate(:tag, name: 'two') } + + it 'runs a search for tags' do + results = subject.call('#one', limit: 5) + + expect(results) + .to have_attributes( + size: 1, + first: eq(one) + ) + end + end +end From 3eaac3af73eac44accf4abefb273486e90c4c9dd Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:38:57 -0400 Subject: [PATCH 05/45] Use `before_all` block to setup `requests/cache_spec` data (#29437) --- spec/rails_helper.rb | 1 + spec/requests/cache_spec.rb | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 3e84d6873..89fc25bcb 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -21,6 +21,7 @@ require 'paperclip/matchers' require 'capybara/rspec' require 'chewy/rspec' require 'email_spec/rspec' +require 'test_prof/recipes/rspec/before_all' Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } diff --git a/spec/requests/cache_spec.rb b/spec/requests/cache_spec.rb index c56eec16c..91e5b022e 100644 --- a/spec/requests/cache_spec.rb +++ b/spec/requests/cache_spec.rb @@ -39,7 +39,7 @@ module TestEndpoints /api/v1/accounts/lookup?acct=alice /api/v1/statuses/110224538612341312 /api/v1/statuses/110224538612341312/context - /api/v1/polls/12345 + /api/v1/polls/123456789 /api/v1/trends/statuses /api/v1/directory ).freeze @@ -166,14 +166,18 @@ describe 'Caching behavior' do ActionController::Base.allow_forgery_protection = old end - let(:alice) { Fabricate(:account, username: 'alice') } - let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Moderator')) } + let(:alice) { Account.find_by(username: 'alice') } + let(:user) { User.find_by(email: 'user@host.example') } + let(:token) { Doorkeeper::AccessToken.find_by(resource_owner_id: user.id) } - before do - status = Fabricate(:status, account: alice, id: '110224538612341312') - Fabricate(:status, account: alice, id: '110224538643211312', visibility: :private) + before_all do + alice = Fabricate(:account, username: 'alice') + user = Fabricate(:user, email: 'user@host.example', role: UserRole.find_by(name: 'Moderator')) + status = Fabricate(:status, account: alice, id: 110_224_538_612_341_312) + Fabricate(:status, account: alice, id: 110_224_538_643_211_312, visibility: :private) Fabricate(:invite, code: 'abcdef') - Fabricate(:poll, status: status, account: alice, id: '12345') + Fabricate(:poll, status: status, account: alice, id: 123_456_789) + Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') user.account.follow!(alice) end @@ -321,8 +325,6 @@ describe 'Caching behavior' do end context 'with an auth token' do - let!(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } - TestEndpoints::ALWAYS_CACHED.each do |endpoint| describe endpoint do before do @@ -585,8 +587,6 @@ describe 'Caching behavior' do end context 'with an auth token' do - let!(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } - TestEndpoints::ALWAYS_CACHED.each do |endpoint| describe endpoint do before do From 469028b6d3788c1b1e535d6d0b1f9f6e91e26c33 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:39:26 -0400 Subject: [PATCH 06/45] Remove unneeded `type: :service` from spec/services files (#29304) --- spec/services/account_search_service_spec.rb | 2 +- spec/services/account_statuses_cleanup_service_spec.rb | 2 +- .../activitypub/fetch_featured_collection_service_spec.rb | 2 +- .../activitypub/fetch_featured_tags_collection_service_spec.rb | 2 +- spec/services/activitypub/fetch_remote_account_service_spec.rb | 2 +- spec/services/activitypub/fetch_remote_actor_service_spec.rb | 2 +- spec/services/activitypub/fetch_remote_key_service_spec.rb | 2 +- spec/services/activitypub/fetch_remote_status_service_spec.rb | 2 +- spec/services/activitypub/fetch_replies_service_spec.rb | 2 +- spec/services/activitypub/process_account_service_spec.rb | 2 +- spec/services/activitypub/process_collection_service_spec.rb | 2 +- spec/services/activitypub/process_status_update_service_spec.rb | 2 +- spec/services/activitypub/synchronize_followers_service_spec.rb | 2 +- spec/services/after_block_domain_from_account_service_spec.rb | 2 +- spec/services/after_block_service_spec.rb | 2 +- spec/services/app_sign_up_service_spec.rb | 2 +- spec/services/authorize_follow_service_spec.rb | 2 +- spec/services/backup_service_spec.rb | 2 +- spec/services/batched_remove_status_service_spec.rb | 2 +- spec/services/block_domain_service_spec.rb | 2 +- spec/services/block_service_spec.rb | 2 +- spec/services/bootstrap_timeline_service_spec.rb | 2 +- spec/services/clear_domain_media_service_spec.rb | 2 +- spec/services/delete_account_service_spec.rb | 2 +- spec/services/fan_out_on_write_service_spec.rb | 2 +- spec/services/favourite_service_spec.rb | 2 +- spec/services/fetch_link_card_service_spec.rb | 2 +- spec/services/fetch_oembed_service_spec.rb | 2 +- spec/services/fetch_remote_status_service_spec.rb | 2 +- spec/services/fetch_resource_service_spec.rb | 2 +- spec/services/follow_service_spec.rb | 2 +- spec/services/import_service_spec.rb | 2 +- spec/services/mute_service_spec.rb | 2 +- spec/services/notify_service_spec.rb | 2 +- spec/services/post_status_service_spec.rb | 2 +- spec/services/precompute_feed_service_spec.rb | 2 +- spec/services/process_mentions_service_spec.rb | 2 +- spec/services/purge_domain_service_spec.rb | 2 +- spec/services/reblog_service_spec.rb | 2 +- spec/services/reject_follow_service_spec.rb | 2 +- spec/services/remove_from_followers_service_spec.rb | 2 +- spec/services/remove_status_service_spec.rb | 2 +- spec/services/report_service_spec.rb | 2 +- spec/services/resolve_account_service_spec.rb | 2 +- spec/services/resolve_url_service_spec.rb | 2 +- spec/services/search_service_spec.rb | 2 +- spec/services/software_update_check_service_spec.rb | 2 +- spec/services/suspend_account_service_spec.rb | 2 +- spec/services/translate_status_service_spec.rb | 2 +- spec/services/unallow_domain_service_spec.rb | 2 +- spec/services/unblock_domain_service_spec.rb | 2 +- spec/services/unblock_service_spec.rb | 2 +- spec/services/unfollow_service_spec.rb | 2 +- spec/services/unsuspend_account_service_spec.rb | 2 +- spec/services/update_account_service_spec.rb | 2 +- spec/services/update_status_service_spec.rb | 2 +- spec/services/verify_link_service_spec.rb | 2 +- 57 files changed, 57 insertions(+), 57 deletions(-) diff --git a/spec/services/account_search_service_spec.rb b/spec/services/account_search_service_spec.rb index 4f89cd220..5ec088590 100644 --- a/spec/services/account_search_service_spec.rb +++ b/spec/services/account_search_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountSearchService, type: :service do +describe AccountSearchService do describe '#call' do context 'with a query to ignore' do it 'returns empty array for missing query' do diff --git a/spec/services/account_statuses_cleanup_service_spec.rb b/spec/services/account_statuses_cleanup_service_spec.rb index 0ac113f10..403c4632d 100644 --- a/spec/services/account_statuses_cleanup_service_spec.rb +++ b/spec/services/account_statuses_cleanup_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountStatusesCleanupService, type: :service do +describe AccountStatusesCleanupService do let(:account) { Fabricate(:account, username: 'alice', domain: nil) } let(:account_policy) { Fabricate(:account_statuses_cleanup_policy, account: account) } let!(:unrelated_status) { Fabricate(:status, created_at: 3.years.ago) } diff --git a/spec/services/activitypub/fetch_featured_collection_service_spec.rb b/spec/services/activitypub/fetch_featured_collection_service_spec.rb index dab204406..7ea87922a 100644 --- a/spec/services/activitypub/fetch_featured_collection_service_spec.rb +++ b/spec/services/activitypub/fetch_featured_collection_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchFeaturedCollectionService, type: :service do +RSpec.describe ActivityPub::FetchFeaturedCollectionService do subject { described_class.new } let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/account', featured_collection_url: 'https://example.com/account/pinned') } diff --git a/spec/services/activitypub/fetch_featured_tags_collection_service_spec.rb b/spec/services/activitypub/fetch_featured_tags_collection_service_spec.rb index 638278a10..59367b1e3 100644 --- a/spec/services/activitypub/fetch_featured_tags_collection_service_spec.rb +++ b/spec/services/activitypub/fetch_featured_tags_collection_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchFeaturedTagsCollectionService, type: :service do +RSpec.describe ActivityPub::FetchFeaturedTagsCollectionService do subject { described_class.new } let(:collection_url) { 'https://example.com/account/tags' } diff --git a/spec/services/activitypub/fetch_remote_account_service_spec.rb b/spec/services/activitypub/fetch_remote_account_service_spec.rb index 799a70d09..789a705c4 100644 --- a/spec/services/activitypub/fetch_remote_account_service_spec.rb +++ b/spec/services/activitypub/fetch_remote_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchRemoteAccountService, type: :service do +RSpec.describe ActivityPub::FetchRemoteAccountService do subject { described_class.new } let!(:actor) do diff --git a/spec/services/activitypub/fetch_remote_actor_service_spec.rb b/spec/services/activitypub/fetch_remote_actor_service_spec.rb index 4ce42ea56..025051e9f 100644 --- a/spec/services/activitypub/fetch_remote_actor_service_spec.rb +++ b/spec/services/activitypub/fetch_remote_actor_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchRemoteActorService, type: :service do +RSpec.describe ActivityPub::FetchRemoteActorService do subject { described_class.new } let!(:actor) do diff --git a/spec/services/activitypub/fetch_remote_key_service_spec.rb b/spec/services/activitypub/fetch_remote_key_service_spec.rb index 478778cc9..b6fcf3f47 100644 --- a/spec/services/activitypub/fetch_remote_key_service_spec.rb +++ b/spec/services/activitypub/fetch_remote_key_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchRemoteKeyService, type: :service do +RSpec.describe ActivityPub::FetchRemoteKeyService do subject { described_class.new } let(:webfinger) { { subject: 'acct:alice@example.com', links: [{ rel: 'self', href: 'https://example.com/alice' }] } } diff --git a/spec/services/activitypub/fetch_remote_status_service_spec.rb b/spec/services/activitypub/fetch_remote_status_service_spec.rb index 0fb32d20b..a86f141fe 100644 --- a/spec/services/activitypub/fetch_remote_status_service_spec.rb +++ b/spec/services/activitypub/fetch_remote_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do +RSpec.describe ActivityPub::FetchRemoteStatusService do include ActionView::Helpers::TextHelper subject { described_class.new } diff --git a/spec/services/activitypub/fetch_replies_service_spec.rb b/spec/services/activitypub/fetch_replies_service_spec.rb index 8e1f606e2..e7d8d3528 100644 --- a/spec/services/activitypub/fetch_replies_service_spec.rb +++ b/spec/services/activitypub/fetch_replies_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::FetchRepliesService, type: :service do +RSpec.describe ActivityPub::FetchRepliesService do subject { described_class.new } let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') } diff --git a/spec/services/activitypub/process_account_service_spec.rb b/spec/services/activitypub/process_account_service_spec.rb index b13869f35..8b80dafe4 100644 --- a/spec/services/activitypub/process_account_service_spec.rb +++ b/spec/services/activitypub/process_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::ProcessAccountService, type: :service do +RSpec.describe ActivityPub::ProcessAccountService do subject { described_class.new } context 'with property values, an avatar, and a profile header' do diff --git a/spec/services/activitypub/process_collection_service_spec.rb b/spec/services/activitypub/process_collection_service_spec.rb index 63502c546..74df0f910 100644 --- a/spec/services/activitypub/process_collection_service_spec.rb +++ b/spec/services/activitypub/process_collection_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::ProcessCollectionService, type: :service do +RSpec.describe ActivityPub::ProcessCollectionService do subject { described_class.new } let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') } diff --git a/spec/services/activitypub/process_status_update_service_spec.rb b/spec/services/activitypub/process_status_update_service_spec.rb index 67f2f2727..e451d15dc 100644 --- a/spec/services/activitypub/process_status_update_service_spec.rb +++ b/spec/services/activitypub/process_status_update_service_spec.rb @@ -6,7 +6,7 @@ def poll_option_json(name, votes) { type: 'Note', name: name, replies: { type: 'Collection', totalItems: votes } } end -RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do +RSpec.describe ActivityPub::ProcessStatusUpdateService do subject { described_class.new } let!(:status) { Fabricate(:status, text: 'Hello world', account: Fabricate(:account, domain: 'example.com')) } diff --git a/spec/services/activitypub/synchronize_followers_service_spec.rb b/spec/services/activitypub/synchronize_followers_service_spec.rb index f62376ab9..648f9a332 100644 --- a/spec/services/activitypub/synchronize_followers_service_spec.rb +++ b/spec/services/activitypub/synchronize_followers_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::SynchronizeFollowersService, type: :service do +RSpec.describe ActivityPub::SynchronizeFollowersService do subject { described_class.new } let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account', inbox_url: 'http://example.com/inbox') } diff --git a/spec/services/after_block_domain_from_account_service_spec.rb b/spec/services/after_block_domain_from_account_service_spec.rb index 05af12599..2fce424b1 100644 --- a/spec/services/after_block_domain_from_account_service_spec.rb +++ b/spec/services/after_block_domain_from_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe AfterBlockDomainFromAccountService, type: :service do +RSpec.describe AfterBlockDomainFromAccountService do subject { described_class.new } let!(:wolf) { Fabricate(:account, username: 'wolf', domain: 'evil.org', inbox_url: 'https://evil.org/inbox', protocol: :activitypub) } diff --git a/spec/services/after_block_service_spec.rb b/spec/services/after_block_service_spec.rb index d81bba1d8..82825dad9 100644 --- a/spec/services/after_block_service_spec.rb +++ b/spec/services/after_block_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe AfterBlockService, type: :service do +RSpec.describe AfterBlockService do subject { described_class.new.call(account, target_account) } let(:account) { Fabricate(:account) } diff --git a/spec/services/app_sign_up_service_spec.rb b/spec/services/app_sign_up_service_spec.rb index b37b6da1f..ec7b7516f 100644 --- a/spec/services/app_sign_up_service_spec.rb +++ b/spec/services/app_sign_up_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe AppSignUpService, type: :service do +RSpec.describe AppSignUpService do subject { described_class.new } let(:app) { Fabricate(:application, scopes: 'read write') } diff --git a/spec/services/authorize_follow_service_spec.rb b/spec/services/authorize_follow_service_spec.rb index 602250ee9..be2a86418 100644 --- a/spec/services/authorize_follow_service_spec.rb +++ b/spec/services/authorize_follow_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe AuthorizeFollowService, type: :service do +RSpec.describe AuthorizeFollowService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/backup_service_spec.rb b/spec/services/backup_service_spec.rb index 806ba1832..b4cb60083 100644 --- a/spec/services/backup_service_spec.rb +++ b/spec/services/backup_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe BackupService, type: :service do +RSpec.describe BackupService do subject(:service_call) { described_class.new.call(backup) } let!(:user) { Fabricate(:user) } diff --git a/spec/services/batched_remove_status_service_spec.rb b/spec/services/batched_remove_status_service_spec.rb index 1c59d5ed0..e501b9ba8 100644 --- a/spec/services/batched_remove_status_service_spec.rb +++ b/spec/services/batched_remove_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe BatchedRemoveStatusService, :sidekiq_inline, type: :service do +RSpec.describe BatchedRemoveStatusService, :sidekiq_inline do subject { described_class.new } let!(:alice) { Fabricate(:account) } diff --git a/spec/services/block_domain_service_spec.rb b/spec/services/block_domain_service_spec.rb index 7ad00fff6..0f278293a 100644 --- a/spec/services/block_domain_service_spec.rb +++ b/spec/services/block_domain_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe BlockDomainService, type: :service do +RSpec.describe BlockDomainService do subject { described_class.new } let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') } diff --git a/spec/services/block_service_spec.rb b/spec/services/block_service_spec.rb index 9e4ff8e59..e72e52825 100644 --- a/spec/services/block_service_spec.rb +++ b/spec/services/block_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe BlockService, type: :service do +RSpec.describe BlockService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/bootstrap_timeline_service_spec.rb b/spec/services/bootstrap_timeline_service_spec.rb index 721a0337f..c99813bce 100644 --- a/spec/services/bootstrap_timeline_service_spec.rb +++ b/spec/services/bootstrap_timeline_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe BootstrapTimelineService, type: :service do +RSpec.describe BootstrapTimelineService do subject { described_class.new } context 'when the new user has registered from an invite' do diff --git a/spec/services/clear_domain_media_service_spec.rb b/spec/services/clear_domain_media_service_spec.rb index 9766e62de..f1e5097a9 100644 --- a/spec/services/clear_domain_media_service_spec.rb +++ b/spec/services/clear_domain_media_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ClearDomainMediaService, type: :service do +RSpec.describe ClearDomainMediaService do subject { described_class.new } let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') } diff --git a/spec/services/delete_account_service_spec.rb b/spec/services/delete_account_service_spec.rb index 1965b7daa..de9386243 100644 --- a/spec/services/delete_account_service_spec.rb +++ b/spec/services/delete_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe DeleteAccountService, type: :service do +RSpec.describe DeleteAccountService do shared_examples 'common behavior' do subject { described_class.new.call(account) } diff --git a/spec/services/fan_out_on_write_service_spec.rb b/spec/services/fan_out_on_write_service_spec.rb index 77237dffb..b51d802a5 100644 --- a/spec/services/fan_out_on_write_service_spec.rb +++ b/spec/services/fan_out_on_write_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe FanOutOnWriteService, type: :service do +RSpec.describe FanOutOnWriteService do subject { described_class.new } let(:last_active_at) { Time.now.utc } diff --git a/spec/services/favourite_service_spec.rb b/spec/services/favourite_service_spec.rb index 3143e7b66..d0f1ff17c 100644 --- a/spec/services/favourite_service_spec.rb +++ b/spec/services/favourite_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe FavouriteService, type: :service do +RSpec.describe FavouriteService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/fetch_link_card_service_spec.rb b/spec/services/fetch_link_card_service_spec.rb index d8ca310b2..63ebc3b97 100644 --- a/spec/services/fetch_link_card_service_spec.rb +++ b/spec/services/fetch_link_card_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe FetchLinkCardService, type: :service do +RSpec.describe FetchLinkCardService do subject { described_class.new } let(:html) { 'Hello world' } diff --git a/spec/services/fetch_oembed_service_spec.rb b/spec/services/fetch_oembed_service_spec.rb index 777cbae3f..c9f84048b 100644 --- a/spec/services/fetch_oembed_service_spec.rb +++ b/spec/services/fetch_oembed_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe FetchOEmbedService, type: :service do +describe FetchOEmbedService do subject { described_class.new } before do diff --git a/spec/services/fetch_remote_status_service_spec.rb b/spec/services/fetch_remote_status_service_spec.rb index 798740c9b..a9c61e7b4 100644 --- a/spec/services/fetch_remote_status_service_spec.rb +++ b/spec/services/fetch_remote_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe FetchRemoteStatusService, type: :service do +RSpec.describe FetchRemoteStatusService do let(:account) { Fabricate(:account, domain: 'example.org', uri: 'https://example.org/foo') } let(:prefetched_body) { nil } diff --git a/spec/services/fetch_resource_service_spec.rb b/spec/services/fetch_resource_service_spec.rb index 78037a06c..ee4810571 100644 --- a/spec/services/fetch_resource_service_spec.rb +++ b/spec/services/fetch_resource_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe FetchResourceService, type: :service do +RSpec.describe FetchResourceService do describe '#call' do subject { described_class.new.call(url) } diff --git a/spec/services/follow_service_spec.rb b/spec/services/follow_service_spec.rb index cf4de34c8..bea2412a3 100644 --- a/spec/services/follow_service_spec.rb +++ b/spec/services/follow_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe FollowService, type: :service do +RSpec.describe FollowService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/import_service_spec.rb b/spec/services/import_service_spec.rb index 7d005c8a1..90877d999 100644 --- a/spec/services/import_service_spec.rb +++ b/spec/services/import_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ImportService, :sidekiq_inline, type: :service do +RSpec.describe ImportService, :sidekiq_inline do include RoutingHelper let!(:account) { Fabricate(:account, locked: false) } diff --git a/spec/services/mute_service_spec.rb b/spec/services/mute_service_spec.rb index a2ca2ffe1..681afc0b1 100644 --- a/spec/services/mute_service_spec.rb +++ b/spec/services/mute_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe MuteService, type: :service do +RSpec.describe MuteService do subject { described_class.new.call(account, target_account) } let(:account) { Fabricate(:account) } diff --git a/spec/services/notify_service_spec.rb b/spec/services/notify_service_spec.rb index 57ff326c7..514f634d7 100644 --- a/spec/services/notify_service_spec.rb +++ b/spec/services/notify_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe NotifyService, type: :service do +RSpec.describe NotifyService do subject { described_class.new.call(recipient, type, activity) } let(:user) { Fabricate(:user) } diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index acbebc505..ee68092a3 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe PostStatusService, type: :service do +RSpec.describe PostStatusService do subject { described_class.new } it 'creates a new status' do diff --git a/spec/services/precompute_feed_service_spec.rb b/spec/services/precompute_feed_service_spec.rb index 663babae8..9b2c6c280 100644 --- a/spec/services/precompute_feed_service_spec.rb +++ b/spec/services/precompute_feed_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe PrecomputeFeedService, type: :service do +RSpec.describe PrecomputeFeedService do subject { described_class.new } describe 'call' do diff --git a/spec/services/process_mentions_service_spec.rb b/spec/services/process_mentions_service_spec.rb index 0db73c41f..2c202d3e5 100644 --- a/spec/services/process_mentions_service_spec.rb +++ b/spec/services/process_mentions_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ProcessMentionsService, type: :service do +RSpec.describe ProcessMentionsService do subject { described_class.new } let(:account) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/purge_domain_service_spec.rb b/spec/services/purge_domain_service_spec.rb index 6d8af14de..a5c49160d 100644 --- a/spec/services/purge_domain_service_spec.rb +++ b/spec/services/purge_domain_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe PurgeDomainService, type: :service do +RSpec.describe PurgeDomainService do subject { described_class.new } let(:domain) { 'obsolete.org' } diff --git a/spec/services/reblog_service_spec.rb b/spec/services/reblog_service_spec.rb index e5d0a2d6c..f807536a2 100644 --- a/spec/services/reblog_service_spec.rb +++ b/spec/services/reblog_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ReblogService, type: :service do +RSpec.describe ReblogService do let(:alice) { Fabricate(:account, username: 'alice') } context 'when creates a reblog with appropriate visibility' do diff --git a/spec/services/reject_follow_service_spec.rb b/spec/services/reject_follow_service_spec.rb index 48316a6c4..98aaf7047 100644 --- a/spec/services/reject_follow_service_spec.rb +++ b/spec/services/reject_follow_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe RejectFollowService, type: :service do +RSpec.describe RejectFollowService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/remove_from_followers_service_spec.rb b/spec/services/remove_from_followers_service_spec.rb index 21da38a97..d6420f767 100644 --- a/spec/services/remove_from_followers_service_spec.rb +++ b/spec/services/remove_from_followers_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe RemoveFromFollowersService, type: :service do +RSpec.describe RemoveFromFollowersService do subject { described_class.new } let(:bob) { Fabricate(:account, username: 'bob') } diff --git a/spec/services/remove_status_service_spec.rb b/spec/services/remove_status_service_spec.rb index 109acfb09..b385cfa55 100644 --- a/spec/services/remove_status_service_spec.rb +++ b/spec/services/remove_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe RemoveStatusService, :sidekiq_inline, type: :service do +RSpec.describe RemoveStatusService, :sidekiq_inline do subject { described_class.new } let!(:alice) { Fabricate(:account) } diff --git a/spec/services/report_service_spec.rb b/spec/services/report_service_spec.rb index 2caeb189d..141dc8c3b 100644 --- a/spec/services/report_service_spec.rb +++ b/spec/services/report_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ReportService, type: :service do +RSpec.describe ReportService do subject { described_class.new } let(:source_account) { Fabricate(:account) } diff --git a/spec/services/resolve_account_service_spec.rb b/spec/services/resolve_account_service_spec.rb index b82e5b386..316266c8f 100644 --- a/spec/services/resolve_account_service_spec.rb +++ b/spec/services/resolve_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ResolveAccountService, type: :service do +RSpec.describe ResolveAccountService do subject { described_class.new } before do diff --git a/spec/services/resolve_url_service_spec.rb b/spec/services/resolve_url_service_spec.rb index 5270cc10d..3d59a55f1 100644 --- a/spec/services/resolve_url_service_spec.rb +++ b/spec/services/resolve_url_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe ResolveURLService, type: :service do +describe ResolveURLService do subject { described_class.new } describe '#call' do diff --git a/spec/services/search_service_spec.rb b/spec/services/search_service_spec.rb index 39adf4387..394ee7c3a 100644 --- a/spec/services/search_service_spec.rb +++ b/spec/services/search_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe SearchService, type: :service do +describe SearchService do subject { described_class.new } describe '#call' do diff --git a/spec/services/software_update_check_service_spec.rb b/spec/services/software_update_check_service_spec.rb index c8821348a..a1eb9d86e 100644 --- a/spec/services/software_update_check_service_spec.rb +++ b/spec/services/software_update_check_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe SoftwareUpdateCheckService, type: :service do +RSpec.describe SoftwareUpdateCheckService do subject { described_class.new } shared_examples 'when the feature is enabled' do diff --git a/spec/services/suspend_account_service_spec.rb b/spec/services/suspend_account_service_spec.rb index 4a5f8a0b6..d62f7ef0d 100644 --- a/spec/services/suspend_account_service_spec.rb +++ b/spec/services/suspend_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe SuspendAccountService, :sidekiq_inline, type: :service do +RSpec.describe SuspendAccountService, :sidekiq_inline do shared_examples 'common behavior' do subject { described_class.new.call(account) } diff --git a/spec/services/translate_status_service_spec.rb b/spec/services/translate_status_service_spec.rb index 5f6418f5d..0779fbbe6 100644 --- a/spec/services/translate_status_service_spec.rb +++ b/spec/services/translate_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe TranslateStatusService, type: :service do +RSpec.describe TranslateStatusService do subject(:service) { described_class.new } let(:status) { Fabricate(:status, text: text, spoiler_text: spoiler_text, language: 'en', preloadable_poll: poll, media_attachments: media_attachments) } diff --git a/spec/services/unallow_domain_service_spec.rb b/spec/services/unallow_domain_service_spec.rb index 383977d35..caec3d596 100644 --- a/spec/services/unallow_domain_service_spec.rb +++ b/spec/services/unallow_domain_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe UnallowDomainService, type: :service do +RSpec.describe UnallowDomainService do subject { described_class.new } let(:bad_domain) { 'evil.org' } diff --git a/spec/services/unblock_domain_service_spec.rb b/spec/services/unblock_domain_service_spec.rb index 3d6d82ff6..289ddfc21 100644 --- a/spec/services/unblock_domain_service_spec.rb +++ b/spec/services/unblock_domain_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe UnblockDomainService, type: :service do +describe UnblockDomainService do subject { described_class.new } describe 'call' do diff --git a/spec/services/unblock_service_spec.rb b/spec/services/unblock_service_spec.rb index 9813c5e7f..4c9fcb9ae 100644 --- a/spec/services/unblock_service_spec.rb +++ b/spec/services/unblock_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe UnblockService, type: :service do +RSpec.describe UnblockService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/unfollow_service_spec.rb b/spec/services/unfollow_service_spec.rb index 18a25a676..bba17a8d2 100644 --- a/spec/services/unfollow_service_spec.rb +++ b/spec/services/unfollow_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe UnfollowService, type: :service do +RSpec.describe UnfollowService do subject { described_class.new } let(:sender) { Fabricate(:account, username: 'alice') } diff --git a/spec/services/unsuspend_account_service_spec.rb b/spec/services/unsuspend_account_service_spec.rb index c848767cd..79a4441d3 100644 --- a/spec/services/unsuspend_account_service_spec.rb +++ b/spec/services/unsuspend_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe UnsuspendAccountService, type: :service do +RSpec.describe UnsuspendAccountService do shared_context 'with common context' do subject { described_class.new.call(account) } diff --git a/spec/services/update_account_service_spec.rb b/spec/services/update_account_service_spec.rb index 9f4e36862..5204f1f34 100644 --- a/spec/services/update_account_service_spec.rb +++ b/spec/services/update_account_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe UpdateAccountService, type: :service do +RSpec.describe UpdateAccountService do subject { described_class.new } describe 'switching form locked to unlocked accounts', :sidekiq_inline do diff --git a/spec/services/update_status_service_spec.rb b/spec/services/update_status_service_spec.rb index 55651c305..930f673e1 100644 --- a/spec/services/update_status_service_spec.rb +++ b/spec/services/update_status_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe UpdateStatusService, type: :service do +RSpec.describe UpdateStatusService do subject { described_class.new } context 'when nothing changes' do diff --git a/spec/services/verify_link_service_spec.rb b/spec/services/verify_link_service_spec.rb index 289507242..0ce8c9a90 100644 --- a/spec/services/verify_link_service_spec.rb +++ b/spec/services/verify_link_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe VerifyLinkService, type: :service do +RSpec.describe VerifyLinkService do subject { described_class.new } context 'when given a local account' do From 8349b45d6038c4d029b6371ea1caa40c48a8ea3b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:46:11 -0400 Subject: [PATCH 07/45] Accept extra args that we wont verify in `ap/activity/add_spec` (#29005) --- spec/lib/activitypub/activity/add_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/activitypub/activity/add_spec.rb b/spec/lib/activitypub/activity/add_spec.rb index ec6df0171..c0abd9f39 100644 --- a/spec/lib/activitypub/activity/add_spec.rb +++ b/spec/lib/activitypub/activity/add_spec.rb @@ -50,7 +50,7 @@ RSpec.describe ActivityPub::Activity::Add do end it 'fetches the status and pins it' do - allow(service_stub).to receive(:call) do |uri, id: true, on_behalf_of: nil, request_id: nil| # rubocop:disable Lint/UnusedBlockArgument + allow(service_stub).to receive(:call) do |uri, id: true, on_behalf_of: nil, **| expect(uri).to eq 'https://example.com/unknown' expect(id).to be true expect(on_behalf_of&.following?(sender)).to be true @@ -64,7 +64,7 @@ RSpec.describe ActivityPub::Activity::Add do context 'when there is no local follower' do it 'tries to fetch the status' do - allow(service_stub).to receive(:call) do |uri, id: true, on_behalf_of: nil, request_id: nil| # rubocop:disable Lint/UnusedBlockArgument + allow(service_stub).to receive(:call) do |uri, id: true, on_behalf_of: nil, **| expect(uri).to eq 'https://example.com/unknown' expect(id).to be true expect(on_behalf_of).to be_nil From 71eecbfa1fa5a8c2a06d232260ac9d3a4bd77ddb Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:47:09 -0400 Subject: [PATCH 08/45] Move `api/v2/filters/*` to request spec (#28956) --- .../api/v2/filters/keywords_spec.rb} | 31 ++++++++----------- .../api/v2/filters/statuses_spec.rb} | 25 ++++++--------- 2 files changed, 23 insertions(+), 33 deletions(-) rename spec/{controllers/api/v2/filters/keywords_controller_spec.rb => requests/api/v2/filters/keywords_spec.rb} (79%) rename spec/{controllers/api/v2/filters/statuses_controller_spec.rb => requests/api/v2/filters/statuses_spec.rb} (81%) diff --git a/spec/controllers/api/v2/filters/keywords_controller_spec.rb b/spec/requests/api/v2/filters/keywords_spec.rb similarity index 79% rename from spec/controllers/api/v2/filters/keywords_controller_spec.rb rename to spec/requests/api/v2/filters/keywords_spec.rb index 9f25237bc..55fb2afd9 100644 --- a/spec/controllers/api/v2/filters/keywords_controller_spec.rb +++ b/spec/requests/api/v2/filters/keywords_spec.rb @@ -2,25 +2,20 @@ require 'rails_helper' -RSpec.describe Api::V2::Filters::KeywordsController do - render_views - +RSpec.describe 'API V2 Filters Keywords' do let(:user) { Fabricate(:user) } let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } let(:filter) { Fabricate(:custom_filter, account: user.account) } let(:other_user) { Fabricate(:user) } let(:other_filter) { Fabricate(:custom_filter, account: other_user.account) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #index' do + describe 'GET /api/v2/filters/:filter_id/keywords' do let(:scopes) { 'read:filters' } let!(:keyword) { Fabricate(:custom_filter_keyword, custom_filter: filter) } it 'returns http success' do - get :index, params: { filter_id: filter.id } + get "/api/v2/filters/#{filter.id}/keywords", headers: headers expect(response).to have_http_status(200) expect(body_as_json) .to contain_exactly( @@ -30,18 +25,18 @@ RSpec.describe Api::V2::Filters::KeywordsController do context "when trying to access another's user filters" do it 'returns http not found' do - get :index, params: { filter_id: other_filter.id } + get "/api/v2/filters/#{other_filter.id}/keywords", headers: headers expect(response).to have_http_status(404) end end end - describe 'POST #create' do + describe 'POST /api/v2/filters/:filter_id/keywords' do let(:scopes) { 'write:filters' } let(:filter_id) { filter.id } before do - post :create, params: { filter_id: filter_id, keyword: 'magic', whole_word: false } + post "/api/v2/filters/#{filter_id}/keywords", headers: headers, params: { keyword: 'magic', whole_word: false } end it 'creates a filter', :aggregate_failures do @@ -65,12 +60,12 @@ RSpec.describe Api::V2::Filters::KeywordsController do end end - describe 'GET #show' do + describe 'GET /api/v2/filters/keywords/:id' do let(:scopes) { 'read:filters' } let(:keyword) { Fabricate(:custom_filter_keyword, keyword: 'foo', whole_word: false, custom_filter: filter) } before do - get :show, params: { id: keyword.id } + get "/api/v2/filters/keywords/#{keyword.id}", headers: headers end it 'responds with the keyword', :aggregate_failures do @@ -90,12 +85,12 @@ RSpec.describe Api::V2::Filters::KeywordsController do end end - describe 'PUT #update' do + describe 'PUT /api/v2/filters/keywords/:id' do let(:scopes) { 'write:filters' } let(:keyword) { Fabricate(:custom_filter_keyword, custom_filter: filter) } before do - get :update, params: { id: keyword.id, keyword: 'updated' } + put "/api/v2/filters/keywords/#{keyword.id}", headers: headers, params: { keyword: 'updated' } end it 'updates the keyword', :aggregate_failures do @@ -113,12 +108,12 @@ RSpec.describe Api::V2::Filters::KeywordsController do end end - describe 'DELETE #destroy' do + describe 'DELETE /api/v2/filters/keywords/:id' do let(:scopes) { 'write:filters' } let(:keyword) { Fabricate(:custom_filter_keyword, custom_filter: filter) } before do - delete :destroy, params: { id: keyword.id } + delete "/api/v2/filters/keywords/#{keyword.id}", headers: headers end it 'destroys the keyword', :aggregate_failures do diff --git a/spec/controllers/api/v2/filters/statuses_controller_spec.rb b/spec/requests/api/v2/filters/statuses_spec.rb similarity index 81% rename from spec/controllers/api/v2/filters/statuses_controller_spec.rb rename to spec/requests/api/v2/filters/statuses_spec.rb index d9df80397..26d2fb00e 100644 --- a/spec/controllers/api/v2/filters/statuses_controller_spec.rb +++ b/spec/requests/api/v2/filters/statuses_spec.rb @@ -2,25 +2,20 @@ require 'rails_helper' -RSpec.describe Api::V2::Filters::StatusesController do - render_views - +RSpec.describe 'API V2 Filters Statuses' do let(:user) { Fabricate(:user) } let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } let(:filter) { Fabricate(:custom_filter, account: user.account) } let(:other_user) { Fabricate(:user) } let(:other_filter) { Fabricate(:custom_filter, account: other_user.account) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #index' do + describe 'GET /api/v2/filters/:filter_id/statuses' do let(:scopes) { 'read:filters' } let!(:status_filter) { Fabricate(:custom_filter_status, custom_filter: filter) } it 'returns http success' do - get :index, params: { filter_id: filter.id } + get "/api/v2/filters/#{filter.id}/statuses", headers: headers expect(response).to have_http_status(200) expect(body_as_json) .to contain_exactly( @@ -30,7 +25,7 @@ RSpec.describe Api::V2::Filters::StatusesController do context "when trying to access another's user filters" do it 'returns http not found' do - get :index, params: { filter_id: other_filter.id } + get "/api/v2/filters/#{other_filter.id}/statuses", headers: headers expect(response).to have_http_status(404) end end @@ -42,7 +37,7 @@ RSpec.describe Api::V2::Filters::StatusesController do let!(:status) { Fabricate(:status) } before do - post :create, params: { filter_id: filter_id, status_id: status.id } + post "/api/v2/filters/#{filter_id}/statuses", headers: headers, params: { status_id: status.id } end it 'creates a filter', :aggregate_failures do @@ -65,12 +60,12 @@ RSpec.describe Api::V2::Filters::StatusesController do end end - describe 'GET #show' do + describe 'GET /api/v2/filters/statuses/:id' do let(:scopes) { 'read:filters' } let!(:status_filter) { Fabricate(:custom_filter_status, custom_filter: filter) } before do - get :show, params: { id: status_filter.id } + get "/api/v2/filters/statuses/#{status_filter.id}", headers: headers end it 'responds with the filter', :aggregate_failures do @@ -89,12 +84,12 @@ RSpec.describe Api::V2::Filters::StatusesController do end end - describe 'DELETE #destroy' do + describe 'DELETE /api/v2/filters/statuses/:id' do let(:scopes) { 'write:filters' } let(:status_filter) { Fabricate(:custom_filter_status, custom_filter: filter) } before do - delete :destroy, params: { id: status_filter.id } + delete "/api/v2/filters/statuses/#{status_filter.id}", headers: headers end it 'destroys the filter', :aggregate_failures do From 01b624c4a0d17ec24f6acf56298fe9e5e8a6dd49 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:50:21 -0400 Subject: [PATCH 09/45] Use `normalizes` on `CustomFilter#context` value (#27602) --- app/models/custom_filter.rb | 6 +----- spec/models/custom_filter_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/models/custom_filter.rb b/app/models/custom_filter.rb index 5e2d152e3..7c148e877 100644 --- a/app/models/custom_filter.rb +++ b/app/models/custom_filter.rb @@ -41,7 +41,7 @@ class CustomFilter < ApplicationRecord validates :title, :context, presence: true validate :context_must_be_valid - before_validation :clean_up_contexts + normalizes :context, with: ->(context) { context.map(&:strip).filter_map(&:presence) } before_save :prepare_cache_invalidation! before_destroy :prepare_cache_invalidation! @@ -114,10 +114,6 @@ class CustomFilter < ApplicationRecord private - def clean_up_contexts - self.context = Array(context).map(&:strip).filter_map(&:presence) - end - def context_must_be_valid errors.add(:context, I18n.t('filters.errors.invalid_context')) if invalid_context_value? end diff --git a/spec/models/custom_filter_spec.rb b/spec/models/custom_filter_spec.rb index 940493633..8ac9dbb89 100644 --- a/spec/models/custom_filter_spec.rb +++ b/spec/models/custom_filter_spec.rb @@ -32,4 +32,12 @@ RSpec.describe CustomFilter do expect(record).to model_have_error_on_field(:context) end end + + describe 'Normalizations' do + it 'cleans up context values' do + record = described_class.new(context: ['home', 'notifications', 'public ', '']) + + expect(record.context).to eq(%w(home notifications public)) + end + end end From 9754967d5fd37cf35b362d4429d320c1e5f94428 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:51:44 -0400 Subject: [PATCH 10/45] Move `pagination_max_id` and `pagination_since_id` into api/base controller (#28844) --- app/controllers/api/base_controller.rb | 8 ++++++++ app/controllers/api/v1/accounts/statuses_controller.rb | 8 ++------ app/controllers/api/v1/admin/accounts_controller.rb | 8 ++------ .../api/v1/admin/canonical_email_blocks_controller.rb | 8 ++------ app/controllers/api/v1/admin/domain_allows_controller.rb | 8 ++------ app/controllers/api/v1/admin/domain_blocks_controller.rb | 8 ++------ .../api/v1/admin/email_domain_blocks_controller.rb | 8 ++------ app/controllers/api/v1/admin/ip_blocks_controller.rb | 8 ++------ app/controllers/api/v1/admin/reports_controller.rb | 8 ++------ app/controllers/api/v1/admin/tags_controller.rb | 8 ++------ .../trends/links/preview_card_providers_controller.rb | 8 ++------ app/controllers/api/v1/blocks_controller.rb | 8 ++------ app/controllers/api/v1/bookmarks_controller.rb | 8 ++------ .../api/v1/crypto/encrypted_messages_controller.rb | 8 ++------ app/controllers/api/v1/domain_blocks_controller.rb | 8 ++------ app/controllers/api/v1/endorsements_controller.rb | 8 ++------ app/controllers/api/v1/favourites_controller.rb | 8 ++------ app/controllers/api/v1/followed_tags_controller.rb | 8 ++------ app/controllers/api/v1/lists/accounts_controller.rb | 8 ++------ app/controllers/api/v1/mutes_controller.rb | 8 ++------ app/controllers/api/v1/notifications_controller.rb | 8 ++------ app/controllers/api/v1/scheduled_statuses_controller.rb | 8 ++------ app/controllers/api/v1/timelines/base_controller.rb | 8 ++------ 23 files changed, 52 insertions(+), 132 deletions(-) diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index 98fa1897e..8bf9da2cf 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -73,6 +73,14 @@ class Api::BaseController < ApplicationController protected + def pagination_max_id + pagination_collection.last.id + end + + def pagination_since_id + pagination_collection.first.id + end + def set_pagination_headers(next_path = nil, prev_path = nil) links = [] links << [next_path, [%w(rel next)]] if next_path diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index 6a994ff54..56d4e6909 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -51,11 +51,7 @@ class Api::V1::Accounts::StatusesController < Api::BaseController @statuses.size == limit_param(DEFAULT_STATUSES_LIMIT) end - def pagination_max_id - @statuses.last.id - end - - def pagination_since_id - @statuses.first.id + def pagination_collection + @statuses end end diff --git a/app/controllers/api/v1/admin/accounts_controller.rb b/app/controllers/api/v1/admin/accounts_controller.rb index ff9cae639..06cebffcb 100644 --- a/app/controllers/api/v1/admin/accounts_controller.rb +++ b/app/controllers/api/v1/admin/accounts_controller.rb @@ -137,12 +137,8 @@ class Api::V1::Admin::AccountsController < Api::BaseController api_v1_admin_accounts_url(pagination_params(min_id: pagination_since_id)) unless @accounts.empty? end - def pagination_max_id - @accounts.last.id - end - - def pagination_since_id - @accounts.first.id + def pagination_collection + @accounts end def records_continue? diff --git a/app/controllers/api/v1/admin/canonical_email_blocks_controller.rb b/app/controllers/api/v1/admin/canonical_email_blocks_controller.rb index 7b192b979..f81e480bd 100644 --- a/app/controllers/api/v1/admin/canonical_email_blocks_controller.rb +++ b/app/controllers/api/v1/admin/canonical_email_blocks_controller.rb @@ -77,12 +77,8 @@ class Api::V1::Admin::CanonicalEmailBlocksController < Api::BaseController api_v1_admin_canonical_email_blocks_url(pagination_params(min_id: pagination_since_id)) unless @canonical_email_blocks.empty? end - def pagination_max_id - @canonical_email_blocks.last.id - end - - def pagination_since_id - @canonical_email_blocks.first.id + def pagination_collection + @canonical_email_blocks end def records_continue? diff --git a/app/controllers/api/v1/admin/domain_allows_controller.rb b/app/controllers/api/v1/admin/domain_allows_controller.rb index dd54d6710..184129284 100644 --- a/app/controllers/api/v1/admin/domain_allows_controller.rb +++ b/app/controllers/api/v1/admin/domain_allows_controller.rb @@ -73,12 +73,8 @@ class Api::V1::Admin::DomainAllowsController < Api::BaseController api_v1_admin_domain_allows_url(pagination_params(min_id: pagination_since_id)) unless @domain_allows.empty? end - def pagination_max_id - @domain_allows.last.id - end - - def pagination_since_id - @domain_allows.first.id + def pagination_collection + @domain_allows end def records_continue? diff --git a/app/controllers/api/v1/admin/domain_blocks_controller.rb b/app/controllers/api/v1/admin/domain_blocks_controller.rb index 2538c7c7c..8cd90b7c5 100644 --- a/app/controllers/api/v1/admin/domain_blocks_controller.rb +++ b/app/controllers/api/v1/admin/domain_blocks_controller.rb @@ -84,12 +84,8 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController api_v1_admin_domain_blocks_url(pagination_params(min_id: pagination_since_id)) unless @domain_blocks.empty? end - def pagination_max_id - @domain_blocks.last.id - end - - def pagination_since_id - @domain_blocks.first.id + def pagination_collection + @domain_blocks end def records_continue? diff --git a/app/controllers/api/v1/admin/email_domain_blocks_controller.rb b/app/controllers/api/v1/admin/email_domain_blocks_controller.rb index df54b9f0a..34489e19b 100644 --- a/app/controllers/api/v1/admin/email_domain_blocks_controller.rb +++ b/app/controllers/api/v1/admin/email_domain_blocks_controller.rb @@ -70,12 +70,8 @@ class Api::V1::Admin::EmailDomainBlocksController < Api::BaseController api_v1_admin_email_domain_blocks_url(pagination_params(min_id: pagination_since_id)) unless @email_domain_blocks.empty? end - def pagination_max_id - @email_domain_blocks.last.id - end - - def pagination_since_id - @email_domain_blocks.first.id + def pagination_collection + @email_domain_blocks end def records_continue? diff --git a/app/controllers/api/v1/admin/ip_blocks_controller.rb b/app/controllers/api/v1/admin/ip_blocks_controller.rb index 61c191234..0f666476c 100644 --- a/app/controllers/api/v1/admin/ip_blocks_controller.rb +++ b/app/controllers/api/v1/admin/ip_blocks_controller.rb @@ -75,12 +75,8 @@ class Api::V1::Admin::IpBlocksController < Api::BaseController api_v1_admin_ip_blocks_url(pagination_params(min_id: pagination_since_id)) unless @ip_blocks.empty? end - def pagination_max_id - @ip_blocks.last.id - end - - def pagination_since_id - @ip_blocks.first.id + def pagination_collection + @ip_blocks end def records_continue? diff --git a/app/controllers/api/v1/admin/reports_controller.rb b/app/controllers/api/v1/admin/reports_controller.rb index 7129a5f6c..f0598aa81 100644 --- a/app/controllers/api/v1/admin/reports_controller.rb +++ b/app/controllers/api/v1/admin/reports_controller.rb @@ -101,12 +101,8 @@ class Api::V1::Admin::ReportsController < Api::BaseController api_v1_admin_reports_url(pagination_params(min_id: pagination_since_id)) unless @reports.empty? end - def pagination_max_id - @reports.last.id - end - - def pagination_since_id - @reports.first.id + def pagination_collection + @reports end def records_continue? diff --git a/app/controllers/api/v1/admin/tags_controller.rb b/app/controllers/api/v1/admin/tags_controller.rb index 6a7c9f5bf..989e7e610 100644 --- a/app/controllers/api/v1/admin/tags_controller.rb +++ b/app/controllers/api/v1/admin/tags_controller.rb @@ -56,12 +56,8 @@ class Api::V1::Admin::TagsController < Api::BaseController api_v1_admin_tags_url(pagination_params(min_id: pagination_since_id)) unless @tags.empty? end - def pagination_max_id - @tags.last.id - end - - def pagination_since_id - @tags.first.id + def pagination_collection + @tags end def records_continue? diff --git a/app/controllers/api/v1/admin/trends/links/preview_card_providers_controller.rb b/app/controllers/api/v1/admin/trends/links/preview_card_providers_controller.rb index 5d9fcc82c..7ab7e6bd0 100644 --- a/app/controllers/api/v1/admin/trends/links/preview_card_providers_controller.rb +++ b/app/controllers/api/v1/admin/trends/links/preview_card_providers_controller.rb @@ -54,12 +54,8 @@ class Api::V1::Admin::Trends::Links::PreviewCardProvidersController < Api::BaseC api_v1_admin_trends_links_preview_card_providers_url(pagination_params(min_id: pagination_since_id)) unless @providers.empty? end - def pagination_max_id - @providers.last.id - end - - def pagination_since_id - @providers.first.id + def pagination_collection + @providers end def records_continue? diff --git a/app/controllers/api/v1/blocks_controller.rb b/app/controllers/api/v1/blocks_controller.rb index 0934622f8..7826a3c68 100644 --- a/app/controllers/api/v1/blocks_controller.rb +++ b/app/controllers/api/v1/blocks_controller.rb @@ -40,12 +40,8 @@ class Api::V1::BlocksController < Api::BaseController api_v1_blocks_url pagination_params(since_id: pagination_since_id) unless paginated_blocks.empty? end - def pagination_max_id - paginated_blocks.last.id - end - - def pagination_since_id - paginated_blocks.first.id + def pagination_collection + paginated_blocks end def records_continue? diff --git a/app/controllers/api/v1/bookmarks_controller.rb b/app/controllers/api/v1/bookmarks_controller.rb index 498eb16f4..08d3cf834 100644 --- a/app/controllers/api/v1/bookmarks_controller.rb +++ b/app/controllers/api/v1/bookmarks_controller.rb @@ -43,12 +43,8 @@ class Api::V1::BookmarksController < Api::BaseController api_v1_bookmarks_url pagination_params(min_id: pagination_since_id) unless results.empty? end - def pagination_max_id - results.last.id - end - - def pagination_since_id - results.first.id + def pagination_collection + results end def records_continue? diff --git a/app/controllers/api/v1/crypto/encrypted_messages_controller.rb b/app/controllers/api/v1/crypto/encrypted_messages_controller.rb index 68cf4384f..c70ae46d1 100644 --- a/app/controllers/api/v1/crypto/encrypted_messages_controller.rb +++ b/app/controllers/api/v1/crypto/encrypted_messages_controller.rb @@ -41,12 +41,8 @@ class Api::V1::Crypto::EncryptedMessagesController < Api::BaseController api_v1_crypto_encrypted_messages_url pagination_params(min_id: pagination_since_id) unless @encrypted_messages.empty? end - def pagination_max_id - @encrypted_messages.last.id - end - - def pagination_since_id - @encrypted_messages.first.id + def pagination_collection + @encrypted_messages end def records_continue? diff --git a/app/controllers/api/v1/domain_blocks_controller.rb b/app/controllers/api/v1/domain_blocks_controller.rb index 34def3c44..5774c4d1c 100644 --- a/app/controllers/api/v1/domain_blocks_controller.rb +++ b/app/controllers/api/v1/domain_blocks_controller.rb @@ -50,12 +50,8 @@ class Api::V1::DomainBlocksController < Api::BaseController api_v1_domain_blocks_url pagination_params(since_id: pagination_since_id) unless @blocks.empty? end - def pagination_max_id - @blocks.last.id - end - - def pagination_since_id - @blocks.first.id + def pagination_collection + @blocks end def records_continue? diff --git a/app/controllers/api/v1/endorsements_controller.rb b/app/controllers/api/v1/endorsements_controller.rb index 2216a9860..449a9ac24 100644 --- a/app/controllers/api/v1/endorsements_controller.rb +++ b/app/controllers/api/v1/endorsements_controller.rb @@ -44,12 +44,8 @@ class Api::V1::EndorsementsController < Api::BaseController api_v1_endorsements_url pagination_params(since_id: pagination_since_id) unless @accounts.empty? end - def pagination_max_id - @accounts.last.id - end - - def pagination_since_id - @accounts.first.id + def pagination_collection + @accounts end def records_continue? diff --git a/app/controllers/api/v1/favourites_controller.rb b/app/controllers/api/v1/favourites_controller.rb index faf1bda96..85e46b116 100644 --- a/app/controllers/api/v1/favourites_controller.rb +++ b/app/controllers/api/v1/favourites_controller.rb @@ -43,12 +43,8 @@ class Api::V1::FavouritesController < Api::BaseController api_v1_favourites_url pagination_params(min_id: pagination_since_id) unless results.empty? end - def pagination_max_id - results.last.id - end - - def pagination_since_id - results.first.id + def pagination_collection + results end def records_continue? diff --git a/app/controllers/api/v1/followed_tags_controller.rb b/app/controllers/api/v1/followed_tags_controller.rb index eae2bdc01..0ea4a95ef 100644 --- a/app/controllers/api/v1/followed_tags_controller.rb +++ b/app/controllers/api/v1/followed_tags_controller.rb @@ -34,12 +34,8 @@ class Api::V1::FollowedTagsController < Api::BaseController api_v1_followed_tags_url pagination_params(since_id: pagination_since_id) unless @results.empty? end - def pagination_max_id - @results.last.id - end - - def pagination_since_id - @results.first.id + def pagination_collection + @results end def records_continue? diff --git a/app/controllers/api/v1/lists/accounts_controller.rb b/app/controllers/api/v1/lists/accounts_controller.rb index 0604ad60f..5ae74bf04 100644 --- a/app/controllers/api/v1/lists/accounts_controller.rb +++ b/app/controllers/api/v1/lists/accounts_controller.rb @@ -71,12 +71,8 @@ class Api::V1::Lists::AccountsController < Api::BaseController api_v1_list_accounts_url pagination_params(since_id: pagination_since_id) unless @accounts.empty? end - def pagination_max_id - @accounts.last.id - end - - def pagination_since_id - @accounts.first.id + def pagination_collection + @accounts end def records_continue? diff --git a/app/controllers/api/v1/mutes_controller.rb b/app/controllers/api/v1/mutes_controller.rb index 2fb685ac3..9542d9611 100644 --- a/app/controllers/api/v1/mutes_controller.rb +++ b/app/controllers/api/v1/mutes_controller.rb @@ -40,12 +40,8 @@ class Api::V1::MutesController < Api::BaseController api_v1_mutes_url pagination_params(since_id: pagination_since_id) unless paginated_mutes.empty? end - def pagination_max_id - paginated_mutes.last.id - end - - def pagination_since_id - paginated_mutes.first.id + def pagination_collection + paginated_mutes end def records_continue? diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index 52280ef60..777740751 100644 --- a/app/controllers/api/v1/notifications_controller.rb +++ b/app/controllers/api/v1/notifications_controller.rb @@ -70,12 +70,8 @@ class Api::V1::NotificationsController < Api::BaseController api_v1_notifications_url pagination_params(min_id: pagination_since_id) unless @notifications.empty? end - def pagination_max_id - @notifications.last.id - end - - def pagination_since_id - @notifications.first.id + def pagination_collection + @notifications end def browserable_params diff --git a/app/controllers/api/v1/scheduled_statuses_controller.rb b/app/controllers/api/v1/scheduled_statuses_controller.rb index 2220b6d22..f6c070383 100644 --- a/app/controllers/api/v1/scheduled_statuses_controller.rb +++ b/app/controllers/api/v1/scheduled_statuses_controller.rb @@ -63,11 +63,7 @@ class Api::V1::ScheduledStatusesController < Api::BaseController @statuses.size == limit_param(DEFAULT_STATUSES_LIMIT) end - def pagination_max_id - @statuses.last.id - end - - def pagination_since_id - @statuses.first.id + def pagination_collection + @statuses end end diff --git a/app/controllers/api/v1/timelines/base_controller.rb b/app/controllers/api/v1/timelines/base_controller.rb index 173e173cc..7735cf1dc 100644 --- a/app/controllers/api/v1/timelines/base_controller.rb +++ b/app/controllers/api/v1/timelines/base_controller.rb @@ -9,12 +9,8 @@ class Api::V1::Timelines::BaseController < Api::BaseController set_pagination_headers(next_path, prev_path) end - def pagination_max_id - @statuses.last.id - end - - def pagination_since_id - @statuses.first.id + def pagination_collection + @statuses end def next_path_params From 7e6eb64f1e89179f49ebdaddab7f96ac3f53ad05 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:56:37 -0400 Subject: [PATCH 11/45] Use full snowflake range in `admin/metrics` classes (#29416) --- .../admin/metrics/dimension/instance_languages_dimension.rb | 4 ++-- app/lib/admin/metrics/dimension/servers_dimension.rb | 4 ++-- app/lib/admin/metrics/dimension/tag_languages_dimension.rb | 4 ++-- app/lib/admin/metrics/dimension/tag_servers_dimension.rb | 4 ++-- app/lib/admin/metrics/measure/instance_statuses_measure.rb | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/lib/admin/metrics/dimension/instance_languages_dimension.rb b/app/lib/admin/metrics/dimension/instance_languages_dimension.rb index b47821380..661e6d93b 100644 --- a/app/lib/admin/metrics/dimension/instance_languages_dimension.rb +++ b/app/lib/admin/metrics/dimension/instance_languages_dimension.rb @@ -37,11 +37,11 @@ class Admin::Metrics::Dimension::InstanceLanguagesDimension < Admin::Metrics::Di end def earliest_status_id - Mastodon::Snowflake.id_at(@start_at, with_random: false) + Mastodon::Snowflake.id_at(@start_at.beginning_of_day, with_random: false) end def latest_status_id - Mastodon::Snowflake.id_at(@end_at, with_random: false) + Mastodon::Snowflake.id_at(@end_at.end_of_day, with_random: false) end def params diff --git a/app/lib/admin/metrics/dimension/servers_dimension.rb b/app/lib/admin/metrics/dimension/servers_dimension.rb index 42aba8e21..2c8406d52 100644 --- a/app/lib/admin/metrics/dimension/servers_dimension.rb +++ b/app/lib/admin/metrics/dimension/servers_dimension.rb @@ -30,10 +30,10 @@ class Admin::Metrics::Dimension::ServersDimension < Admin::Metrics::Dimension::B end def earliest_status_id - Mastodon::Snowflake.id_at(@start_at) + Mastodon::Snowflake.id_at(@start_at.beginning_of_day, with_random: false) end def latest_status_id - Mastodon::Snowflake.id_at(@end_at) + Mastodon::Snowflake.id_at(@end_at.end_of_day, with_random: false) end end diff --git a/app/lib/admin/metrics/dimension/tag_languages_dimension.rb b/app/lib/admin/metrics/dimension/tag_languages_dimension.rb index cd077ff86..6e283d2c6 100644 --- a/app/lib/admin/metrics/dimension/tag_languages_dimension.rb +++ b/app/lib/admin/metrics/dimension/tag_languages_dimension.rb @@ -40,11 +40,11 @@ class Admin::Metrics::Dimension::TagLanguagesDimension < Admin::Metrics::Dimensi end def earliest_status_id - Mastodon::Snowflake.id_at(@start_at, with_random: false) + Mastodon::Snowflake.id_at(@start_at.beginning_of_day, with_random: false) end def latest_status_id - Mastodon::Snowflake.id_at(@end_at, with_random: false) + Mastodon::Snowflake.id_at(@end_at.end_of_day, with_random: false) end def params diff --git a/app/lib/admin/metrics/dimension/tag_servers_dimension.rb b/app/lib/admin/metrics/dimension/tag_servers_dimension.rb index fc5e49a96..db820e965 100644 --- a/app/lib/admin/metrics/dimension/tag_servers_dimension.rb +++ b/app/lib/admin/metrics/dimension/tag_servers_dimension.rb @@ -40,11 +40,11 @@ class Admin::Metrics::Dimension::TagServersDimension < Admin::Metrics::Dimension end def earliest_status_id - Mastodon::Snowflake.id_at(@start_at, with_random: false) + Mastodon::Snowflake.id_at(@start_at.beginning_of_day, with_random: false) end def latest_status_id - Mastodon::Snowflake.id_at(@end_at, with_random: false) + Mastodon::Snowflake.id_at(@end_at.end_of_day, with_random: false) end def params diff --git a/app/lib/admin/metrics/measure/instance_statuses_measure.rb b/app/lib/admin/metrics/measure/instance_statuses_measure.rb index 8c71c6614..b918a30a5 100644 --- a/app/lib/admin/metrics/measure/instance_statuses_measure.rb +++ b/app/lib/admin/metrics/measure/instance_statuses_measure.rb @@ -51,11 +51,11 @@ class Admin::Metrics::Measure::InstanceStatusesMeasure < Admin::Metrics::Measure end def earliest_status_id - Mastodon::Snowflake.id_at(@start_at, with_random: false) + Mastodon::Snowflake.id_at(@start_at.beginning_of_day, with_random: false) end def latest_status_id - Mastodon::Snowflake.id_at(@end_at, with_random: false) + Mastodon::Snowflake.id_at(@end_at.end_of_day, with_random: false) end def time_period From 2c0441acd7f943a9873b650cf75d33c73d545acf Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 05:19:54 -0400 Subject: [PATCH 12/45] Use rails built-in `tag` methods in `TextFormatter.shortened_link` (#28976) --- app/lib/text_formatter.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index 581ee835b..2b3febc21 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -50,6 +50,7 @@ class TextFormatter class << self include ERB::Util + include ActionView::Helpers::TagHelper def shortened_link(url, rel_me: false) url = Addressable::URI.parse(url).to_s @@ -60,9 +61,11 @@ class TextFormatter suffix = url[prefix.length + 30..] cutoff = url[prefix.length..].length > 30 - <<~HTML.squish.html_safe # rubocop:disable Rails/OutputSafety - #{h(display_url)} - HTML + tag.a href: url, target: '_blank', rel: rel.join(' '), translate: 'no' do + tag.span(prefix, class: 'invisible') + + tag.span(display_url, class: (cutoff ? 'ellipsis' : '')) + + tag.span(suffix, class: 'invisible') + end rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError h(url) end From 46e902f1f373210f75e24bbbdcf0850b20bb1c53 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 05:22:43 -0400 Subject: [PATCH 13/45] Merge `api/v1/accounts/credentials` controller spec into existing request spec (#29006) --- .../accounts/credentials_controller_spec.rb | 105 ------------------ .../api/v1/accounts/credentials_spec.rb | 74 +++++++++--- 2 files changed, 61 insertions(+), 118 deletions(-) delete mode 100644 spec/controllers/api/v1/accounts/credentials_controller_spec.rb diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb deleted file mode 100644 index a62fa54e6..000000000 --- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Accounts::CredentialsController do - render_views - - let(:user) { Fabricate(:user) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } - - context 'with an oauth token' do - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #show' do - let(:scopes) { 'read:accounts' } - - it 'returns http success' do - get :show - expect(response).to have_http_status(200) - end - end - - describe 'PATCH #update' do - let(:scopes) { 'write:accounts' } - - describe 'with valid data' do - before do - allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async) - - patch :update, params: { - display_name: "Alice Isn't Dead", - note: "Hi!\n\nToot toot!", - avatar: fixture_file_upload('avatar.gif', 'image/gif'), - header: fixture_file_upload('attachment.jpg', 'image/jpeg'), - source: { - privacy: 'unlisted', - sensitive: true, - }, - } - end - - it 'updates account info', :aggregate_failures do - expect(response).to have_http_status(200) - - user.reload - user.account.reload - - expect(user.account.display_name).to eq("Alice Isn't Dead") - expect(user.account.note).to eq("Hi!\n\nToot toot!") - expect(user.account.avatar).to exist - expect(user.account.header).to exist - expect(user.setting_default_privacy).to eq('unlisted') - expect(user.setting_default_sensitive).to be(true) - - expect(ActivityPub::UpdateDistributionWorker).to have_received(:perform_async).with(user.account_id) - end - end - - describe 'with empty source list' do - before do - patch :update, params: { - display_name: "I'm a cat", - source: {}, - }, as: :json - end - - it 'returns http success' do - expect(response).to have_http_status(200) - end - end - - describe 'with invalid data' do - before do - patch :update, params: { note: 'This is too long. ' * 30 } - end - - it 'returns http unprocessable entity' do - expect(response).to have_http_status(422) - end - end - end - end - - context 'without an oauth token' do - before do - allow(controller).to receive(:doorkeeper_token).and_return(nil) - end - - describe 'GET #show' do - it 'returns http unauthorized' do - get :show - expect(response).to have_http_status(401) - end - end - - describe 'PATCH #update' do - it 'returns http unauthorized' do - patch :update, params: { note: 'Foo' } - expect(response).to have_http_status(401) - end - end - end -end diff --git a/spec/requests/api/v1/accounts/credentials_spec.rb b/spec/requests/api/v1/accounts/credentials_spec.rb index b13e79b12..737348c2d 100644 --- a/spec/requests/api/v1/accounts/credentials_spec.rb +++ b/spec/requests/api/v1/accounts/credentials_spec.rb @@ -15,15 +15,11 @@ RSpec.describe 'credentials API' do it_behaves_like 'forbidden for wrong scope', 'write write:accounts' - it 'returns http success' do - subject - - expect(response).to have_http_status(200) - end - - it 'returns the expected content' do + it 'returns http success with expected content' do subject + expect(response) + .to have_http_status(200) expect(body_as_json).to include({ source: hash_including({ discoverable: false, @@ -34,24 +30,55 @@ RSpec.describe 'credentials API' do end end - describe 'POST /api/v1/accounts/update_credentials' do + describe 'PATCH /api/v1/accounts/update_credentials' do subject do patch '/api/v1/accounts/update_credentials', headers: headers, params: params end - let(:params) { { discoverable: true, locked: false, indexable: true } } + before { allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async) } + + let(:params) do + { + avatar: fixture_file_upload('avatar.gif', 'image/gif'), + discoverable: true, + display_name: "Alice Isn't Dead", + header: fixture_file_upload('attachment.jpg', 'image/jpeg'), + indexable: true, + locked: false, + note: 'Hello!', + source: { + privacy: 'unlisted', + sensitive: true, + }, + } + end it_behaves_like 'forbidden for wrong scope', 'read read:accounts' - it 'returns http success' do - subject + describe 'with empty source list' do + let(:params) { { display_name: "I'm a cat", source: {} } } - expect(response).to have_http_status(200) + it 'returns http success' do + subject + expect(response).to have_http_status(200) + end end - it 'returns JSON with updated attributes' do + describe 'with invalid data' do + let(:params) { { note: 'This is too long. ' * 30 } } + + it 'returns http unprocessable entity' do + subject + expect(response).to have_http_status(422) + end + end + + it 'returns http success with updated JSON attributes' do subject + expect(response) + .to have_http_status(200) + expect(body_as_json).to include({ source: hash_including({ discoverable: true, @@ -59,6 +86,27 @@ RSpec.describe 'credentials API' do }), locked: false, }) + + expect(ActivityPub::UpdateDistributionWorker) + .to have_received(:perform_async).with(user.account_id) + end + + def expect_account_updates + expect(user.account.reload) + .to have_attributes( + display_name: eq("Alice Isn't Dead"), + note: 'Hello!', + avatar: exist, + header: exist + ) + end + + def expect_user_updates + expect(user.reload) + .to have_attributes( + setting_default_privacy: eq('unlisted'), + setting_default_sensitive: be(true) + ) end end end From 27fd084cb5ccb4bf6b2a3eb28b0b123063230c10 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 13 Mar 2024 11:17:55 +0100 Subject: [PATCH 14/45] Exempt some notification types from notification filtering (#29565) --- app/services/notify_service.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index 428fdb4d4..66cbff0ef 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -68,6 +68,13 @@ class NotifyService < BaseService NEW_FOLLOWER_THRESHOLD = 3.days.freeze + NON_FILTERABLE_TYPES = %i( + admin.sign_up + admin.report + poll + update + ).freeze + def initialize(notification) @notification = notification @recipient = notification.account @@ -76,6 +83,7 @@ class NotifyService < BaseService end def filter? + return false if NON_FILTERABLE_TYPES.include?(@notification.type) return false if override_for_sender? from_limited? || From b43eaa4517107326c7e73b949cec759f841b4a30 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 13 Mar 2024 11:35:49 +0100 Subject: [PATCH 15/45] Refactor notification filtering behavior definition (#29567) --- app/models/notification.rb | 46 +++++++++++++++++++++++++--------- app/services/notify_service.rb | 2 +- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index e322daea4..861a15436 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -29,18 +29,40 @@ class Notification < ApplicationRecord 'Poll' => :poll, }.freeze - TYPES = %i( - mention - status - reblog - follow - follow_request - favourite - poll - update - admin.sign_up - admin.report - ).freeze + PROPERTIES = { + mention: { + filterable: true, + }.freeze, + status: { + filterable: false, + }.freeze, + reblog: { + filterable: true, + }.freeze, + follow: { + filterable: true, + }.freeze, + follow_request: { + filterable: true, + }.freeze, + favourite: { + filterable: true, + }.freeze, + poll: { + filterable: false, + }.freeze, + update: { + filterable: false, + }.freeze, + 'admin.sign_up': { + filterable: false, + }.freeze, + 'admin.report': { + filterable: false, + }.freeze, + }.freeze + + TYPES = PROPERTIES.keys.freeze TARGET_STATUS_INCLUDES_BY_TYPE = { status: :status, diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index 66cbff0ef..f3d16f1be 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -83,7 +83,7 @@ class NotifyService < BaseService end def filter? - return false if NON_FILTERABLE_TYPES.include?(@notification.type) + return false unless Notification::PROPERTIES[@notification.type][:filterable] return false if override_for_sender? from_limited? || From 268856d5d9f72f003a08a53c7d094ed4df7c16bc Mon Sep 17 00:00:00 2001 From: Erik Uden Date: Wed, 13 Mar 2024 12:45:20 +0100 Subject: [PATCH 16/45] Fix toggle button color for light (and dark/default) theme (#29553) --- app/javascript/styles/mastodon-light/diff.scss | 4 ++-- app/javascript/styles/mastodon/components.scss | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/javascript/styles/mastodon-light/diff.scss b/app/javascript/styles/mastodon-light/diff.scss index 675a01dd3..493e377d6 100644 --- a/app/javascript/styles/mastodon-light/diff.scss +++ b/app/javascript/styles/mastodon-light/diff.scss @@ -263,11 +263,11 @@ html { } .react-toggle-track { - background: $ui-secondary-color; + background: $ui-primary-color; } .react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track { - background: darken($ui-secondary-color, 10%); + background: lighten($ui-primary-color, 10%); } .react-toggle.react-toggle--checked:hover:not(.react-toggle--disabled) diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 047d9d973..b6dc1abc9 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -3369,7 +3369,7 @@ $ui-header-height: 55px; height: 20px; padding: 0; border-radius: 10px; - background-color: #626982; + background-color: $ui-primary-color; } .react-toggle--focus { @@ -3392,7 +3392,7 @@ $ui-header-height: 55px; width: 16px; height: 16px; border-radius: 50%; - background-color: $primary-text-color; + background-color: $ui-button-color; box-sizing: border-box; transition: all 0.25s ease; transition-property: border-color, left; @@ -3403,6 +3403,15 @@ $ui-header-height: 55px; border-color: $ui-highlight-color; } +.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track { + background: darken($ui-primary-color, 5%); +} + +.react-toggle.react-toggle--checked:hover:not(.react-toggle--disabled) + .react-toggle-track { + background: lighten($ui-highlight-color, 5%); +} + .switch-to-advanced { color: $light-text-color; background-color: $ui-base-color; From 171948b910684cb5b3f7ac0e2da169c527196ed1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:42:44 +0100 Subject: [PATCH 17/45] New Crowdin Translations (automated) (#29563) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/be.json | 16 ++++++++++++++++ app/javascript/mastodon/locales/ca.json | 1 - app/javascript/mastodon/locales/cy.json | 15 +++++++++++++++ app/javascript/mastodon/locales/da.json | 1 + app/javascript/mastodon/locales/es-AR.json | 2 +- app/javascript/mastodon/locales/et.json | 1 + app/javascript/mastodon/locales/fa.json | 4 ++-- app/javascript/mastodon/locales/fi.json | 11 +++++++++++ app/javascript/mastodon/locales/fil.json | 1 + app/javascript/mastodon/locales/fo.json | 2 +- app/javascript/mastodon/locales/gl.json | 16 ++++++++++++++++ app/javascript/mastodon/locales/he.json | 1 - app/javascript/mastodon/locales/hu.json | 2 +- app/javascript/mastodon/locales/it.json | 2 +- app/javascript/mastodon/locales/ko.json | 3 ++- app/javascript/mastodon/locales/lad.json | 8 ++++++++ app/javascript/mastodon/locales/lt.json | 10 ++++++++++ app/javascript/mastodon/locales/nl.json | 2 +- app/javascript/mastodon/locales/sk.json | 7 +++++++ app/javascript/mastodon/locales/sl.json | 3 +++ app/javascript/mastodon/locales/sq.json | 13 +++++++++++++ app/javascript/mastodon/locales/sr-Latn.json | 16 ++++++++++++++++ app/javascript/mastodon/locales/sr.json | 16 ++++++++++++++++ app/javascript/mastodon/locales/th.json | 1 + app/javascript/mastodon/locales/tr.json | 20 ++++++++++++++++++-- app/javascript/mastodon/locales/vi.json | 16 ++++++++++++++++ config/locales/fa.yml | 8 ++++---- config/locales/fi.yml | 4 ++-- config/locales/lad.yml | 10 ++++++++++ config/locales/simple_form.be.yml | 2 ++ config/locales/simple_form.ca.yml | 2 +- config/locales/simple_form.fa.yml | 2 +- config/locales/simple_form.fi.yml | 2 ++ config/locales/simple_form.ja.yml | 2 ++ config/locales/simple_form.lad.yml | 1 + config/locales/simple_form.sr-Latn.yml | 1 + config/locales/simple_form.sr.yml | 1 + config/locales/simple_form.tr.yml | 2 ++ config/locales/sq.yml | 1 + 39 files changed, 208 insertions(+), 20 deletions(-) diff --git a/app/javascript/mastodon/locales/be.json b/app/javascript/mastodon/locales/be.json index bbe21f056..6e0c5afb6 100644 --- a/app/javascript/mastodon/locales/be.json +++ b/app/javascript/mastodon/locales/be.json @@ -241,6 +241,7 @@ "empty_column.list": "У гэтым спісе пакуль што нічога няма. Калі члены лісту апублікуюць новыя запісы, яны з'явяцца тут.", "empty_column.lists": "Як толькі вы створыце новы спіс ён будзе захоўвацца тут, але пакуль што тут пуста.", "empty_column.mutes": "Вы яшчэ нікога не ігнаруеце.", + "empty_column.notification_requests": "Чысціня! Тут нічога няма. Калі вы будзеце атрымліваць новыя апавяшчэння, яны будуць з'яўляцца тут у адпаведнасці з вашымі наладамі.", "empty_column.notifications": "У вас няма ніякіх апавяшчэнняў. Калі іншыя людзі ўзаемадзейнічаюць з вамі, вы ўбачыце гэта тут.", "empty_column.public": "Тут нічога няма! Апублікуйце што-небудзь, або падпішыцеся на карыстальнікаў з другіх сервераў", "error.unexpected_crash.explanation": "Гэта старонка не можа быць адлюстравана карэктна з-за памылкі ў нашым кодзе, або праблемы з сумяшчальнасцю браўзера.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Скарыстайцеся існуючай катэгорыяй або стварыце новую", "filter_modal.select_filter.title": "Фільтраваць гэты допіс", "filter_modal.title.status": "Фільтраваць допіс", + "filtered_notifications_banner.pending_requests": "Апавяшчэнні ад {count, plural, =0 {# людзей якіх} one {# чалавека якіх} few {# чалавек якіх} many {# людзей якіх} other {# чалавека якіх}} вы магчыма ведаеце", + "filtered_notifications_banner.title": "Адфільтраваныя апавяшчэнні", "firehose.all": "Усе", "firehose.local": "Гэты сервер", "firehose.remote": "Іншыя серверы", @@ -439,6 +442,10 @@ "notification.reblog": "{name} пашырыў ваш допіс", "notification.status": "Новы допіс ад {name}", "notification.update": "Допіс {name} адрэдагаваны", + "notification_requests.accept": "Прыняць", + "notification_requests.dismiss": "Адхіліць", + "notification_requests.notifications_from": "Апавяшчэнні ад {name}", + "notification_requests.title": "Адфільтраваныя апавяшчэнні", "notifications.clear": "Ачысціць апавяшчэнні", "notifications.clear_confirmation": "Вы ўпэўнены, што жадаеце назаўсёды сцерці ўсё паведамленні?", "notifications.column_settings.admin.report": "Новыя скаргі:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Апавяшчэнні на працоўным стале недаступныя з-за папярэдне адхіленага запыта праў браўзера", "notifications.permission_denied_alert": "Апавяшчэнні на працоўным стале не могуць быць уключаныя, з-за таго што запыт браўзера быў адхілены", "notifications.permission_required": "Апавяшчэнні на працоўным стале недаступныя, з-за таго што неабходны дазвол не быў дадзены.", + "notifications.policy.filter_new_accounts.hint": "Створаныя на працягу {days, plural, one {апошняга # дня} few {апошніх # дзён} many {апошніх # дзён} other {апошняй # дня}}", + "notifications.policy.filter_new_accounts_title": "Новыя ўліковыя запісы", + "notifications.policy.filter_not_followers_hint": "Уключаючы людзей, якія падпісаны на вас менш, чым {days, plural, one {# дзень} few {# дні} many {# дзён} other {# дня}}", + "notifications.policy.filter_not_followers_title": "Людзі, якія не падпісаны на вас", + "notifications.policy.filter_not_following_hint": "Пакуль вы не пацвердзіце іх уручную", + "notifications.policy.filter_not_following_title": "Людзі, на якіх вы не падпісаны", + "notifications.policy.filter_private_mentions_hint": "Фільтруецца за выключэннем адказу на вашае згадванне ці калі вы падпісаны на адпраўніка", + "notifications.policy.filter_private_mentions_title": "Непажаданыя асаблівыя згадванні", + "notifications.policy.title": "Адфільтроўваць апавяшчэнні ад…", "notifications_permission_banner.enable": "Уключыць апавяшчэнні на працоўным стале", "notifications_permission_banner.how_to_control": "Каб атрымліваць апавяшчэнні, калі Mastodon не адкрыты, уключыце апавяшчэнні працоўнага стала. Вы зможаце дакладна кантраляваць, якія падзеі будуць ствараць апавяшчэнні з дапамогай {icon} кнопкі, як толькі яны будуць уключаны.", "notifications_permission_banner.title": "Не прапусціце нічога", diff --git a/app/javascript/mastodon/locales/ca.json b/app/javascript/mastodon/locales/ca.json index 0c237ccda..8ba140d20 100644 --- a/app/javascript/mastodon/locales/ca.json +++ b/app/javascript/mastodon/locales/ca.json @@ -272,7 +272,6 @@ "filter_modal.select_filter.subtitle": "Usa una categoria existent o crea'n una de nova", "filter_modal.select_filter.title": "Filtra aquest tut", "filter_modal.title.status": "Filtra un tut", - "filtered_notifications_banner.pending_requests": "Notificacions de {count, plural, =0 {no} one {una persona} other {# persones}} que potser coneixeu", "filtered_notifications_banner.title": "Notificacions filtrades", "firehose.all": "Tots", "firehose.local": "Aquest servidor", diff --git a/app/javascript/mastodon/locales/cy.json b/app/javascript/mastodon/locales/cy.json index 583660b28..e55dff925 100644 --- a/app/javascript/mastodon/locales/cy.json +++ b/app/javascript/mastodon/locales/cy.json @@ -241,6 +241,7 @@ "empty_column.list": "Does dim yn y rhestr yma eto. Pan fydd aelodau'r rhestr yn cyhoeddi postiad newydd, mi fydd yn ymddangos yma.", "empty_column.lists": "Nid oes gennych unrhyw restrau eto. Pan fyddwch yn creu un, mi fydd yn ymddangos yma.", "empty_column.mutes": "Nid ydych wedi tewi unrhyw ddefnyddwyr eto.", + "empty_column.notification_requests": "Dim i boeni amdano! Does dim byd yma. Pan fyddwch yn derbyn hysbysiadau newydd, byddan nhw'n ymddangos yma yn ôl eich gosodiadau.", "empty_column.notifications": "Nid oes gennych unrhyw hysbysiadau eto. Rhyngweithiwch ag eraill i ddechrau'r sgwrs.", "empty_column.public": "Does dim byd yma! Ysgrifennwch rywbeth cyhoeddus, neu dilynwch ddefnyddwyr o weinyddion eraill i'w lanw", "error.unexpected_crash.explanation": "Oherwydd gwall yn ein cod neu oherwydd problem cysondeb porwr, nid oedd y dudalen hon gallu cael ei dangos yn gywir.", @@ -271,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Defnyddiwch gategori sy'n bodoli eisoes neu crëu un newydd", "filter_modal.select_filter.title": "Hidlo'r postiad hwn", "filter_modal.title.status": "Hidlo postiad", + "filtered_notifications_banner.title": "Hysbysiadau wedi'u hidlo", "firehose.all": "Popeth", "firehose.local": "Gweinydd hwn", "firehose.remote": "Gweinyddion eraill", @@ -439,6 +441,10 @@ "notification.reblog": "Hybodd {name} eich post", "notification.status": "{name} newydd ei bostio", "notification.update": "Golygodd {name} bostiad", + "notification_requests.accept": "Derbyn", + "notification_requests.dismiss": "Cau", + "notification_requests.notifications_from": "Hysbysiadau gan {name}", + "notification_requests.title": "Hysbysiadau wedi'u hidlo", "notifications.clear": "Clirio hysbysiadau", "notifications.clear_confirmation": "Ydych chi'n siŵr eich bod am glirio'ch holl hysbysiadau am byth?", "notifications.column_settings.admin.report": "Adroddiadau newydd:", @@ -470,6 +476,15 @@ "notifications.permission_denied": "Nid oes hysbysiadau bwrdd gwaith ar gael oherwydd cais am ganiatâd porwr a wrthodwyd yn flaenorol", "notifications.permission_denied_alert": "Nid oes modd galluogi hysbysiadau bwrdd gwaith, gan fod caniatâd porwr wedi'i wrthod o'r blaen", "notifications.permission_required": "Nid oes hysbysiadau bwrdd gwaith ar gael oherwydd na roddwyd y caniatâd gofynnol.", + "notifications.policy.filter_new_accounts.hint": "Crëwyd o fewn {days, lluosog, un {yr un diwrnod} arall {y # diwrnod}} diwethaf", + "notifications.policy.filter_new_accounts_title": "Cyfrifon newydd", + "notifications.policy.filter_not_followers_hint": "Gan gynnwys pobl sydd wedi bod yn eich dilyn am llai {days, plural, un {nag un diwrnod} arall {na # diwrnod}}", + "notifications.policy.filter_not_followers_title": "Pobl sydd ddim yn eich dilyn", + "notifications.policy.filter_not_following_hint": "Hyd nes i chi eu cymeradwyo â llaw", + "notifications.policy.filter_not_following_title": "Pobl nad ydych yn eu dilyn", + "notifications.policy.filter_private_mentions_hint": "Wedi'i hidlo oni bai ei fod mewn ymateb i'ch crybwylliad eich hun neu os ydych yn dilyn yr anfonwr", + "notifications.policy.filter_private_mentions_title": "Crybwylliadau preifat digymell", + "notifications.policy.title": "Hidlo hysbysiadau gan…", "notifications_permission_banner.enable": "Galluogi hysbysiadau bwrdd gwaith", "notifications_permission_banner.how_to_control": "I dderbyn hysbysiadau pan nad yw Mastodon ar agor, galluogwch hysbysiadau bwrdd gwaith. Gallwch reoli'n union pa fathau o ryngweithiadau sy'n cynhyrchu hysbysiadau bwrdd gwaith trwy'r botwm {icon} uchod unwaith y byddan nhw wedi'u galluogi.", "notifications_permission_banner.title": "Peidiwch â cholli dim", diff --git a/app/javascript/mastodon/locales/da.json b/app/javascript/mastodon/locales/da.json index ddc0440ab..4f03c55bd 100644 --- a/app/javascript/mastodon/locales/da.json +++ b/app/javascript/mastodon/locales/da.json @@ -272,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Vælg en eksisterende kategori eller opret en ny", "filter_modal.select_filter.title": "Filtrér dette indlæg", "filter_modal.title.status": "Filtrér et indlæg", + "filtered_notifications_banner.pending_requests": "Notifikationer fra {count, plural, =0 {ingen} one {én person} other {# personer}} du måske kender", "filtered_notifications_banner.title": "Filtrerede notifikationer", "firehose.all": "Alle", "firehose.local": "Denne server", diff --git a/app/javascript/mastodon/locales/es-AR.json b/app/javascript/mastodon/locales/es-AR.json index 48d458005..35802420d 100644 --- a/app/javascript/mastodon/locales/es-AR.json +++ b/app/javascript/mastodon/locales/es-AR.json @@ -272,7 +272,7 @@ "filter_modal.select_filter.subtitle": "Usar una categoría existente o crear una nueva", "filter_modal.select_filter.title": "Filtrar este mensaje", "filter_modal.title.status": "Filtrar un mensaje", - "filtered_notifications_banner.pending_requests": "Notificaciones de {count, plural, =0 {ninguna cuenta} one {una cuenta} other {# cuentas}} que podrías conocer", + "filtered_notifications_banner.pending_requests": "Notificaciones de {count, plural, =0 {nadie} one {una persona} other {# personas}} que podrías conocer", "filtered_notifications_banner.title": "Notificaciones filtradas", "firehose.all": "Todos", "firehose.local": "Este servidor", diff --git a/app/javascript/mastodon/locales/et.json b/app/javascript/mastodon/locales/et.json index 2759c96a1..79e376693 100644 --- a/app/javascript/mastodon/locales/et.json +++ b/app/javascript/mastodon/locales/et.json @@ -271,6 +271,7 @@ "filter_modal.select_filter.subtitle": "Kasuta olemasolevat kategooriat või loo uus", "filter_modal.select_filter.title": "Filtreeri seda postitust", "filter_modal.title.status": "Postituse filtreerimine", + "filtered_notifications_banner.pending_requests": "Teateid {count, plural, =0 {mitte üheltki} one {ühelt} other {#}} inimeselt, keda võid teada", "firehose.all": "Kõik", "firehose.local": "See server", "firehose.remote": "Teised serverid", diff --git a/app/javascript/mastodon/locales/fa.json b/app/javascript/mastodon/locales/fa.json index 9e6128b87..2ca44a41a 100644 --- a/app/javascript/mastodon/locales/fa.json +++ b/app/javascript/mastodon/locales/fa.json @@ -325,8 +325,8 @@ "interaction_modal.description.follow": "با حسابی روی ماستودون می‌توانید {name} را برای دریافت فرسته‌هایش در خوراک خانگیتان دنبال کنید.", "interaction_modal.description.reblog": "با حسابی روی ماستودون می‌توانید این فرسته را با پی‌گیران خودتان هم‌رسانی کنید.", "interaction_modal.description.reply": "با حسابی روی ماستودون می‌توانید به این فرسته پاسخ دهید.", - "interaction_modal.login.action": "من رو ببر خونه", - "interaction_modal.login.prompt": "دامنه سرور شخصی شما، به عنوان مثال. mastodon.social", + "interaction_modal.login.action": "رفتن به خانه", + "interaction_modal.login.prompt": "دامنهٔ کارساز شخصیتان چون mastodon.social", "interaction_modal.no_account_yet": "در ماستودون نیست؟", "interaction_modal.on_another_server": "روی کارسازی دیگر", "interaction_modal.on_this_server": "روی این کارساز", diff --git a/app/javascript/mastodon/locales/fi.json b/app/javascript/mastodon/locales/fi.json index 3f964a710..93e758dd4 100644 --- a/app/javascript/mastodon/locales/fi.json +++ b/app/javascript/mastodon/locales/fi.json @@ -271,6 +271,7 @@ "filter_modal.select_filter.subtitle": "Käytä olemassa olevaa luokkaa tai luo uusi", "filter_modal.select_filter.title": "Suodata tämä julkaisu", "filter_modal.title.status": "Suodata julkaisu", + "filtered_notifications_banner.title": "Suodatetut ilmoitukset", "firehose.all": "Kaikki", "firehose.local": "Tämä palvelin", "firehose.remote": "Muut palvelimet", @@ -439,6 +440,10 @@ "notification.reblog": "{name} tehosti julkaisuasi", "notification.status": "{name} julkaisi juuri", "notification.update": "{name} muokkasi julkaisua", + "notification_requests.accept": "Hyväksy", + "notification_requests.dismiss": "Hylkää", + "notification_requests.notifications_from": "Ilmoitukset käyttäjältä {name}", + "notification_requests.title": "Suodatetut ilmoitukset", "notifications.clear": "Tyhjennä ilmoitukset", "notifications.clear_confirmation": "Haluatko varmasti poistaa kaikki ilmoitukset pysyvästi?", "notifications.column_settings.admin.report": "Uudet ilmoitukset:", @@ -470,6 +475,12 @@ "notifications.permission_denied": "Työpöytäilmoitukset eivät ole käytettävissä, koska selaimen käyttöoikeuspyyntö on aiemmin evätty", "notifications.permission_denied_alert": "Työpöytäilmoituksia ei voi ottaa käyttöön, koska selaimen käyttöoikeus on aiemmin estetty", "notifications.permission_required": "Työpöytäilmoitukset eivät ole käytettävissä, koska siihen tarvittavaa lupaa ei ole myönnetty.", + "notifications.policy.filter_new_accounts.hint": "Luotu {days, plural, one {viime päivänä} other {viimeisenä # päivänä}}", + "notifications.policy.filter_new_accounts_title": "Uudet tilit", + "notifications.policy.filter_not_followers_title": "Henkilöt, jotka eivät seuraa sinua", + "notifications.policy.filter_not_following_title": "Henkilöt, joita et seuraa", + "notifications.policy.filter_private_mentions_title": "Ei-toivotut yksityismaininnat", + "notifications.policy.title": "Suodata ilmoitukset pois kohteesta…", "notifications_permission_banner.enable": "Ota työpöytäilmoitukset käyttöön", "notifications_permission_banner.how_to_control": "Saadaksesi ilmoituksia, kun Mastodon ei ole auki, ota työpöytäilmoitukset käyttöön. Voit hallita tarkasti, mistä saat työpöytäilmoituksia kun ilmoitukset on otettu käyttöön yllä olevan {icon}-painikkeen kautta.", "notifications_permission_banner.title": "Älä anna minkään mennä ohi", diff --git a/app/javascript/mastodon/locales/fil.json b/app/javascript/mastodon/locales/fil.json index 04208c554..14bf1af22 100644 --- a/app/javascript/mastodon/locales/fil.json +++ b/app/javascript/mastodon/locales/fil.json @@ -169,6 +169,7 @@ "empty_column.list": "Wala pang laman ang listahang ito. Kapag naglathala ng mga bagong post ang mga miyembro ng listahang ito, makikita iyon dito.", "empty_column.lists": "Wala ka pang mga listahan. Kapag gumawa ka ng isa, makikita yun dito.", "explore.search_results": "Mga resulta ng paghahanap", + "filter_modal.select_filter.search": "Hanapin o gumawa", "firehose.all": "Lahat", "firehose.local": "Itong serbiro", "firehose.remote": "Ibang mga serbiro", diff --git a/app/javascript/mastodon/locales/fo.json b/app/javascript/mastodon/locales/fo.json index 67b323e2c..daaefea86 100644 --- a/app/javascript/mastodon/locales/fo.json +++ b/app/javascript/mastodon/locales/fo.json @@ -272,7 +272,7 @@ "filter_modal.select_filter.subtitle": "Brúka ein verandi bólk ella skapa ein nýggjan", "filter_modal.select_filter.title": "Filtrera hendan postin", "filter_modal.title.status": "Filtrera ein post", - "filtered_notifications_banner.pending_requests": "Fráboðanir frá {count, plural, =0 {ongum} one {einum persóni} other {# persónum}}, sum tú møguliga kennir", + "filtered_notifications_banner.pending_requests": "Fráboðanir frá {count, plural, =0 {ongum} one {einum persóni} other {# persónum}}, sum tú kanska kennir", "filtered_notifications_banner.title": "Sáldaðar fráboðanir", "firehose.all": "Allar", "firehose.local": "Hesin ambætarin", diff --git a/app/javascript/mastodon/locales/gl.json b/app/javascript/mastodon/locales/gl.json index 52e0ee6f6..e3928b5f3 100644 --- a/app/javascript/mastodon/locales/gl.json +++ b/app/javascript/mastodon/locales/gl.json @@ -241,6 +241,7 @@ "empty_column.list": "Aínda non hai nada nesta listaxe. Cando as usuarias incluídas na listaxe publiquen mensaxes, amosaranse aquí.", "empty_column.lists": "Aínda non tes listaxes. Cando crees unha, amosarase aquí.", "empty_column.mutes": "Aínda non silenciaches a ningúnha usuaria.", + "empty_column.notification_requests": "Todo ben! Nada por aquí. Cando recibas novas notificación aparecerán aquí seguindo o criterio dos teus axustes.", "empty_column.notifications": "Aínda non tes notificacións. Aparecerán cando outras persoas interactúen contigo.", "empty_column.public": "Nada por aquí! Escribe algo de xeito público, ou segue de xeito manual usuarias doutros servidores para ir enchéndoo", "error.unexpected_crash.explanation": "Debido a un erro no noso código ou a unha compatilidade co teu navegador, esta páxina non pode ser amosada correctamente.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Usar unha categoría existente ou crear unha nova", "filter_modal.select_filter.title": "Filtrar esta publicación", "filter_modal.title.status": "Filtrar unha publicación", + "filtered_notifications_banner.pending_requests": "Notificacións de {count, plural, =0 {ninguén} one {unha persoa} other {# persoas}} que poderías coñecer", + "filtered_notifications_banner.title": "Notificacións filtradas", "firehose.all": "Todo", "firehose.local": "Este servidor", "firehose.remote": "Outros servidores", @@ -439,6 +442,10 @@ "notification.reblog": "{name} compartiu a túa publicación", "notification.status": "{name} publicou", "notification.update": "{name} editou unha publicación", + "notification_requests.accept": "Aceptar", + "notification_requests.dismiss": "Desbotar", + "notification_requests.notifications_from": "Notificacións de {name}", + "notification_requests.title": "Notificacións filtradas", "notifications.clear": "Limpar notificacións", "notifications.clear_confirmation": "Tes a certeza de querer limpar de xeito permanente todas as túas notificacións?", "notifications.column_settings.admin.report": "Novas denuncias:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Non se activaron as notificacións de escritorio porque se denegou o permiso", "notifications.permission_denied_alert": "Non se poden activar as notificacións de escritorio, xa que o permiso para o navegador foi denegado previamente", "notifications.permission_required": "As notificacións de escritorio non están dispoñibles porque non se concedeu o permiso necesario.", + "notifications.policy.filter_new_accounts.hint": "Creadas desde {days, plural, one {onte} other {fai # días}}", + "notifications.policy.filter_new_accounts_title": "Novas contas", + "notifications.policy.filter_not_followers_hint": "Inclúe a persoas que te seguen desde fai menos de {days, plural, one {1 día} other {# días}}", + "notifications.policy.filter_not_followers_title": "Persoas que non te seguen", + "notifications.policy.filter_not_following_hint": "Ata que as autorices", + "notifications.policy.filter_not_following_title": "Persoas que ti non segues", + "notifications.policy.filter_private_mentions_hint": "Filtradas a non ser que sexa unha resposta á túa propia mención ou se ti segues á remitente", + "notifications.policy.filter_private_mentions_title": "Mencións privadas non solicitadas", + "notifications.policy.title": "Desbotar notificacións de…", "notifications_permission_banner.enable": "Activar notificacións de escritorio", "notifications_permission_banner.how_to_control": "Activa as notificacións de escritorio para recibir notificacións mentras Mastodon non está aberto. Podes controlar de xeito preciso o tipo de interaccións que crean as notificacións de escritorio a través da {icon} superior unha vez están activadas.", "notifications_permission_banner.title": "Non perder nada", diff --git a/app/javascript/mastodon/locales/he.json b/app/javascript/mastodon/locales/he.json index dcbc30308..af6b1c611 100644 --- a/app/javascript/mastodon/locales/he.json +++ b/app/javascript/mastodon/locales/he.json @@ -272,7 +272,6 @@ "filter_modal.select_filter.subtitle": "שימוש בקטגורייה קיימת או יצירת אחת חדשה", "filter_modal.select_filter.title": "סינון ההודעה הזו", "filter_modal.title.status": "סנן הודעה", - "filtered_notifications_banner.pending_requests": "{count, plural,=0 {אין התראות ממשתמשים ה}one {התראה אחת ממישהו/מישהי ה}other {יש # התראות ממשתמשים }}מוכרים לך", "filtered_notifications_banner.title": "התראות מסוננות", "firehose.all": "הכל", "firehose.local": "שרת זה", diff --git a/app/javascript/mastodon/locales/hu.json b/app/javascript/mastodon/locales/hu.json index 5dd0e7aee..1cbca5654 100644 --- a/app/javascript/mastodon/locales/hu.json +++ b/app/javascript/mastodon/locales/hu.json @@ -272,7 +272,7 @@ "filter_modal.select_filter.subtitle": "Válassz egy meglévő kategóriát, vagy hozz létre egy újat", "filter_modal.select_filter.title": "E bejegyzés szűrése", "filter_modal.title.status": "Egy bejegyzés szűrése", - "filtered_notifications_banner.pending_requests": "Értesítések {count, plural, =0 {0 személytől} one {egy feltehetőleg ismert személytől} other {# feltehetőleg ismert személytől}}", + "filtered_notifications_banner.pending_requests": "Értesítések {count, plural, =0 {nincsenek} one {egy valósztínűleg ismerős személytől} other {# valószínűleg ismerős személytől}}", "filtered_notifications_banner.title": "Szűrt értesítések", "firehose.all": "Összes", "firehose.local": "Ez a kiszolgáló", diff --git a/app/javascript/mastodon/locales/it.json b/app/javascript/mastodon/locales/it.json index 303abd498..56b637612 100644 --- a/app/javascript/mastodon/locales/it.json +++ b/app/javascript/mastodon/locales/it.json @@ -272,7 +272,7 @@ "filter_modal.select_filter.subtitle": "Usa una categoria esistente o creane una nuova", "filter_modal.select_filter.title": "Filtra questo post", "filter_modal.title.status": "Filtra un post", - "filtered_notifications_banner.pending_requests": "Notifiche da {count, plural, =0 {nessuna persona} one {una persona} other {# persone}} che potresti conoscere", + "filtered_notifications_banner.pending_requests": "Notifiche da {count, plural, =0 {nessuno} one {una persona} other {# persone}} che potresti conoscere", "filtered_notifications_banner.title": "Notifiche filtrate", "firehose.all": "Tutto", "firehose.local": "Questo server", diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 7dd763608..642a3f4ae 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -271,7 +271,7 @@ "filter_modal.select_filter.subtitle": "기존의 카테고리를 사용하거나 새로 하나를 만듧니다", "filter_modal.select_filter.title": "이 게시물을 필터", "filter_modal.title.status": "게시물 필터", - "filtered_notifications_banner.pending_requests": "알 수도 있는 {count, plural, =0 {0명} one {한 명} other {# 명}}의 사람들로부터의 알림", + "filtered_notifications_banner.pending_requests": "알 수도 있는 {count, plural, =0 {0 명} one {한 명} other {# 명}}의 사람들로부터의 알림", "filtered_notifications_banner.title": "걸러진 알림", "firehose.all": "모두", "firehose.local": "이 서버", @@ -478,6 +478,7 @@ "notifications.permission_required": "필요한 권한이 승인되지 않아 데스크탑 알림을 사용할 수 없습니다.", "notifications.policy.filter_new_accounts.hint": "{days, plural, one {하루} other {#일}} 안에 만들어진", "notifications.policy.filter_new_accounts_title": "새 계정", + "notifications.policy.filter_not_followers_hint": "나를 팔로우 한 지 {days, plural, other {# 일}}이 되지 않은 사람들을 포함", "notifications.policy.filter_not_followers_title": "나를 팔로우하지 않는 사람들", "notifications.policy.filter_not_following_hint": "내가 수동으로 승인하기 전까지", "notifications.policy.filter_not_following_title": "내가 팔로우하지 않는 사람들", diff --git a/app/javascript/mastodon/locales/lad.json b/app/javascript/mastodon/locales/lad.json index de84becca..e23f22592 100644 --- a/app/javascript/mastodon/locales/lad.json +++ b/app/javascript/mastodon/locales/lad.json @@ -271,6 +271,7 @@ "filter_modal.select_filter.subtitle": "Kulanea una kategoria egzistente o kriya mueva", "filter_modal.select_filter.title": "Filtra esta publikasyon", "filter_modal.title.status": "Filtra una publikasyon", + "filtered_notifications_banner.pending_requests": "Avizos de {count, plural, =0 {dingun} one {una persona} other {# personas}} ke puedes koneser", "filtered_notifications_banner.title": "Avizos filtrados", "firehose.all": "Todo", "firehose.local": "Este sirvidor", @@ -442,6 +443,7 @@ "notification.update": "{name} edito una publikasyon", "notification_requests.accept": "Acheta", "notification_requests.dismiss": "Kita", + "notification_requests.notifications_from": "Avizos de {name}", "notification_requests.title": "Avizos filtrados", "notifications.clear": "Efasa avizos", "notifications.clear_confirmation": "Estas siguro ke keres permanentemente efasar todos tus avizos?", @@ -474,7 +476,13 @@ "notifications.permission_denied": "Avizos de ensimameza no estan desponivles porke ya se tiene refuzado el permiso", "notifications.permission_denied_alert": "\"No se pueden kapasitar los avizos de ensimameza, porke ya se tiene refuzado el permiso de navigador", "notifications.permission_required": "Avizos de ensimameza no estan desponivles porke los nesesarios permisos no tienen sido risividos.", + "notifications.policy.filter_new_accounts.hint": "Kriyadas durante {days, plural, one {el ultimo diya} other {los ultimos # diyas}}", "notifications.policy.filter_new_accounts_title": "Muevos kuentos", + "notifications.policy.filter_not_followers_title": "Personas ke te no sigen", + "notifications.policy.filter_not_following_hint": "Asta ke las aproves manualmente", + "notifications.policy.filter_not_following_title": "Personas ke no siges", + "notifications.policy.filter_private_mentions_title": "Enmentaduras privadas no solisitadas", + "notifications.policy.title": "Filtra avizos de…", "notifications_permission_banner.enable": "Kapasita avizos de ensimameza", "notifications_permission_banner.how_to_control": "Para risivir avizos kuando Mastodon no esta avierto, kapasita avizos de ensimameza. Puedes kontrolar presizamente kualos tipos de enteraksiones djeneren avizos de ensimameza kon el boton {icon} arriva kuando esten kapasitadas.", "notifications_permission_banner.title": "Nunkua te piedres niente", diff --git a/app/javascript/mastodon/locales/lt.json b/app/javascript/mastodon/locales/lt.json index 6963c43a3..326560c88 100644 --- a/app/javascript/mastodon/locales/lt.json +++ b/app/javascript/mastodon/locales/lt.json @@ -439,6 +439,10 @@ "notification.reblog": "{name} pakėlė tavo įrašą", "notification.status": "{name} ką tik paskelbė", "notification.update": "{name} redagavo įrašą", + "notification_requests.accept": "Priimti", + "notification_requests.dismiss": "Atmesti", + "notification_requests.notifications_from": "Pranešimai iš {name}", + "notification_requests.title": "Filtruojami pranešimai", "notifications.clear": "Išvalyti pranešimus", "notifications.clear_confirmation": "Ar tikrai nori visam laikui išvalyti visus pranešimus?", "notifications.column_settings.admin.report": "Naujos ataskaitos:", @@ -470,6 +474,12 @@ "notifications.permission_denied": "Darbalaukio pranešimai nepasiekiami dėl anksčiau atmestos naršyklės leidimų užklausos.", "notifications.permission_denied_alert": "Negalima įjungti darbalaukio pranešimų, nes prieš tai naršyklės leidimas buvo atmestas.", "notifications.permission_required": "Darbalaukio pranešimai nepasiekiami, nes nebuvo suteiktas reikiamas leidimas.", + "notifications.policy.filter_new_accounts.hint": "Sukurta per {days, plural, one {vieną dieną} few {# dienas} many {# dienos} other {# dienų}}", + "notifications.policy.filter_new_accounts_title": "Naujos paskyros", + "notifications.policy.filter_not_following_hint": "Kol jų nepatvirtinsi rankiniu būdu", + "notifications.policy.filter_not_following_title": "Žmonių, kuriuos neseki", + "notifications.policy.filter_private_mentions_title": "Nepageidaujami privatūs paminėjimai", + "notifications.policy.title": "Filtruoti pranešimus iš…", "notifications_permission_banner.enable": "Įjungti darbalaukio pranešimus", "notifications_permission_banner.how_to_control": "Jei nori gauti pranešimus, kai Mastodon nėra atidarytas, įjunk darbalaukio pranešimus. Įjungęs (-usi) darbalaukio pranešimus, gali tiksliai valdyti, kokių tipų sąveikos generuoja darbalaukio pranešimus, naudojant pirmiau esančiu mygtuku {icon}.", "notifications_permission_banner.title": "Niekada nieko nepraleisk", diff --git a/app/javascript/mastodon/locales/nl.json b/app/javascript/mastodon/locales/nl.json index da5c4d864..34a0c5ea5 100644 --- a/app/javascript/mastodon/locales/nl.json +++ b/app/javascript/mastodon/locales/nl.json @@ -272,7 +272,7 @@ "filter_modal.select_filter.subtitle": "Een bestaande categorie gebruiken of een nieuwe aanmaken", "filter_modal.select_filter.title": "Dit bericht filteren", "filter_modal.title.status": "Een bericht filteren", - "filtered_notifications_banner.pending_requests": "Meldingen van {count, plural, =0 {no} one {één persoon} other {# mensen}} die je misschien kent", + "filtered_notifications_banner.pending_requests": "Meldingen van {count, plural, =0 {niemand} one {één persoon} other {# mensen}} die je misschien kent", "filtered_notifications_banner.title": "Gefilterde meldingen", "firehose.all": "Alles", "firehose.local": "Deze server", diff --git a/app/javascript/mastodon/locales/sk.json b/app/javascript/mastodon/locales/sk.json index a9c7affab..07f761735 100644 --- a/app/javascript/mastodon/locales/sk.json +++ b/app/javascript/mastodon/locales/sk.json @@ -271,6 +271,7 @@ "filter_modal.select_filter.subtitle": "Použite existujúcu kategóriu alebo vytvorte novú", "filter_modal.select_filter.title": "Filtrovanie tohto príspevku", "filter_modal.title.status": "Filtrovanie príspevku", + "filtered_notifications_banner.pending_requests": "Oboznámenia od {count, plural, =0 {nikoho} one {jedného človeka} other {# ľudí}} čo môžeš poznať", "firehose.all": "Všetko", "firehose.local": "Tento server", "firehose.remote": "Ostatné servery", @@ -439,6 +440,9 @@ "notification.reblog": "{name} zdieľa váš príspevok", "notification.status": "{name} uverejňuje niečo nové", "notification.update": "{name} upravuje príspevok", + "notification_requests.accept": "Prijať", + "notification_requests.notifications_from": "Oboznámenia od {name}", + "notification_requests.title": "Filtrované oboznámenia", "notifications.clear": "Vyčistiť upozornenia", "notifications.clear_confirmation": "Určite chcete nenávratne odstrániť všetky svoje upozornenia?", "notifications.column_settings.admin.report": "Nové hlásenia:", @@ -470,6 +474,9 @@ "notifications.permission_denied": "Upozornenia na ploche sú nedostupné pre už skôr zamietnutú požiadavku prehliadača", "notifications.permission_denied_alert": "Upozornenia na ploche nemôžu byť zapnuté, pretože požiadavka prehliadača bola už skôr zamietnutá", "notifications.permission_required": "Upozornenia na ploche sú nedostupné, pretože neboli udelené potrebné povolenia.", + "notifications.policy.filter_new_accounts_title": "Nové účty", + "notifications.policy.filter_not_followers_title": "Ľudia, ktorí ťa nenasledujú", + "notifications.policy.filter_not_following_title": "Ľudia, ktorých nenasleduješ", "notifications_permission_banner.enable": "Povoliť upozornenia na ploche", "notifications_permission_banner.how_to_control": "Ak chcete dostávať upozornenia, keď Mastodon nie je otvorený, povoľte upozornenia na ploche. Po ich zapnutí môžete presne kontrolovať, ktoré typy interakcií generujú upozornenia na ploche, a to prostredníctvom tlačidla {icon} vyššie.", "notifications_permission_banner.title": "Nenechajte si nič ujsť", diff --git a/app/javascript/mastodon/locales/sl.json b/app/javascript/mastodon/locales/sl.json index df150fc29..1fe7dd078 100644 --- a/app/javascript/mastodon/locales/sl.json +++ b/app/javascript/mastodon/locales/sl.json @@ -272,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Uporabite obstoječo kategorijo ali ustvarite novo", "filter_modal.select_filter.title": "Filtriraj to objavo", "filter_modal.title.status": "Filtrirajte objavo", + "filtered_notifications_banner.pending_requests": "Obvestila od {count, plural, =0 {nikogar, ki bi ga} one {# človeka, ki bi ga} two {# ljudi, ki bi ju} few {# ljudi, ki bi jih} other {# ljudi, ki bi jih}} lahko poznali", "filtered_notifications_banner.title": "Filtrirana obvestila", "firehose.all": "Vse", "firehose.local": "Ta strežnik", @@ -476,7 +477,9 @@ "notifications.permission_denied": "Namizna obvestila niso na voljo zaradi poprej zavrnjene zahteve dovoljenja brskalnika.", "notifications.permission_denied_alert": "Namiznih obvestil ni mogoče omogočiti, ker je bilo dovoljenje brskalnika že prej zavrnjeno", "notifications.permission_required": "Namizna obvestila niso na voljo, ker zahtevano dovoljenje ni bilo podeljeno.", + "notifications.policy.filter_new_accounts.hint": "Ustvarjen v {days, plural, one {zadnjem # dnevu} two {zadnjih # dnevih} few {zadnjih # dnevih} other {zadnjih # dnevih}}", "notifications.policy.filter_new_accounts_title": "Novi računi", + "notifications.policy.filter_not_followers_hint": "Vključujoč ljudi, ki vam sledijo manj kot {days, plural, one {# dan} two {# dneva} few {# dni} other {# dni}}", "notifications.policy.filter_not_followers_title": "Ljudje, ki vam ne sledijo", "notifications.policy.filter_not_following_hint": "Dokler jih ročno ne odobrite", "notifications.policy.filter_not_following_title": "Ljudje, ki jim ne sledite", diff --git a/app/javascript/mastodon/locales/sq.json b/app/javascript/mastodon/locales/sq.json index 00d517de7..beba09d59 100644 --- a/app/javascript/mastodon/locales/sq.json +++ b/app/javascript/mastodon/locales/sq.json @@ -241,6 +241,7 @@ "empty_column.list": "Në këtë listë ende s’ka gjë. Kur anëtarë të kësaj liste postojnë gjendje të reja, ato do të shfaqen këtu.", "empty_column.lists": "Ende s’keni ndonjë listë. Kur të krijoni një të tillë, do të duket këtu.", "empty_column.mutes": "S’keni heshtuar ende ndonjë përdorues.", + "empty_column.notification_requests": "Gjithçka si duhet! S’ka ç’bëhet këtu. Kur merrni njoftime të reja, do të shfaqen këtu, në përputhje me rregullimet tuaja.", "empty_column.notifications": "Ende s’keni ndonjë njoftim. Ndërveproni me të tjerët që të nisë biseda.", "empty_column.public": "S’ka gjë këtu! Shkruani diçka publikisht, ose ndiqni dorazi përdorues prej instancash të tjera, që kjo të mbushet", "error.unexpected_crash.explanation": "Për shkak të një të mete në kodin tonë ose të një problemi përputhshmërie të shfletuesit, kjo faqe s’mund të shfaqet saktë.", @@ -271,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Përdorni një kategori ekzistuese, ose krijoni një të re", "filter_modal.select_filter.title": "Filtroje këtë postim", "filter_modal.title.status": "Filtroni një postim", + "filtered_notifications_banner.title": "Njoftime të filtruar", "firehose.all": "Krejt", "firehose.local": "Këtë shërbyes", "firehose.remote": "Shërbyes të tjerë", @@ -439,6 +441,10 @@ "notification.reblog": "{name} përforcoi mesazhin tuaj", "notification.status": "{name} sapo postoi", "notification.update": "{name} përpunoi një postim", + "notification_requests.accept": "Pranoje", + "notification_requests.dismiss": "Hidhe tej", + "notification_requests.notifications_from": "Njoftime prej {name}", + "notification_requests.title": "Njoftime të filtruar", "notifications.clear": "Spastroji njoftimet", "notifications.clear_confirmation": "Jeni i sigurt se doni të spastrohen përgjithmonë krejt njoftimet tuaja?", "notifications.column_settings.admin.report": "Raportime të reja:", @@ -470,6 +476,13 @@ "notifications.permission_denied": "S’merren dot njoftime në desktop, ngaqë më herët shfletuesit i janë mohuar lejet për këtë", "notifications.permission_denied_alert": "S’mund të aktivizohen njoftimet në desktop, ngaqë lejet e shfletuesit për këtë janë mohuar më herët", "notifications.permission_required": "S’merren dot njoftime desktop, ngaqë s’është akorduar leja përkatëse.", + "notifications.policy.filter_new_accounts_title": "Llogari të reja", + "notifications.policy.filter_not_followers_title": "Persona që s’ju ndjekin", + "notifications.policy.filter_not_following_hint": "Deri sa t’i miratoni dorazi", + "notifications.policy.filter_not_following_title": "Persona që s’i ndiqni", + "notifications.policy.filter_private_mentions_hint": "Filtruar, hiq rastin nëse gjendet te përgjigje ndaj përmendjes tuaj, ose nëse dërguesin e ndiqni", + "notifications.policy.filter_private_mentions_title": "Përmendje private të pakërkuara", + "notifications.policy.title": "Filtroni njoftime nga…", "notifications_permission_banner.enable": "Aktivizo njoftime në desktop", "notifications_permission_banner.how_to_control": "Për të marrë njoftime, kur Mastodon-i s’është i hapur, aktivizoni njoftime në desktop. Përmes butoni {icon} më sipër, mund të kontrolloni me përpikëri cilat lloje ndërveprimesh prodhojnë njoftime në desktop, pasi të jenë aktivizuar.", "notifications_permission_banner.title": "Mos t’ju shpëtojë gjë", diff --git a/app/javascript/mastodon/locales/sr-Latn.json b/app/javascript/mastodon/locales/sr-Latn.json index 4c0264465..6a5ad998d 100644 --- a/app/javascript/mastodon/locales/sr-Latn.json +++ b/app/javascript/mastodon/locales/sr-Latn.json @@ -241,6 +241,7 @@ "empty_column.list": "U ovoj listi još nema ničega. Kada članovi ove liste objave nešto novo, pojaviće se ovde.", "empty_column.lists": "Još uvek nemate nijednu listu. Kada napravite jednu, ona će se pojaviti ovde.", "empty_column.mutes": "Još uvek ne ignorišete nijednog korisnika.", + "empty_column.notification_requests": "Sve je čisto! Ovde nema ničega. Kada dobijete nova obaveštenja, ona će se pojaviti ovde u skladu sa vašim podešavanjima.", "empty_column.notifications": "Još uvek nemate nikakva obaveštenja. Kada drugi ljudi budu u interakciji sa vama, videćete to ovde.", "empty_column.public": "Ovde nema ničega! Napišite nešto javno ili ručno pratite korisnike sa drugih servera da biste ovo popunili", "error.unexpected_crash.explanation": "Zbog greške u našem kodu ili problema sa kompatibilnošću pregledača, ova stranica se nije mogla pravilno prikazati.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Koristite postojeću kategoriju ili kreirajte novu", "filter_modal.select_filter.title": "Filtriraj ovu objavu", "filter_modal.title.status": "Filtriraj objavu", + "filtered_notifications_banner.pending_requests": "Obaveštenja od {count, plural, =0 {nikoga koga možda poznajete} one {# osobe koju možda poznajete} few {# osobe koje možda poznajete} other {# osoba koje možda poznajete}}", + "filtered_notifications_banner.title": "Filtrirana obaveštenja", "firehose.all": "Sve", "firehose.local": "Ovaj server", "firehose.remote": "Ostali serveri", @@ -439,6 +442,10 @@ "notification.reblog": "{name} je podržao vašu objavu", "notification.status": "{name} je upravo objavio", "notification.update": "{name} je uredio objavu", + "notification_requests.accept": "Prihvati", + "notification_requests.dismiss": "Odbaci", + "notification_requests.notifications_from": "Obaveštenja od {name}", + "notification_requests.title": "Filtrirana obaveštenja", "notifications.clear": "Obriši obaveštenja", "notifications.clear_confirmation": "Da li ste sigurni da želite trajno da obrišete sva vaša obaveštenja?", "notifications.column_settings.admin.report": "Nove prijave:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Obaveštenja na radnoj površini nisu dostupna zbog prethodno odbijenog zahteva za dozvolu pregledača", "notifications.permission_denied_alert": "Obaveštenja na radnoj površini ne mogu biti omogućena, jer je dozvola pregledača ranije bila odbijena", "notifications.permission_required": "Obaveštenja na radnoj površini nisu dostupna jer potrebna dozvola nije dodeljena.", + "notifications.policy.filter_new_accounts.hint": "Kreirano {days, plural, one {u poslednjeg # dana} few {u poslednja # dana} other {u poslednjih # dana}}", + "notifications.policy.filter_new_accounts_title": "Novi nalozi", + "notifications.policy.filter_not_followers_hint": "Uključujući ljude koji su vas pratili manje od {days, plural, one {# dana} few {# dana} other {# dana}}", + "notifications.policy.filter_not_followers_title": "Ljudi koji vas ne prate", + "notifications.policy.filter_not_following_hint": "Dok ih ručno ne odobrite", + "notifications.policy.filter_not_following_title": "Ljudi koje ne pratite", + "notifications.policy.filter_private_mentions_hint": "Filtrirano osim ako je odgovor na vaše pominjanje ili ako pratite pošiljaoca", + "notifications.policy.filter_private_mentions_title": "Neželjena privatna pominjanja", + "notifications.policy.title": "Filtriraj obaveštenja od…", "notifications_permission_banner.enable": "Omogućiti obaveštenja na radnoj površini", "notifications_permission_banner.how_to_control": "Da biste primali obaveštenja kada Mastodon nije otvoren, omogućite obaveštenja na radnoj površini. Kada su obaveštenja na radnoj površini omogućena vrste interakcija koje ona generišu mogu se podešavati pomoću dugmeta {icon}.", "notifications_permission_banner.title": "Nikada ništa ne propustite", diff --git a/app/javascript/mastodon/locales/sr.json b/app/javascript/mastodon/locales/sr.json index d00e322b4..9f96a2ccc 100644 --- a/app/javascript/mastodon/locales/sr.json +++ b/app/javascript/mastodon/locales/sr.json @@ -241,6 +241,7 @@ "empty_column.list": "У овој листи још нема ничега. Када чланови ове листе објаве нешто ново, појавиће се овде.", "empty_column.lists": "Још увек немате ниједну листу. Када направите једну, она ће се појавити овде.", "empty_column.mutes": "Још увек не игноришете ниједног корисника.", + "empty_column.notification_requests": "Све је чисто! Овде нема ничега. Када добијете нова обавештења, она ће се појавити овде у складу са вашим подешавањима.", "empty_column.notifications": "Још увек немате никаква обавештења. Када други људи буду у интеракцији са вама, видећете то овде.", "empty_column.public": "Овде нема ничега! Напишите нешто јавно или ручно пратите кориснике са других сервера да бисте ово попунили", "error.unexpected_crash.explanation": "Због грешке у нашем коду или проблема са компатибилношћу прегледача, ова страница се није могла правилно приказати.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Користите постојећу категорију или креирајте нову", "filter_modal.select_filter.title": "Филтрирај ову објаву", "filter_modal.title.status": "Филтрирај објаву", + "filtered_notifications_banner.pending_requests": "Обавештења од {count, plural, =0 {никога кога можда познајете} one {# особе коју можда познајете} few {# особе које можда познајете} other {# особа које можда познајете}}", + "filtered_notifications_banner.title": "Филтрирана обавештења", "firehose.all": "Све", "firehose.local": "Овај сервер", "firehose.remote": "Остали сервери", @@ -439,6 +442,10 @@ "notification.reblog": "{name} је подржао вашу објаву", "notification.status": "{name} је управо објавио", "notification.update": "{name} је уредио објаву", + "notification_requests.accept": "Прихвати", + "notification_requests.dismiss": "Одбаци", + "notification_requests.notifications_from": "Обавештења од {name}", + "notification_requests.title": "Филтрирана обавештења", "notifications.clear": "Обриши обавештења", "notifications.clear_confirmation": "Да ли сте сигурни да желите трајно да обришете сва ваша обавештења?", "notifications.column_settings.admin.report": "Нове пријаве:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Обавештења на радној површини нису доступна због претходно одбијеног захтева за дозволу прегледача", "notifications.permission_denied_alert": "Обавештења на радној површини не могу бити омогућена, јер је дозвола прегледача раније била одбијена", "notifications.permission_required": "Обавештења на радној површини нису доступна јер потребна дозвола није додељена.", + "notifications.policy.filter_new_accounts.hint": "Креирано {days, plural, one {у последњег # дана} few {у последња # дана} other {у последњих # дана}}", + "notifications.policy.filter_new_accounts_title": "Нови налози", + "notifications.policy.filter_not_followers_hint": "Укључујући људе који су вас пратили мање од {days, plural, one {# дана} few {# дана} other {# дана}}", + "notifications.policy.filter_not_followers_title": "Људи који вас не прате", + "notifications.policy.filter_not_following_hint": "Док их ручно не одобрите", + "notifications.policy.filter_not_following_title": "Људи које не пратите", + "notifications.policy.filter_private_mentions_hint": "Филтрирано осим ако је одговор на ваше помињање или ако пратите пошиљаоца", + "notifications.policy.filter_private_mentions_title": "Нежељена приватна помињања", + "notifications.policy.title": "Филтрирај обавештења од…", "notifications_permission_banner.enable": "Омогућити обавештења на радној површини", "notifications_permission_banner.how_to_control": "Да бисте примали обавештења када Mastodon није отворен, омогућите обавештења на радној површини. Kада су обавештења на радној површини омогућена врсте интеракција које она генеришу могу се подешавати помоћу дугмета {icon}.", "notifications_permission_banner.title": "Никада ништа не пропустите", diff --git a/app/javascript/mastodon/locales/th.json b/app/javascript/mastodon/locales/th.json index d92cbcda1..30a9601d6 100644 --- a/app/javascript/mastodon/locales/th.json +++ b/app/javascript/mastodon/locales/th.json @@ -271,6 +271,7 @@ "filter_modal.select_filter.subtitle": "ใช้หมวดหมู่ที่มีอยู่หรือสร้างหมวดหมู่ใหม่", "filter_modal.select_filter.title": "กรองโพสต์นี้", "filter_modal.title.status": "กรองโพสต์", + "filtered_notifications_banner.pending_requests": "การแจ้งเตือนจาก {count, plural, =0 {ไม่มีใคร} other {# คน}} ที่คุณอาจรู้จัก", "filtered_notifications_banner.title": "การแจ้งเตือนที่กรองอยู่", "firehose.all": "ทั้งหมด", "firehose.local": "เซิร์ฟเวอร์นี้", diff --git a/app/javascript/mastodon/locales/tr.json b/app/javascript/mastodon/locales/tr.json index 6774ad48e..08fe40fe4 100644 --- a/app/javascript/mastodon/locales/tr.json +++ b/app/javascript/mastodon/locales/tr.json @@ -241,6 +241,7 @@ "empty_column.list": "Henüz bu listede bir şey yok. Bu listenin üyeleri bir şey paylaşığında burada gözükecek.", "empty_column.lists": "Henüz listen yok. Liste oluşturduğunda burada görünür.", "empty_column.mutes": "Henüz bir kullanıcıyı sessize almadınız.", + "empty_column.notification_requests": "Hepsi tamam! Burada yeni bir şey yok. Yeni bildirim aldığınızda, ayarlarınıza göre burada görüntülenecekler.", "empty_column.notifications": "Henüz bildiriminiz yok. Sohbete başlamak için başkalarıyla etkileşim kurun.", "empty_column.public": "Burada hiçbir şey yok! Herkese açık bir şeyler yazın veya burayı doldurmak için diğer sunuculardaki kullanıcıları takip edin", "error.unexpected_crash.explanation": "Bizim kodumuzdaki bir hatadan ya da tarayıcı uyumluluk sorunundan dolayı, bu sayfa düzgün görüntülenemedi.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Mevcut bir kategoriyi kullan veya yeni bir tane oluştur", "filter_modal.select_filter.title": "Bu gönderiyi süzgeçle", "filter_modal.title.status": "Bir gönderi süzgeçle", + "filtered_notifications_banner.pending_requests": "Bildiğiniz {count, plural, =0 {hiç kimseden} one {bir kişiden} other {# kişiden}} bildirim", + "filtered_notifications_banner.title": "Filtrelenmiş bildirimler", "firehose.all": "Tümü", "firehose.local": "Bu sunucu", "firehose.remote": "Diğer sunucular", @@ -356,7 +359,7 @@ "keyboard_shortcuts.hotkey": "Kısayol tuşu", "keyboard_shortcuts.legend": "Bu efsaneyi görüntülemek için", "keyboard_shortcuts.local": "Yerel akışı aç", - "keyboard_shortcuts.mention": "Yazandan bahsetmek için", + "keyboard_shortcuts.mention": "Yazana değinmek için", "keyboard_shortcuts.muted": "Sessize alınmış kullanıcı listesini açmak için", "keyboard_shortcuts.my_profile": "Profilinizi açmak için", "keyboard_shortcuts.notifications": "Bildirimler sütununu açmak için", @@ -433,12 +436,16 @@ "notification.favourite": "{name} gönderinizi beğendi", "notification.follow": "{name} seni takip etti", "notification.follow_request": "{name} size takip isteği gönderdi", - "notification.mention": "{name} senden bahsetti", + "notification.mention": "{name} sana değindi", "notification.own_poll": "Anketiniz sona erdi", "notification.poll": "Oy verdiğiniz bir anket sona erdi", "notification.reblog": "{name} gönderini yeniden paylaştı", "notification.status": "{name} az önce gönderdi", "notification.update": "{name} bir gönderiyi düzenledi", + "notification_requests.accept": "Onayla", + "notification_requests.dismiss": "Yoksay", + "notification_requests.notifications_from": "{name} bildirimleri", + "notification_requests.title": "Filtrelenmiş bildirimler", "notifications.clear": "Bildirimleri temizle", "notifications.clear_confirmation": "Tüm bildirimlerinizi kalıcı olarak temizlemek ister misiniz?", "notifications.column_settings.admin.report": "Yeni bildirimler:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Daha önce reddedilen tarayıcı izinleri isteği nedeniyle masaüstü bildirimleri kullanılamıyor", "notifications.permission_denied_alert": "Tarayıcı izni daha önce reddedildiğinden, masaüstü bildirimleri etkinleştirilemez", "notifications.permission_required": "Masaüstü bildirimleri, gereksinim duyulan izin verilmediği için mevcut değil.", + "notifications.policy.filter_new_accounts.hint": "Son {days, plural, one {bir gün} other {# gün}}de oluşturuldu", + "notifications.policy.filter_new_accounts_title": "Yeni hesaplar", + "notifications.policy.filter_not_followers_hint": "Sizi {days, plural, one {bir gün} other {# gün}}den azdır takip eden kişileri de içeriyor", + "notifications.policy.filter_not_followers_title": "Seni takip etmeyen kullanıcılar", + "notifications.policy.filter_not_following_hint": "Onları manuel olarak onaylayana kadar", + "notifications.policy.filter_not_following_title": "Takip etmediğin kullanıcılar", + "notifications.policy.filter_private_mentions_hint": "Kendi değinmenize yanıt veya takip ettiğiniz kullanıcıdan değilse filtrelenir", + "notifications.policy.filter_private_mentions_title": "İstenmeyen özel değinmeler", + "notifications.policy.title": "Şundan bildirimleri filtrele…", "notifications_permission_banner.enable": "Masaüstü bildirimlerini etkinleştir", "notifications_permission_banner.how_to_control": "Mastodon açık olmadığında bildirim almak için masaüstü bildirimlerini etkinleştirin. Etkinleştirildikten sonra yukarıdaki {icon} düğmesini kullanarak hangi etkileşim türlerinin masaüstü bildirimleri oluşturduğunu tam olarak kontrol edebilirsiniz.", "notifications_permission_banner.title": "Hiçbir şeyi kaçırmayın", diff --git a/app/javascript/mastodon/locales/vi.json b/app/javascript/mastodon/locales/vi.json index b1785ca5d..c74c78012 100644 --- a/app/javascript/mastodon/locales/vi.json +++ b/app/javascript/mastodon/locales/vi.json @@ -241,6 +241,7 @@ "empty_column.list": "Chưa có tút. Khi những người trong danh sách này đăng tút mới, chúng sẽ xuất hiện ở đây.", "empty_column.lists": "Bạn chưa tạo danh sách nào.", "empty_column.mutes": "Bạn chưa ẩn bất kỳ ai.", + "empty_column.notification_requests": "Sạch sẽ! Không còn gì ở đây. Khi bạn nhận được thông báo mới, chúng sẽ xuất hiện ở đây theo cài đặt của bạn.", "empty_column.notifications": "Bạn chưa có thông báo nào. Hãy thử theo dõi hoặc nhắn riêng cho ai đó.", "empty_column.public": "Trống trơn! Bạn hãy viết gì đó hoặc bắt đầu theo dõi những người khác", "error.unexpected_crash.explanation": "Trang này có thể không hiển thị chính xác do lỗi lập trình Mastodon hoặc vấn đề tương thích trình duyệt.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Sử dụng một danh mục hiện có hoặc tạo một danh mục mới", "filter_modal.select_filter.title": "Lọc tút này", "filter_modal.title.status": "Lọc một tút", + "filtered_notifications_banner.pending_requests": "{count, plural, =0 {} other {#}}", + "filtered_notifications_banner.title": "Thông báo đã lọc", "firehose.all": "Toàn bộ", "firehose.local": "Máy chủ này", "firehose.remote": "Máy chủ khác", @@ -439,6 +442,10 @@ "notification.reblog": "{name} đăng lại tút của bạn", "notification.status": "{name} đăng tút mới", "notification.update": "{name} đã sửa tút", + "notification_requests.accept": "Chấp nhận", + "notification_requests.dismiss": "Bỏ qua", + "notification_requests.notifications_from": "Thông báo từ {name}", + "notification_requests.title": "Thông báo đã lọc", "notifications.clear": "Xóa hết thông báo", "notifications.clear_confirmation": "Bạn thật sự muốn xóa vĩnh viễn tất cả thông báo của mình?", "notifications.column_settings.admin.report": "Báo cáo mới:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Trình duyệt không cho phép hiển thị thông báo trên màn hình.", "notifications.permission_denied_alert": "Không thể bật thông báo trên màn hình bởi vì trình duyệt đã cấm trước đó", "notifications.permission_required": "Không hiện thông báo trên màn hình bởi vì chưa cho phép.", + "notifications.policy.filter_new_accounts.hint": "Đã tạo trong vòng {days, plural, other {# ngày}}", + "notifications.policy.filter_new_accounts_title": "Tài khoản mới", + "notifications.policy.filter_not_followers_hint": "Bao gồm những người đã theo dõi bạn ít hơn {days, plural, other {# ngày}}", + "notifications.policy.filter_not_followers_title": "Những người không theo dõi bạn", + "notifications.policy.filter_not_following_hint": "Cho tới khi bạn duyệt họ", + "notifications.policy.filter_not_following_title": "Những người bạn không theo dõi", + "notifications.policy.filter_private_mentions_hint": "Được lọc trừ khi nó trả lời lượt nhắc từ bạn hoặc nếu bạn theo dõi người gửi", + "notifications.policy.filter_private_mentions_title": "Lượt nhắc riêng tư không được yêu cầu", + "notifications.policy.title": "Lọc ra thông báo từ…", "notifications_permission_banner.enable": "Cho phép thông báo trên màn hình", "notifications_permission_banner.how_to_control": "Hãy bật thông báo trên màn hình để không bỏ lỡ những thông báo từ Mastodon. Một khi đã bật, bạn có thể lựa chọn từng loại thông báo khác nhau thông qua {icon} nút bên dưới.", "notifications_permission_banner.title": "Không bỏ lỡ điều thú vị nào", diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 5d62f9143..af5e1cfea 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -508,7 +508,7 @@ fa: private_comment: یادداشت خصوصی public_comment: یادداشت عمومی purge: پاکسازی - title: ارتباط میان‌سروری + title: ارتباط همگانی total_blocked_by_us: مسدودشده از طرف ما total_followed_by_them: ما را پی می‌گیرند total_followed_by_us: ما پیگیرشان هستیم @@ -673,7 +673,7 @@ fa: follow_recommendations: پیروی از پیشنهادها profile_directory: شاخهٔ نمایه public_timelines: خط زمانی‌های عمومی - publish_discovered_servers: انتشار سرورهای یافته‌شده + publish_discovered_servers: انتشار کارسازهای کشف شده publish_statistics: انتشار آمار title: کشف trends: پرطرفدارها @@ -898,7 +898,7 @@ fa: description: prefix_invited_by_user: "@%{name} شما را به عضویت در این کارساز ماستودون دعوت کرده است!" prefix_sign_up: همین امروز عضو ماستودون شوید! - suffix: با داشتن حساب می‌توانید دیگران را پی بگیرید، نوشته‌های تازه منتشر کنید، و با کاربران دیگر از هر سرور ماستودون دیگری و حتی سرورهای دیگر در ارتباط باشید! + suffix: با داشتن حساب می‌توانید دیگران را پی گرفته، نوشته‌هایی منتشر کرده و با کاربرانی از هر کارساز ماستودن دیگری در ارتباط باشید! didnt_get_confirmation: یک پیوند تأیید را دریافت نکردید؟ dont_have_your_security_key: کلید امنیتیتان را ندارید؟ forgot_password: گذرواژه خود را فراموش کرده‌اید؟ @@ -921,7 +921,7 @@ fa: cas: CAS saml: SAML register: عضو شوید - registration_closed: سرور %{instance} عضو تازه‌ای نمی‌پذیرد + registration_closed: کارساز %{instance} عضو تازه‌ای نمی‌پذیرد resend_confirmation: ارسال مجدد پیوند تایید reset_password: بازنشانی گذرواژه rules: diff --git a/config/locales/fi.yml b/config/locales/fi.yml index bc73e3ee0..156a4700e 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1551,7 +1551,7 @@ fi: limit_reached: Erilaisten reaktioiden raja saavutettu unrecognized_emoji: ei ole tunnistettu emoji redirects: - prompt: Mikäli luotat linkkiin, jatka napsauttaen sitä. + prompt: Jos luotat linkkiin, jatka napsauttamalla sitä. title: Olet poistumassa palvelimelta %{instance}. relationships: activity: Tilin aktiivisuus @@ -1802,7 +1802,7 @@ fi: explanation: Joku on yrittänyt kirjautua tilillesi antaen väärän toisen todennustunnisteen. further_actions_html: Jos se et ollut sinä, suosittelemme, että %{action} välittömästi, sillä se on saattanut vaarantua. subject: Kaksivaiheisen todennuksen virhe - title: Kaksivaihekirjautumisen toinen vaihe epäonnistui + title: Kaksivaiheisen kirjautumisen toinen vaihe epäonnistui suspicious_sign_in: change_password: vaihda salasanasi details: 'Tässä on tiedot kirjautumisesta:' diff --git a/config/locales/lad.yml b/config/locales/lad.yml index 229304537..8affb2a88 100644 --- a/config/locales/lad.yml +++ b/config/locales/lad.yml @@ -1846,15 +1846,25 @@ lad: apps_ios_action: Abasha en App Store apps_step: Abasha muestras aplikasyones ofisyalas. apps_title: Aplikasyones de Mastodon + checklist_title: Lista de bienvenida edit_profile_action: Personaliza edit_profile_step: Kompleta tu profil para aumentar tus enteraksyones. edit_profile_title: Personaliza tu profil explanation: Aki ay algunos konsejos para ampesar feature_action: Ambezate mas + feature_audience_title: Konstruye tu audyensya kon konfyansa + feature_control_title: Manten kontrol de tu linya de tyempo + feature_creativity_title: Kreativita sin paralelas + feature_moderation_title: La moderasyon komo deveria ser follow_action: Sige follow_title: Personaliza tu linya prinsipala + follows_subtitle: Sige kuentos konesidos follows_title: A ken segir + follows_view_more: Ve mas personas para segir + hashtags_recent_count: "%{people} personas en los ultimos %{days} diyas" + hashtags_subtitle: Eksplora los trendes de los ultimos 2 diyas hashtags_title: Etiketas en trend + hashtags_view_more: Ve mas etiketas en trend post_action: Eskrive post_step: Puedes introdusirte al mundo kon teksto, fotos, videos o anketas. post_title: Eskrive tu primera publikasyon diff --git a/config/locales/simple_form.be.yml b/config/locales/simple_form.be.yml index e72d16a18..245c1e852 100644 --- a/config/locales/simple_form.be.yml +++ b/config/locales/simple_form.be.yml @@ -116,6 +116,7 @@ be: sign_up_requires_approval: Новыя рэгістрацыі запатрабуюць вашага ўзгаднення severity: Абярыце, што будзе адбывацца з запытамі з гэтага IP rule: + hint: Неабавязкова. Пазначце дадатковыя звесткі аб правіле text: Апішыце правіла ці патрабаванне для карыстальнікаў на гэтым серверы. Імкніцеся зрабіць яго простым ды кароткім sessions: otp: 'Увядзіце код двухфактарнай аўтэнтыфікацыі з вашага тэлефона або адзін з кодаў аднаўлення:' @@ -299,6 +300,7 @@ be: patch: Апавяшчаць аб абнаўленнях з выпраўленнем памылак trending_tag: Новы трэнд патрабуе разгляду rule: + hint: Дадатковая інфармацыя text: Правіла settings: indexable: Індэксаваць профіль у пошукавых сістэмах diff --git a/config/locales/simple_form.ca.yml b/config/locales/simple_form.ca.yml index 357f482b8..e4bee0214 100644 --- a/config/locales/simple_form.ca.yml +++ b/config/locales/simple_form.ca.yml @@ -116,7 +116,7 @@ ca: sign_up_requires_approval: Els nous registres requeriran la teva aprovació severity: Tria què passarà amb les sol·licituds des d’aquesta IP rule: - hint: Opcional. Proporciona més detalls de la regla + hint: Opcional. Proporcioneu més detalls de la regla text: Descriu una norma o requeriment pels usuaris d'aquest servidor. Intenta fer-la curta i senzilla sessions: otp: 'Introdueix el codi de dos factors generat per el teu telèfon o utilitza un dels teus codis de recuperació:' diff --git a/config/locales/simple_form.fa.yml b/config/locales/simple_form.fa.yml index a312e5aa1..03f187545 100644 --- a/config/locales/simple_form.fa.yml +++ b/config/locales/simple_form.fa.yml @@ -62,7 +62,7 @@ fa: username: تنها می‌توانید از حروف، اعداد، و زیرخط استفاده کنید whole_word: اگر کلیدواژه فقط دارای حروف و اعداد باشد، تنها وقتی پیدا می‌شود که با کل یک واژه در متن منطبق باشد، نه با بخشی از یک واژه domain_allow: - domain: این دامین خواهد توانست داده‌ها از این سرور را دریافت کند و داده‌های از این دامین در این‌جا پردازش و ذخیره خواهند شد + domain: این دامنه خواهد توانست داده‌ها را از این کارساز واکشی کرده و داده‌های ورودی از آن پردازش و ذخیره خواهند شد email_domain_block: domain: این می‌تواند نام دامنه‌ای باشد که در نشانی رایانامه یا رکورد MX استفاده می‌شود. پس از ثبت نام بررسی خواهند شد. with_dns_records: تلاشی برای resolve کردن رکوردهای ساناد دامنهٔ داده‌شده انجام شده و نتیجه نیز مسدود خواهد شد diff --git a/config/locales/simple_form.fi.yml b/config/locales/simple_form.fi.yml index 3d79f76e8..b1c2e91a1 100644 --- a/config/locales/simple_form.fi.yml +++ b/config/locales/simple_form.fi.yml @@ -116,6 +116,7 @@ fi: sign_up_requires_approval: Uudet rekisteröitymiset edellyttävät hyväksyntääsi severity: Valitse, mitä tapahtuu tämän IP-osoitteen pyynnöille rule: + hint: Valinnainen. Anna lisätietoja säännöstä text: Kuvaile sääntöä tai edellytystä palvelimesi käyttäjille. Suosi tiivistä, yksinkertaista ilmaisua sessions: otp: 'Näppäile mobiilisovelluksessa näkyvä kaksivaiheisen todennuksen tunnusluku, tai käytä tarvittaessa palautuskoodia:' @@ -299,6 +300,7 @@ fi: patch: Ilmoita virhekorjauspäivityksistä trending_tag: Uusi trendi vaatii tarkistusta rule: + hint: Lisätietoja text: Sääntö settings: indexable: Sisällytä profiilisivu hakukoneisiin diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index e7b8e1561..81615c134 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -116,6 +116,7 @@ ja: sign_up_requires_approval: 承認するまで新規登録が完了しなくなります severity: このIPに対する措置を選択してください rule: + hint: ルールについての具体的な説明を追加できます (任意) text: ユーザーのためのルールや要件を記述してください。短くシンプルにしてください。 sessions: otp: '携帯電話のアプリで生成された二要素認証コードを入力するか、リカバリーコードを使用してください:' @@ -299,6 +300,7 @@ ja: patch: 緊急のアップデートとバグ修正アップデートを通知する trending_tag: 新しいトレンドのレビューをする必要がある時 rule: + hint: ルールの補足説明 text: ルール settings: indexable: 検索エンジンからアクセスできるようにする diff --git a/config/locales/simple_form.lad.yml b/config/locales/simple_form.lad.yml index 2de24c38f..75113be18 100644 --- a/config/locales/simple_form.lad.yml +++ b/config/locales/simple_form.lad.yml @@ -116,6 +116,7 @@ lad: sign_up_requires_approval: Muevas enrejistrasyones rekeriran tu achetasyon severity: Eskoje lo ke pasara kon las petisyones dizde este IP rule: + hint: Opsyonal. Adjusta mas detalyos sovre la regla text: Deskrive una norma o rekerensya para los utilizadores de este sirvidor. Aprova fazerla kurta i kolay sessions: otp: 'Introduse el kodiche de autentifikasyon de dos pasos djenerado por tu aplikasyon de telefon o uza uno de tus kodiches de recuperasyon:' diff --git a/config/locales/simple_form.sr-Latn.yml b/config/locales/simple_form.sr-Latn.yml index 6ed095e2a..13296a04c 100644 --- a/config/locales/simple_form.sr-Latn.yml +++ b/config/locales/simple_form.sr-Latn.yml @@ -116,6 +116,7 @@ sr-Latn: sign_up_requires_approval: Nove registracije će zahtevati Vaše odobrenje severity: Izaberite šta će se desiti sa zahtevima sa ove IP adrese rule: + hint: Opcionalno. Pružite više detalja o pravilu text: Opišite pravilo ili uslov za korisnike na ovom serveru. Potrudite se da opis bude kratak i jednostavan sessions: otp: 'Unesite dvofaktorski kod sa Vašeg telefona ili koristite jedan od kodova za oporavak:' diff --git a/config/locales/simple_form.sr.yml b/config/locales/simple_form.sr.yml index 4fb32000b..982048218 100644 --- a/config/locales/simple_form.sr.yml +++ b/config/locales/simple_form.sr.yml @@ -116,6 +116,7 @@ sr: sign_up_requires_approval: Нове регистрације ће захтевати Ваше одобрење severity: Изаберите шта ће се десити са захтевима са ове IP адресе rule: + hint: Опционално. Пружите више детаља о правилу text: Опишите правило или услов за кориснике на овом серверу. Потрудите се да опис буде кратак и једноставан sessions: otp: 'Унесите двофакторски код са Вашег телефона или користите један од кодова за опоравак:' diff --git a/config/locales/simple_form.tr.yml b/config/locales/simple_form.tr.yml index cc644d4df..16c23caeb 100644 --- a/config/locales/simple_form.tr.yml +++ b/config/locales/simple_form.tr.yml @@ -116,6 +116,7 @@ tr: sign_up_requires_approval: Yeni kayıt onayınızı gerektirir severity: Bu IP'den gelen isteklere ne olacağını seçin rule: + hint: İsteğe bağlı. Kural hakkında daha fazla ayrıntı verin text: Bu sunucu üzerindeki kullanıcılar için bir kural veya gereksinimi tanımlayın. Kuralı kısa ve yalın tutmaya çalışın sessions: otp: 'Telefonunuzdaki two-factor kodunuzu giriniz veya kurtarma kodlarınızdan birini giriniz:' @@ -299,6 +300,7 @@ tr: patch: Yama güncellemelerini bildir trending_tag: Yeni eğilimin gözden geçmesi gerekiyor rule: + hint: Ek bilgi text: Kural settings: indexable: Arama motorları profil sayfasını içersin diff --git a/config/locales/sq.yml b/config/locales/sq.yml index ecf79da51..0aa7ad34b 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1843,6 +1843,7 @@ sq: apps_step: Shkarkoni aplikacionet tona zyrtare. apps_title: Aplikacione Mastodon checklist_subtitle: 'Le t’ju vëmë në udhë drejt këtij horizonti të ri rrjetesh shoqërorë:' + checklist_title: Listë hapash mirëseardhjeje edit_profile_action: Personalizojeni edit_profile_step: Përforconi ndërveprimet tuaja, duke pasur një profil shterues. edit_profile_title: Personalizoni profilin tuaj From acf3f410aef3cfb9e8f5f73042526de9b2f96d13 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Wed, 13 Mar 2024 13:54:50 +0100 Subject: [PATCH 18/45] Fix navigation panel icons missing classes (#29569) --- .../mastodon/features/ui/components/navigation_panel.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx index deda3258b..f2b40af72 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx @@ -64,8 +64,8 @@ const NotificationsLink = () => { } - activeIcon={} + icon={} + activeIcon={} text={intl.formatMessage(messages.notifications)} /> ); @@ -88,8 +88,8 @@ const FollowRequestsLink = () => { } - activeIcon={} + icon={} + activeIcon={} text={intl.formatMessage(messages.followRequests)} /> ); From c09b8a716473ff251ecd81fe6050a38133ddabb0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 10:11:23 -0400 Subject: [PATCH 19/45] Add `Account.without_internal` scope (#29559) Co-authored-by: Claire --- app/controllers/application_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/models/account.rb | 1 + spec/models/account_spec.rb | 8 ++++---- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a046ea19c..8ba10d64c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -129,7 +129,7 @@ class ApplicationController < ActionController::Base end def single_user_mode? - @single_user_mode ||= Rails.configuration.x.single_user_mode && Account.where('id > 0').exists? + @single_user_mode ||= Rails.configuration.x.single_user_mode && Account.without_internal.exists? end def use_seamless_external_login? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4f7f66985..a4f92743c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -213,7 +213,7 @@ module ApplicationHelper state_params[:moved_to_account] = current_account.moved_to_account end - state_params[:owner] = Account.local.without_suspended.where('id > 0').first if single_user_mode? + state_params[:owner] = Account.local.without_suspended.without_internal.first if single_user_mode? json = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(state_params), serializer: InitialStateSerializer).to_json # rubocop:disable Rails/OutputSafety diff --git a/app/models/account.rb b/app/models/account.rb index d627fd6b6..0a4c0f347 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -111,6 +111,7 @@ class Account < ApplicationRecord normalizes :username, with: ->(username) { username.squish } + scope :without_internal, -> { where(id: 1...) } scope :remote, -> { where.not(domain: nil) } scope :local, -> { where(domain: nil) } scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) } diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index f6376eb36..bdb33e53c 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -888,7 +888,7 @@ RSpec.describe Account do { username: 'b', domain: 'b' }, ].map(&method(:Fabricate).curry(2).call(:account)) - expect(described_class.where('id > 0').alphabetic).to eq matches + expect(described_class.without_internal.alphabetic).to eq matches end end @@ -939,7 +939,7 @@ RSpec.describe Account do it 'returns an array of accounts who do not have a domain' do local_account = Fabricate(:account, domain: nil) _account_with_domain = Fabricate(:account, domain: 'example.com') - expect(described_class.where('id > 0').local).to contain_exactly(local_account) + expect(described_class.without_internal.local).to contain_exactly(local_account) end end @@ -950,14 +950,14 @@ RSpec.describe Account do matches[index] = Fabricate(:account, domain: matches[index]) end - expect(described_class.where('id > 0').partitioned).to match_array(matches) + expect(described_class.without_internal.partitioned).to match_array(matches) end end describe 'recent' do it 'returns a relation of accounts sorted by recent creation' do matches = Array.new(2) { Fabricate(:account) } - expect(described_class.where('id > 0').recent).to match_array(matches) + expect(described_class.without_internal.recent).to match_array(matches) end end From 6262ceeb704c9636f09c25e856638ee4441b58d9 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 11:42:39 -0400 Subject: [PATCH 20/45] Fix `RSpec/DescribedClass` cop (#29472) --- spec/lib/feed_manager_spec.rb | 12 +++++----- spec/lib/sanitize/config_spec.rb | 2 +- spec/lib/signature_parser_spec.rb | 2 +- spec/lib/webfinger_resource_spec.rb | 4 ++-- spec/models/account_spec.rb | 2 +- spec/models/form/import_spec.rb | 2 +- spec/models/privacy_policy_spec.rb | 2 +- spec/models/tag_spec.rb | 2 +- spec/models/user_role_spec.rb | 22 +++++++++---------- spec/models/user_settings_spec.rb | 4 ++-- spec/services/post_status_service_spec.rb | 2 +- .../validators/follow_limit_validator_spec.rb | 2 +- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index 618b6167b..613bcb304 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -11,7 +11,7 @@ RSpec.describe FeedManager do end it 'tracks at least as many statuses as reblogs', :skip_stub do - expect(FeedManager::REBLOG_FALLOFF).to be <= FeedManager::MAX_ITEMS + expect(described_class::REBLOG_FALLOFF).to be <= described_class::MAX_ITEMS end describe '#key' do @@ -225,12 +225,12 @@ RSpec.describe FeedManager do it 'trims timelines if they will have more than FeedManager::MAX_ITEMS' do account = Fabricate(:account) status = Fabricate(:status) - members = Array.new(FeedManager::MAX_ITEMS) { |count| [count, count] } + members = Array.new(described_class::MAX_ITEMS) { |count| [count, count] } redis.zadd("feed:home:#{account.id}", members) described_class.instance.push_to_home(account, status) - expect(redis.zcard("feed:home:#{account.id}")).to eq FeedManager::MAX_ITEMS + expect(redis.zcard("feed:home:#{account.id}")).to eq described_class::MAX_ITEMS end context 'with reblogs' do @@ -260,7 +260,7 @@ RSpec.describe FeedManager do described_class.instance.push_to_home(account, reblogged) # Fill the feed with intervening statuses - FeedManager::REBLOG_FALLOFF.times do + described_class::REBLOG_FALLOFF.times do described_class.instance.push_to_home(account, Fabricate(:status)) end @@ -321,7 +321,7 @@ RSpec.describe FeedManager do described_class.instance.push_to_home(account, reblogs.first) # Fill the feed with intervening statuses - FeedManager::REBLOG_FALLOFF.times do + described_class::REBLOG_FALLOFF.times do described_class.instance.push_to_home(account, Fabricate(:status)) end @@ -467,7 +467,7 @@ RSpec.describe FeedManager do status = Fabricate(:status, reblog: reblogged) described_class.instance.push_to_home(receiver, reblogged) - FeedManager::REBLOG_FALLOFF.times { described_class.instance.push_to_home(receiver, Fabricate(:status)) } + described_class::REBLOG_FALLOFF.times { described_class.instance.push_to_home(receiver, Fabricate(:status)) } described_class.instance.push_to_home(receiver, status) # The reblogging status should show up under normal conditions. diff --git a/spec/lib/sanitize/config_spec.rb b/spec/lib/sanitize/config_spec.rb index 550ad1c52..2d8dc2f63 100644 --- a/spec/lib/sanitize/config_spec.rb +++ b/spec/lib/sanitize/config_spec.rb @@ -4,7 +4,7 @@ require 'rails_helper' describe Sanitize::Config do describe '::MASTODON_STRICT' do - subject { Sanitize::Config::MASTODON_STRICT } + subject { described_class::MASTODON_STRICT } it 'converts h1 to p strong' do expect(Sanitize.fragment('

Foo

', subject)).to eq '

Foo

' diff --git a/spec/lib/signature_parser_spec.rb b/spec/lib/signature_parser_spec.rb index 08e9bea66..3f398e8dd 100644 --- a/spec/lib/signature_parser_spec.rb +++ b/spec/lib/signature_parser_spec.rb @@ -27,7 +27,7 @@ RSpec.describe SignatureParser do let(:header) { 'hello this is malformed!' } it 'raises an error' do - expect { subject }.to raise_error(SignatureParser::ParsingError) + expect { subject }.to raise_error(described_class::ParsingError) end end end diff --git a/spec/lib/webfinger_resource_spec.rb b/spec/lib/webfinger_resource_spec.rb index 0e2bdcb71..442f91aad 100644 --- a/spec/lib/webfinger_resource_spec.rb +++ b/spec/lib/webfinger_resource_spec.rb @@ -46,7 +46,7 @@ describe WebfingerResource do expect do described_class.new(resource).username - end.to raise_error(WebfingerResource::InvalidRequest) + end.to raise_error(described_class::InvalidRequest) end it 'finds the username in a valid https route' do @@ -137,7 +137,7 @@ describe WebfingerResource do expect do described_class.new(resource).username - end.to raise_error(WebfingerResource::InvalidRequest) + end.to raise_error(described_class::InvalidRequest) end end end diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index bdb33e53c..2c5df198d 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -678,7 +678,7 @@ RSpec.describe Account do end describe 'MENTION_RE' do - subject { Account::MENTION_RE } + subject { described_class::MENTION_RE } it 'matches usernames in the middle of a sentence' do expect(subject.match('Hello to @alice from me')[1]).to eq 'alice' diff --git a/spec/models/form/import_spec.rb b/spec/models/form/import_spec.rb index 872697485..c2f41d442 100644 --- a/spec/models/form/import_spec.rb +++ b/spec/models/form/import_spec.rb @@ -30,7 +30,7 @@ RSpec.describe Form::Import do it 'has errors' do subject.validate - expect(subject.errors[:data]).to include(I18n.t('imports.errors.over_rows_processing_limit', count: Form::Import::ROWS_PROCESSING_LIMIT)) + expect(subject.errors[:data]).to include(I18n.t('imports.errors.over_rows_processing_limit', count: described_class::ROWS_PROCESSING_LIMIT)) end end diff --git a/spec/models/privacy_policy_spec.rb b/spec/models/privacy_policy_spec.rb index 0d7471375..03bbe7264 100644 --- a/spec/models/privacy_policy_spec.rb +++ b/spec/models/privacy_policy_spec.rb @@ -8,7 +8,7 @@ describe PrivacyPolicy do it 'has the privacy text' do policy = described_class.current - expect(policy.text).to eq(PrivacyPolicy::DEFAULT_PRIVACY_POLICY) + expect(policy.text).to eq(described_class::DEFAULT_PRIVACY_POLICY) end end diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb index 69aaeed0a..5a1d62088 100644 --- a/spec/models/tag_spec.rb +++ b/spec/models/tag_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Tag do end describe 'HASHTAG_RE' do - subject { Tag::HASHTAG_RE } + subject { described_class::HASHTAG_RE } it 'does not match URLs with anchors with non-hashtag characters' do expect(subject.match('Check this out https://medium.com/@alice/some-article#.abcdef123')).to be_nil diff --git a/spec/models/user_role_spec.rb b/spec/models/user_role_spec.rb index 96d12263a..4ab66c326 100644 --- a/spec/models/user_role_spec.rb +++ b/spec/models/user_role_spec.rb @@ -8,7 +8,7 @@ RSpec.describe UserRole do describe '#can?' do context 'with a single flag' do it 'returns true if any of them are present' do - subject.permissions = UserRole::FLAGS[:manage_reports] + subject.permissions = described_class::FLAGS[:manage_reports] expect(subject.can?(:manage_reports)).to be true end @@ -19,7 +19,7 @@ RSpec.describe UserRole do context 'with multiple flags' do it 'returns true if any of them are present' do - subject.permissions = UserRole::FLAGS[:manage_users] + subject.permissions = described_class::FLAGS[:manage_users] expect(subject.can?(:manage_reports, :manage_users)).to be true end @@ -51,7 +51,7 @@ RSpec.describe UserRole do describe '#permissions_as_keys' do before do - subject.permissions = UserRole::FLAGS[:invite_users] | UserRole::FLAGS[:view_dashboard] | UserRole::FLAGS[:manage_reports] + subject.permissions = described_class::FLAGS[:invite_users] | described_class::FLAGS[:view_dashboard] | described_class::FLAGS[:manage_reports] end it 'returns an array' do @@ -70,7 +70,7 @@ RSpec.describe UserRole do let(:input) { %w(manage_users) } it 'sets permission flags' do - expect(subject.permissions).to eq UserRole::FLAGS[:manage_users] + expect(subject.permissions).to eq described_class::FLAGS[:manage_users] end end @@ -78,7 +78,7 @@ RSpec.describe UserRole do let(:input) { %w(manage_users manage_reports) } it 'sets permission flags' do - expect(subject.permissions).to eq UserRole::FLAGS[:manage_users] | UserRole::FLAGS[:manage_reports] + expect(subject.permissions).to eq described_class::FLAGS[:manage_users] | described_class::FLAGS[:manage_reports] end end @@ -86,7 +86,7 @@ RSpec.describe UserRole do let(:input) { %w(foo) } it 'does not set permission flags' do - expect(subject.permissions).to eq UserRole::Flags::NONE + expect(subject.permissions).to eq described_class::Flags::NONE end end end @@ -96,7 +96,7 @@ RSpec.describe UserRole do subject { described_class.nobody } it 'returns none' do - expect(subject.computed_permissions).to eq UserRole::Flags::NONE + expect(subject.computed_permissions).to eq described_class::Flags::NONE end end @@ -110,11 +110,11 @@ RSpec.describe UserRole do context 'when role has the administrator flag' do before do - subject.permissions = UserRole::FLAGS[:administrator] + subject.permissions = described_class::FLAGS[:administrator] end it 'returns all permissions' do - expect(subject.computed_permissions).to eq UserRole::Flags::ALL + expect(subject.computed_permissions).to eq described_class::Flags::ALL end end @@ -135,7 +135,7 @@ RSpec.describe UserRole do end it 'has default permissions' do - expect(subject.permissions).to eq UserRole::FLAGS[:invite_users] + expect(subject.permissions).to eq described_class::FLAGS[:invite_users] end it 'has negative position' do @@ -155,7 +155,7 @@ RSpec.describe UserRole do end it 'has no permissions' do - expect(subject.permissions).to eq UserRole::Flags::NONE + expect(subject.permissions).to eq described_class::Flags::NONE end it 'has negative position' do diff --git a/spec/models/user_settings_spec.rb b/spec/models/user_settings_spec.rb index 653597c90..dfc4910d6 100644 --- a/spec/models/user_settings_spec.rb +++ b/spec/models/user_settings_spec.rb @@ -24,7 +24,7 @@ RSpec.describe UserSettings do context 'when setting was not defined' do it 'raises error' do - expect { subject[:foo] }.to raise_error UserSettings::KeyError + expect { subject[:foo] }.to raise_error described_class::KeyError end end end @@ -93,7 +93,7 @@ RSpec.describe UserSettings do describe '.definition_for' do context 'when key is defined' do it 'returns a setting' do - expect(described_class.definition_for(:always_send_emails)).to be_a UserSettings::Setting + expect(described_class.definition_for(:always_send_emails)).to be_a described_class::Setting end end diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index ee68092a3..3c2e4f3a7 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -150,7 +150,7 @@ RSpec.describe PostStatusService do expect do subject.call(account, text: '@alice hm, @bob is really annoying lately', allowed_mentions: [mentioned_account.id]) - end.to raise_error(an_instance_of(PostStatusService::UnexpectedMentionsError).and(having_attributes(accounts: [unexpected_mentioned_account]))) + end.to raise_error(an_instance_of(described_class::UnexpectedMentionsError).and(having_attributes(accounts: [unexpected_mentioned_account]))) end it 'processes duplicate mentions correctly' do diff --git a/spec/validators/follow_limit_validator_spec.rb b/spec/validators/follow_limit_validator_spec.rb index 51b0683d2..e069b0ed3 100644 --- a/spec/validators/follow_limit_validator_spec.rb +++ b/spec/validators/follow_limit_validator_spec.rb @@ -56,7 +56,7 @@ RSpec.describe FollowLimitValidator do follow.valid? - expect(follow.errors[:base]).to include(I18n.t('users.follow_limit_reached', limit: FollowLimitValidator::LIMIT)) + expect(follow.errors[:base]).to include(I18n.t('users.follow_limit_reached', limit: described_class::LIMIT)) end end From 71e5f0f48c3bc95a894fa3ad2c5a34f05c584482 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 11:43:40 -0400 Subject: [PATCH 21/45] Add coverage for suspended instance actor scenario (#29571) --- spec/controllers/instance_actors_controller_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/controllers/instance_actors_controller_spec.rb b/spec/controllers/instance_actors_controller_spec.rb index 70aaff9d6..42ffb6798 100644 --- a/spec/controllers/instance_actors_controller_spec.rb +++ b/spec/controllers/instance_actors_controller_spec.rb @@ -41,6 +41,14 @@ RSpec.describe InstanceActorsController do it_behaves_like 'shared behavior' end + + context 'with a suspended instance actor' do + let(:authorized_fetch_mode) { false } + + before { Account.representative.update(suspended_at: 10.days.ago) } + + it_behaves_like 'shared behavior' + end end end end From a32a126cac42c73236236b5a9bd660765b9c58ee Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 13 Mar 2024 17:47:48 +0100 Subject: [PATCH 22/45] Hide media by default in notification requests (#29572) --- app/javascript/mastodon/components/status.jsx | 25 ++++++----- .../features/notifications/request.jsx | 41 ++++++++++--------- .../ui/util/sensitive_media_context.tsx | 28 +++++++++++++ 3 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 app/javascript/mastodon/features/ui/util/sensitive_media_context.tsx diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index be9a1cec6..7b97e4576 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -22,6 +22,7 @@ import Card from '../features/status/components/card'; // to use the progress bar to show download progress import Bundle from '../features/ui/components/bundle'; import { MediaGallery, Video, Audio } from '../features/ui/util/async-components'; +import { SensitiveMediaContext } from '../features/ui/util/sensitive_media_context'; import { displayMedia } from '../initial_state'; import { Avatar } from './avatar'; @@ -78,6 +79,8 @@ const messages = defineMessages({ class Status extends ImmutablePureComponent { + static contextType = SensitiveMediaContext; + static propTypes = { status: ImmutablePropTypes.map, account: ImmutablePropTypes.record, @@ -133,19 +136,21 @@ class Status extends ImmutablePureComponent { ]; state = { - showMedia: defaultMediaVisibility(this.props.status), - statusId: undefined, + showMedia: defaultMediaVisibility(this.props.status) && !(this.context?.hideMediaByDefault), forceFilter: undefined, }; - static getDerivedStateFromProps(nextProps, prevState) { - if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) { - return { - showMedia: defaultMediaVisibility(nextProps.status), - statusId: nextProps.status.get('id'), - }; - } else { - return null; + componentDidUpdate (prevProps) { + // This will potentially cause a wasteful redraw, but in most cases `Status` components are used + // with a `key` directly depending on their `id`, preventing re-use of the component across + // different IDs. + // But just in case this does change, reset the state on status change. + + if (this.props.status?.get('id') !== prevProps.status?.get('id')) { + this.setState({ + showMedia: defaultMediaVisibility(this.props.status) && !(this.context?.hideMediaByDefault), + forceFilter: undefined, + }); } } diff --git a/app/javascript/mastodon/features/notifications/request.jsx b/app/javascript/mastodon/features/notifications/request.jsx index 5977a6ce9..da9ed21e5 100644 --- a/app/javascript/mastodon/features/notifications/request.jsx +++ b/app/javascript/mastodon/features/notifications/request.jsx @@ -15,6 +15,7 @@ import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; import { IconButton } from 'mastodon/components/icon_button'; import ScrollableList from 'mastodon/components/scrollable_list'; +import { SensitiveMediaContextProvider } from 'mastodon/features/ui/util/sensitive_media_context'; import NotificationContainer from './containers/notification_container'; @@ -106,25 +107,27 @@ export const NotificationRequest = ({ multiColumn, params: { id } }) => { )} /> - - {notifications.map(item => ( - item && - ))} - + + + {notifications.map(item => ( + item && + ))} + + {columnTitle} diff --git a/app/javascript/mastodon/features/ui/util/sensitive_media_context.tsx b/app/javascript/mastodon/features/ui/util/sensitive_media_context.tsx new file mode 100644 index 000000000..408154c31 --- /dev/null +++ b/app/javascript/mastodon/features/ui/util/sensitive_media_context.tsx @@ -0,0 +1,28 @@ +import { createContext, useContext, useMemo } from 'react'; + +export const SensitiveMediaContext = createContext<{ + hideMediaByDefault: boolean; +}>({ + hideMediaByDefault: false, +}); + +export function useSensitiveMediaContext() { + return useContext(SensitiveMediaContext); +} + +type ContextValue = React.ContextType; + +export const SensitiveMediaContextProvider: React.FC< + React.PropsWithChildren<{ hideMediaByDefault: boolean }> +> = ({ hideMediaByDefault, children }) => { + const contextValue = useMemo( + () => ({ hideMediaByDefault }), + [hideMediaByDefault], + ); + + return ( + + {children} + + ); +}; From 3156d04ec12294b4b211b191b22d245e18aba024 Mon Sep 17 00:00:00 2001 From: mogaminsk Date: Thu, 14 Mar 2024 17:58:44 +0900 Subject: [PATCH 23/45] Use sender's `username` to column title in notification request if it's `display_name` is not set (#29575) --- app/javascript/mastodon/features/notifications/request.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/notifications/request.jsx b/app/javascript/mastodon/features/notifications/request.jsx index da9ed21e5..d1f449844 100644 --- a/app/javascript/mastodon/features/notifications/request.jsx +++ b/app/javascript/mastodon/features/notifications/request.jsx @@ -88,7 +88,7 @@ export const NotificationRequest = ({ multiColumn, params: { id } }) => { } }, [dispatch, accountId]); - const columnTitle = intl.formatMessage(messages.title, { name: account?.get('display_name') }); + const columnTitle = intl.formatMessage(messages.title, { name: account?.get('display_name') || account?.get('username') }); return ( From 42875fee52857ddf9745d056f5da7159cf4f22e6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 04:58:53 -0400 Subject: [PATCH 24/45] Add coverage for bad args/options in `CLI::Domains#purge` (#29578) --- spec/lib/mastodon/cli/domains_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/lib/mastodon/cli/domains_spec.rb b/spec/lib/mastodon/cli/domains_spec.rb index 24f341c12..448e6fe42 100644 --- a/spec/lib/mastodon/cli/domains_spec.rb +++ b/spec/lib/mastodon/cli/domains_spec.rb @@ -15,6 +15,23 @@ describe Mastodon::CLI::Domains do describe '#purge' do let(:action) { :purge } + context 'with invalid limited federation mode argument' do + let(:arguments) { ['example.host'] } + let(:options) { { limited_federation_mode: true } } + + it 'warns about usage and exits' do + expect { subject } + .to raise_error(Thor::Error, /DOMAIN parameter not supported/) + end + end + + context 'without a domains argument' do + it 'warns about usage and exits' do + expect { subject } + .to raise_error(Thor::Error, 'No domain(s) given') + end + end + context 'with accounts from the domain' do let(:domain) { 'host.example' } let!(:account) { Fabricate(:account, domain: domain) } From 5aea35de13a74a3d3cfec734cc1fbe176c84cfa1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 10:00:42 +0100 Subject: [PATCH 25/45] New Crowdin Translations (automated) (#29587) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/ca.json | 7 ++++--- app/javascript/mastodon/locales/fi.json | 5 +++++ app/javascript/mastodon/locales/he.json | 1 + app/javascript/mastodon/locales/kab.json | 2 +- app/javascript/mastodon/locales/nn.json | 16 ++++++++++++++++ app/javascript/mastodon/locales/pt-PT.json | 3 +++ app/javascript/mastodon/locales/th.json | 1 + app/javascript/mastodon/locales/vi.json | 4 ++-- config/locales/fi.yml | 3 +++ config/locales/kab.yml | 2 ++ config/locales/simple_form.kab.yml | 4 ++++ 11 files changed, 42 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/locales/ca.json b/app/javascript/mastodon/locales/ca.json index 8ba140d20..27c153276 100644 --- a/app/javascript/mastodon/locales/ca.json +++ b/app/javascript/mastodon/locales/ca.json @@ -272,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Usa una categoria existent o crea'n una de nova", "filter_modal.select_filter.title": "Filtra aquest tut", "filter_modal.title.status": "Filtra un tut", + "filtered_notifications_banner.pending_requests": "Notificacions {count, plural, =0 {de ningú} one {d'una persona} other {de # persones}} que potser coneixes", "filtered_notifications_banner.title": "Notificacions filtrades", "firehose.all": "Tots", "firehose.local": "Aquest servidor", @@ -476,13 +477,13 @@ "notifications.permission_denied": "Les notificacions d’escriptori no estan disponibles perquè prèviament s’ha denegat el permís al navegador", "notifications.permission_denied_alert": "No es poden activar les notificacions de l'escriptori perquè abans s'ha denegat el permís del navegador", "notifications.permission_required": "Les notificacions d'escriptori no estan disponibles perquè el permís requerit no ha estat concedit.", - "notifications.policy.filter_new_accounts.hint": "Creat durant els passats {days, plural, one {un dia} other {# dies}}", + "notifications.policy.filter_new_accounts.hint": "Creat {days, plural, one {ahir} other {durant els # dies passats}}", "notifications.policy.filter_new_accounts_title": "Comptes nous", - "notifications.policy.filter_not_followers_hint": "Incloent les persones que us segueixen fa menys de {days, plural, one {un dia} other {# dies}}", + "notifications.policy.filter_not_followers_hint": "Incloent les persones que us segueixen fa menys {days, plural, one {d'un dia} other {de # dies}}", "notifications.policy.filter_not_followers_title": "Persones que no us segueixen", "notifications.policy.filter_not_following_hint": "Fins que no ho aproveu de forma manual", "notifications.policy.filter_not_following_title": "Persones que no seguiu", - "notifications.policy.filter_private_mentions_hint": "Filtra-ho excepte si és en resposta a una menció vostra o si seguiu el remitent", + "notifications.policy.filter_private_mentions_hint": "Filtrat si no és que és en resposta a una menció vostra o si seguiu el remitent", "notifications.policy.filter_private_mentions_title": "Mencions privades no sol·licitades", "notifications.policy.title": "Filtra les notificacions de…", "notifications_permission_banner.enable": "Activa les notificacions d’escriptori", diff --git a/app/javascript/mastodon/locales/fi.json b/app/javascript/mastodon/locales/fi.json index 93e758dd4..9acae62de 100644 --- a/app/javascript/mastodon/locales/fi.json +++ b/app/javascript/mastodon/locales/fi.json @@ -241,6 +241,7 @@ "empty_column.list": "Tällä listalla ei ole vielä mitään. Kun tämän listan jäsenet lähettävät uusia julkaisuja, ne näkyvät tässä.", "empty_column.lists": "Sinulla ei ole vielä yhtään listaa. Kun luot sellaisen, näkyy se tässä.", "empty_column.mutes": "Et ole mykistänyt vielä yhtään käyttäjää.", + "empty_column.notification_requests": "Kaikki kunnossa! Täällä ei ole mitään. Kun saat uusia ilmoituksia, ne näkyvät täällä asetustesi mukaisesti.", "empty_column.notifications": "Sinulla ei ole vielä ilmoituksia. Kun keskustelet muille, näet sen täällä.", "empty_column.public": "Täällä ei ole mitään! Kirjoita jotain julkisesti. Voit myös seurata muiden palvelimien käyttäjiä", "error.unexpected_crash.explanation": "Sivua ei voida näyttää oikein ohjelmointivirheen tai selaimen yhteensopivuusvajeen vuoksi.", @@ -271,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Käytä olemassa olevaa luokkaa tai luo uusi", "filter_modal.select_filter.title": "Suodata tämä julkaisu", "filter_modal.title.status": "Suodata julkaisu", + "filtered_notifications_banner.pending_requests": "Ilmoitukset, {count, plural, =0 {ei tänään} one {1 henkilö} other {# henkilöä}}", "filtered_notifications_banner.title": "Suodatetut ilmoitukset", "firehose.all": "Kaikki", "firehose.local": "Tämä palvelin", @@ -477,8 +479,11 @@ "notifications.permission_required": "Työpöytäilmoitukset eivät ole käytettävissä, koska siihen tarvittavaa lupaa ei ole myönnetty.", "notifications.policy.filter_new_accounts.hint": "Luotu {days, plural, one {viime päivänä} other {viimeisenä # päivänä}}", "notifications.policy.filter_new_accounts_title": "Uudet tilit", + "notifications.policy.filter_not_followers_hint": "Mukaan lukien ne, jotka ovat seuranneet sinua vähemmän kuin {days, plural, one {päivän} other {# päivää}}", "notifications.policy.filter_not_followers_title": "Henkilöt, jotka eivät seuraa sinua", + "notifications.policy.filter_not_following_hint": "Kunnes hyväksyt ne manuaalisesti", "notifications.policy.filter_not_following_title": "Henkilöt, joita et seuraa", + "notifications.policy.filter_private_mentions_hint": "Suodatetaan, ellei se vastaa omaan mainintaan tai jos seuraat lähettäjää", "notifications.policy.filter_private_mentions_title": "Ei-toivotut yksityismaininnat", "notifications.policy.title": "Suodata ilmoitukset pois kohteesta…", "notifications_permission_banner.enable": "Ota työpöytäilmoitukset käyttöön", diff --git a/app/javascript/mastodon/locales/he.json b/app/javascript/mastodon/locales/he.json index af6b1c611..53e265313 100644 --- a/app/javascript/mastodon/locales/he.json +++ b/app/javascript/mastodon/locales/he.json @@ -272,6 +272,7 @@ "filter_modal.select_filter.subtitle": "שימוש בקטגורייה קיימת או יצירת אחת חדשה", "filter_modal.select_filter.title": "סינון ההודעה הזו", "filter_modal.title.status": "סנן הודעה", + "filtered_notifications_banner.pending_requests": "{count, plural,=0 {אין התראות ממשתמשים ה}one {התראה אחת ממישהו/מישהי ה}two {יש התראותיים ממשתמשים }other {יש # התראות ממשתמשים }}מוכרים לך", "filtered_notifications_banner.title": "התראות מסוננות", "firehose.all": "הכל", "firehose.local": "שרת זה", diff --git a/app/javascript/mastodon/locales/kab.json b/app/javascript/mastodon/locales/kab.json index 4ffae68bd..db770b427 100644 --- a/app/javascript/mastodon/locales/kab.json +++ b/app/javascript/mastodon/locales/kab.json @@ -320,7 +320,7 @@ "mute_modal.hide_notifications": "Tebɣiḍ ad teffreḍ talɣutin n umseqdac-a?", "mute_modal.indefinite": "Ur yettwasbadu ara", "navigation_bar.about": "Ɣef", - "navigation_bar.blocks": "Imseqdacen yettusḥebsen", + "navigation_bar.blocks": "Iseqdacen yettusḥebsen", "navigation_bar.bookmarks": "Ticraḍ", "navigation_bar.community_timeline": "Tasuddemt tadigant", "navigation_bar.compose": "Aru tajewwiqt tamaynut", diff --git a/app/javascript/mastodon/locales/nn.json b/app/javascript/mastodon/locales/nn.json index b8a0512b8..94fee3498 100644 --- a/app/javascript/mastodon/locales/nn.json +++ b/app/javascript/mastodon/locales/nn.json @@ -241,6 +241,7 @@ "empty_column.list": "Det er ingenting i denne lista enno. Når medlemer av denne lista legg ut nye statusar, så dukkar dei opp her.", "empty_column.lists": "Du har ingen lister enno. Når du lagar ei, så dukkar ho opp her.", "empty_column.mutes": "Du har ikkje målbunde nokon enno.", + "empty_column.notification_requests": "Ferdig! Her er det ingenting. Når du får nye varsel, kjem dei opp her slik du har valt.", "empty_column.notifications": "Du har ingen varsel enno. Kommuniser med andre for å starte samtalen.", "empty_column.public": "Det er ingenting her! Skriv noko offentleg, eller følg brukarar frå andre tenarar manuelt for å fylle det opp", "error.unexpected_crash.explanation": "På grunn av eit nettlesarkompatibilitetsproblem eller ein feil i koden vår, kunne ikkje denne sida bli vist slik den skal.", @@ -271,6 +272,8 @@ "filter_modal.select_filter.subtitle": "Bruk ein eksisterande kategori eller opprett ein ny", "filter_modal.select_filter.title": "Filtrer dette innlegget", "filter_modal.title.status": "Filtrer eit innlegg", + "filtered_notifications_banner.pending_requests": "Varsel frå {count, plural, =0 {ingen} one {ein person} other {# folk}} du kanskje kjenner", + "filtered_notifications_banner.title": "Filtrerte varslingar", "firehose.all": "Alle", "firehose.local": "Denne tenaren", "firehose.remote": "Andre tenarar", @@ -439,6 +442,10 @@ "notification.reblog": "{name} framheva innlegget ditt", "notification.status": "{name} la nettopp ut", "notification.update": "{name} redigerte eit innlegg", + "notification_requests.accept": "Godkjenn", + "notification_requests.dismiss": "Avvis", + "notification_requests.notifications_from": "Varslingar frå {name}", + "notification_requests.title": "Filtrerte varslingar", "notifications.clear": "Tøm varsel", "notifications.clear_confirmation": "Er du sikker på at du vil fjerna alle varsla dine for alltid?", "notifications.column_settings.admin.report": "Nye rapportar:", @@ -470,6 +477,15 @@ "notifications.permission_denied": "Skrivebordsvarsel er ikkje tilgjengelege på grunn av at nettlesaren tidlegare ikkje har fått naudsynte rettar til å vise dei", "notifications.permission_denied_alert": "Sidan nettlesaren tidlegare har blitt nekta naudsynte rettar, kan ikkje skrivebordsvarsel aktiverast", "notifications.permission_required": "Skrivebordsvarsel er utilgjengelege fordi naudsynte rettar ikkje er gitt.", + "notifications.policy.filter_new_accounts.hint": "Skrive siste {days, plural, one {dag} other {# dagar}}", + "notifications.policy.filter_new_accounts_title": "Nye brukarkontoar", + "notifications.policy.filter_not_followers_hint": "Inkludert folk som har fylgt deg mindre enn {days, plural, one {ein dag} other {# dagar}}", + "notifications.policy.filter_not_followers_title": "Folk som ikkje fylgjer deg", + "notifications.policy.filter_not_following_hint": "Til du godkjenner dei manuelt", + "notifications.policy.filter_not_following_title": "Folk du ikkje fylgjer", + "notifications.policy.filter_private_mentions_hint": "Filtrert viss det ikkje er eit svar på dine eigne nemningar eller viss du fylgjer avsendaren", + "notifications.policy.filter_private_mentions_title": "Masseutsende private nemningar", + "notifications.policy.title": "Filtrer ut varslingar frå…", "notifications_permission_banner.enable": "Skru på skrivebordsvarsel", "notifications_permission_banner.how_to_control": "Aktiver skrivebordsvarsel for å få varsel når Mastodon ikkje er open. Du kan nøye bestemme kva samhandlingar som skal føre til skrivebordsvarsel gjennom {icon}-knappen ovanfor etter at varsel er aktivert.", "notifications_permission_banner.title": "Gå aldri glipp av noko", diff --git a/app/javascript/mastodon/locales/pt-PT.json b/app/javascript/mastodon/locales/pt-PT.json index da947f9bf..18a550d64 100644 --- a/app/javascript/mastodon/locales/pt-PT.json +++ b/app/javascript/mastodon/locales/pt-PT.json @@ -272,6 +272,7 @@ "filter_modal.select_filter.subtitle": "Utilize uma categoria existente ou crie uma nova", "filter_modal.select_filter.title": "Filtrar esta publicação", "filter_modal.title.status": "Filtrar uma publicação", + "filtered_notifications_banner.pending_requests": "Notificações de {count, plural, =0 {ninguém} one {uma pessoa} other {# pessoas}} que talvez conheça", "filtered_notifications_banner.title": "Notificações filtradas", "firehose.all": "Todas", "firehose.local": "Este servidor", @@ -476,7 +477,9 @@ "notifications.permission_denied": "Notificações no ambiente de trabalho não estão disponíveis porque a permissão, solicitada pelo navegador, foi recusada anteriormente", "notifications.permission_denied_alert": "Notificações no ambiente de trabalho não podem ser ativadas, pois a permissão do navegador foi recusada anteriormente", "notifications.permission_required": "Notificações no ambiente de trabalho não estão disponíveis porque a permissão necessária não foi concedida.", + "notifications.policy.filter_new_accounts.hint": "Criada nos últimos {days, plural, one {um dia} other {# dias}}", "notifications.policy.filter_new_accounts_title": "Novas contas", + "notifications.policy.filter_not_followers_hint": "Incluindo pessoas que o seguem há menos de {days, plural, one {um dia} other {# dias}}", "notifications.policy.filter_not_followers_title": "Pessoas não te seguem", "notifications.policy.filter_not_following_hint": "Até que você os aprove manualmente", "notifications.policy.filter_not_following_title": "Pessoas que você não segue", diff --git a/app/javascript/mastodon/locales/th.json b/app/javascript/mastodon/locales/th.json index 30a9601d6..28b176451 100644 --- a/app/javascript/mastodon/locales/th.json +++ b/app/javascript/mastodon/locales/th.json @@ -241,6 +241,7 @@ "empty_column.list": "ยังไม่มีสิ่งใดในรายการนี้ เมื่อสมาชิกของรายการนี้โพสต์โพสต์ใหม่ โพสต์จะปรากฏที่นี่", "empty_column.lists": "คุณยังไม่มีรายการใด ๆ เมื่อคุณสร้างรายการ รายการจะปรากฏที่นี่", "empty_column.mutes": "คุณยังไม่ได้ซ่อนผู้ใช้ใด ๆ", + "empty_column.notification_requests": "โล่งทั้งหมด! ไม่มีสิ่งใดที่นี่ เมื่อคุณได้รับการแจ้งเตือนใหม่ การแจ้งเตือนจะปรากฏที่นี่ตามการตั้งค่าของคุณ", "empty_column.notifications": "คุณยังไม่มีการแจ้งเตือนใด ๆ เมื่อผู้คนอื่น ๆ โต้ตอบกับคุณ คุณจะเห็นการแจ้งเตือนที่นี่", "empty_column.public": "ไม่มีสิ่งใดที่นี่! เขียนบางอย่างเป็นสาธารณะ หรือติดตามผู้ใช้จากเซิร์ฟเวอร์อื่น ๆ ด้วยตนเองเพื่อเติมเส้นเวลาให้เต็ม", "error.unexpected_crash.explanation": "เนื่องจากข้อบกพร่องในโค้ดของเราหรือปัญหาความเข้ากันได้ของเบราว์เซอร์ จึงไม่สามารถแสดงหน้านี้ได้อย่างถูกต้อง", diff --git a/app/javascript/mastodon/locales/vi.json b/app/javascript/mastodon/locales/vi.json index c74c78012..998aecd27 100644 --- a/app/javascript/mastodon/locales/vi.json +++ b/app/javascript/mastodon/locales/vi.json @@ -272,7 +272,7 @@ "filter_modal.select_filter.subtitle": "Sử dụng một danh mục hiện có hoặc tạo một danh mục mới", "filter_modal.select_filter.title": "Lọc tút này", "filter_modal.title.status": "Lọc một tút", - "filtered_notifications_banner.pending_requests": "{count, plural, =0 {} other {#}}", + "filtered_notifications_banner.pending_requests": "Thông báo từ {count, plural, =0 {không ai} other {# người}} bạn có thể biết", "filtered_notifications_banner.title": "Thông báo đã lọc", "firehose.all": "Toàn bộ", "firehose.local": "Máy chủ này", @@ -364,7 +364,7 @@ "keyboard_shortcuts.my_profile": "mở hồ sơ của bạn", "keyboard_shortcuts.notifications": "mở thông báo", "keyboard_shortcuts.open_media": "mở ảnh hoặc video", - "keyboard_shortcuts.pinned": "Open pinned posts list", + "keyboard_shortcuts.pinned": "mở những tút đã ghim", "keyboard_shortcuts.profile": "mở trang của người đăng tút", "keyboard_shortcuts.reply": "trả lời", "keyboard_shortcuts.requests": "mở danh sách yêu cầu theo dõi", diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 156a4700e..93dbd0162 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1846,7 +1846,10 @@ fi: apps_ios_action: Lataa App Storesta apps_step: Lataa viralliset sovelluksemme. apps_title: Mastodon-sovellukset + checklist_subtitle: 'Aloitetaan, sinä aloitat uudella sosiaalisella seudulla:' + checklist_title: Tervetuloa tarkistuslista edit_profile_action: Mukauta + edit_profile_step: Täydentämällä profiilisi tietoja tehostat vaikutemaa. edit_profile_title: Mukauta profiiliasi explanation: Näillä vinkeillä pääset alkuun feature_action: Lue lisää diff --git a/config/locales/kab.yml b/config/locales/kab.yml index b25a4e3a1..66c544f9e 100644 --- a/config/locales/kab.yml +++ b/config/locales/kab.yml @@ -705,6 +705,7 @@ kab: moved: Igujj primary: Agejdan relationship: Assaɣ + remove_selected_follows: Ur ṭṭafar ara iseqdacen yettwafernen status: Addad n umiḍan sessions: activity: Armud aneggaru @@ -729,6 +730,7 @@ kab: current_session: Tiɣimit tamirant date: Azemz description: "%{browser} s %{platform}" + explanation: Ha-t-en yiminigen web ikecmen akka tura ɣer umiḍan-ik·im Mastodon. ip: IP platforms: adobe_air: Adobe Air diff --git a/config/locales/simple_form.kab.yml b/config/locales/simple_form.kab.yml index a9b040b05..8e63211b6 100644 --- a/config/locales/simple_form.kab.yml +++ b/config/locales/simple_form.kab.yml @@ -23,6 +23,8 @@ kab: setting_display_media_hide_all: Ffer yal tikkelt akk taywalt setting_display_media_show_all: Ffer yal tikkelt teywalt yettwacreḍ d tanafrit username: Tzemreḍ ad tesqedceḍ isekkilen, uṭṭunen akked yijerriden n wadda + featured_tag: + name: 'Ha-t-an kra seg ihacṭagen i tesseqdaceḍ ussan-a ineggura maḍi :' imports: data: Afaylu CSV id yusan seg uqeddac-nniḍen n Maṣṭudun ip_block: @@ -102,7 +104,9 @@ kab: no_access: Sewḥel anekcum severity: Alugen notification_emails: + favourite: Ma yella walbɛaḍ i iḥemmlen tasuffeɣt-ik·im follow: Yeḍfer-ik·im-id walbɛaḍ + follow_request: Ma yella win i d-yessutren ad k·em-yeḍfer mention: Yuder-ik·em-id walbɛaḍ reblog: Yella win yesselhan adda-dik·im rule: From 1e1d97a78727570bb3343aa4008b93edae3dde1d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 14 Mar 2024 10:07:29 +0100 Subject: [PATCH 26/45] Fix wrong background color on search results in web UI (#29584) --- .../compose/components/search_results.jsx | 6 ----- .../styles/mastodon/components.scss | 23 +++++-------------- app/javascript/styles/mastodon/variables.scss | 1 + 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/search_results.jsx b/app/javascript/mastodon/features/compose/components/search_results.jsx index 694deea04..667662781 100644 --- a/app/javascript/mastodon/features/compose/components/search_results.jsx +++ b/app/javascript/mastodon/features/compose/components/search_results.jsx @@ -7,7 +7,6 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import FindInPageIcon from '@/material-icons/400-24px/find_in_page.svg?react'; import PeopleIcon from '@/material-icons/400-24px/group.svg?react'; -import SearchIcon from '@/material-icons/400-24px/search.svg?react'; import TagIcon from '@/material-icons/400-24px/tag.svg?react'; import { Icon } from 'mastodon/components/icon'; import { LoadMore } from 'mastodon/components/load_more'; @@ -76,11 +75,6 @@ class SearchResults extends ImmutablePureComponent { return (
-
- - -
- {accounts} {hashtags} {statuses} diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index b6dc1abc9..6aa358850 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -3485,7 +3485,7 @@ $ui-header-height: 55px; } .column-subheading { - background: darken($ui-base-color, 4%); + background: var(--surface-background-color); color: $darker-text-color; padding: 8px 20px; font-size: 12px; @@ -4637,7 +4637,7 @@ a.status-card { } .follow_requests-unlocked_explanation { - background: darken($ui-base-color, 4%); + background: var(--surface-background-color); border-bottom: 1px solid var(--background-border-color); contain: initial; flex-grow: 0; @@ -5269,18 +5269,6 @@ a.status-card { } } -.search-results__header { - color: $dark-text-color; - background: lighten($ui-base-color, 2%); - padding: 15px; - font-weight: 500; - font-size: 16px; - cursor: default; - display: flex; - align-items: center; - gap: 5px; -} - .search-results__section { border-bottom: 1px solid var(--background-border-color); @@ -5289,8 +5277,8 @@ a.status-card { } &__header { - background: darken($ui-base-color, 4%); border-bottom: 1px solid var(--background-border-color); + background: var(--surface-background-color); padding: 15px; font-weight: 500; font-size: 14px; @@ -7159,7 +7147,7 @@ noscript { .follow-request-banner, .account-memorial-banner { padding: 20px; - background: lighten($ui-base-color, 4%); + background: var(--surface-background-color); display: flex; align-items: center; flex-direction: column; @@ -8326,7 +8314,8 @@ noscript { flex: 1 1 auto; display: flex; flex-direction: column; - background: $ui-base-color; + border: 1px solid var(--background-border-color); + border-top: 0; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; } diff --git a/app/javascript/styles/mastodon/variables.scss b/app/javascript/styles/mastodon/variables.scss index 94078d960..2b2a29579 100644 --- a/app/javascript/styles/mastodon/variables.scss +++ b/app/javascript/styles/mastodon/variables.scss @@ -104,4 +104,5 @@ $font-monospace: 'mastodon-font-monospace' !default; --background-filter: blur(10px) saturate(180%) contrast(75%) brightness(70%); --background-color: #{darken($ui-base-color, 8%)}; --background-color-tint: #{rgba(darken($ui-base-color, 8%), 0.9)}; + --surface-background-color: #{darken($ui-base-color, 4%)}; } From f9100743ecec65cdeeabdaa29ed94afc4b2e3aa5 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:09:47 -0400 Subject: [PATCH 27/45] Add `Api::ErrorHandling` concern for api/base controller (#29574) --- app/controllers/api/base_controller.rb | 46 +--------------- .../concerns/api/error_handling.rb | 52 +++++++++++++++++++ spec/controllers/api/base_controller_spec.rb | 36 ------------- .../concerns/api/error_handling_spec.rb | 51 ++++++++++++++++++ 4 files changed, 104 insertions(+), 81 deletions(-) create mode 100644 app/controllers/concerns/api/error_handling.rb create mode 100644 spec/controllers/concerns/api/error_handling_spec.rb diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index 8bf9da2cf..bf7deac5c 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -8,6 +8,7 @@ class Api::BaseController < ApplicationController include Api::AccessTokenTrackingConcern include Api::CachingConcern include Api::ContentSecurityPolicy + include Api::ErrorHandling skip_before_action :require_functional!, unless: :limited_federation_mode? @@ -18,51 +19,6 @@ class Api::BaseController < ApplicationController protect_from_forgery with: :null_session - rescue_from ActiveRecord::RecordInvalid, Mastodon::ValidationError do |e| - render json: { error: e.to_s }, status: 422 - end - - rescue_from ActiveRecord::RecordNotUnique do - render json: { error: 'Duplicate record' }, status: 422 - end - - rescue_from Date::Error do - render json: { error: 'Invalid date supplied' }, status: 422 - end - - rescue_from ActiveRecord::RecordNotFound do - render json: { error: 'Record not found' }, status: 404 - end - - rescue_from HTTP::Error, Mastodon::UnexpectedResponseError do - render json: { error: 'Remote data could not be fetched' }, status: 503 - end - - rescue_from OpenSSL::SSL::SSLError do - render json: { error: 'Remote SSL certificate could not be verified' }, status: 503 - end - - rescue_from Mastodon::NotPermittedError do - render json: { error: 'This action is not allowed' }, status: 403 - end - - rescue_from Seahorse::Client::NetworkingError do |e| - Rails.logger.warn "Storage server error: #{e}" - render json: { error: 'There was a temporary problem serving your request, please try again' }, status: 503 - end - - rescue_from Mastodon::RaceConditionError, Stoplight::Error::RedLight do - render json: { error: 'There was a temporary problem serving your request, please try again' }, status: 503 - end - - rescue_from Mastodon::RateLimitExceededError do - render json: { error: I18n.t('errors.429') }, status: 429 - end - - rescue_from ActionController::ParameterMissing, Mastodon::InvalidParameterError do |e| - render json: { error: e.to_s }, status: 400 - end - def doorkeeper_unauthorized_render_options(error: nil) { json: { error: error.try(:description) || 'Not authorized' } } end diff --git a/app/controllers/concerns/api/error_handling.rb b/app/controllers/concerns/api/error_handling.rb new file mode 100644 index 000000000..ad559fe2d --- /dev/null +++ b/app/controllers/concerns/api/error_handling.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Api::ErrorHandling + extend ActiveSupport::Concern + + included do + rescue_from ActiveRecord::RecordInvalid, Mastodon::ValidationError do |e| + render json: { error: e.to_s }, status: 422 + end + + rescue_from ActiveRecord::RecordNotUnique do + render json: { error: 'Duplicate record' }, status: 422 + end + + rescue_from Date::Error do + render json: { error: 'Invalid date supplied' }, status: 422 + end + + rescue_from ActiveRecord::RecordNotFound do + render json: { error: 'Record not found' }, status: 404 + end + + rescue_from HTTP::Error, Mastodon::UnexpectedResponseError do + render json: { error: 'Remote data could not be fetched' }, status: 503 + end + + rescue_from OpenSSL::SSL::SSLError do + render json: { error: 'Remote SSL certificate could not be verified' }, status: 503 + end + + rescue_from Mastodon::NotPermittedError do + render json: { error: 'This action is not allowed' }, status: 403 + end + + rescue_from Seahorse::Client::NetworkingError do |e| + Rails.logger.warn "Storage server error: #{e}" + render json: { error: 'There was a temporary problem serving your request, please try again' }, status: 503 + end + + rescue_from Mastodon::RaceConditionError, Stoplight::Error::RedLight do + render json: { error: 'There was a temporary problem serving your request, please try again' }, status: 503 + end + + rescue_from Mastodon::RateLimitExceededError do + render json: { error: I18n.t('errors.429') }, status: 429 + end + + rescue_from ActionController::ParameterMissing, Mastodon::InvalidParameterError do |e| + render json: { error: e.to_s }, status: 400 + end + end +end diff --git a/spec/controllers/api/base_controller_spec.rb b/spec/controllers/api/base_controller_spec.rb index f8e014be2..659d55f80 100644 --- a/spec/controllers/api/base_controller_spec.rb +++ b/spec/controllers/api/base_controller_spec.rb @@ -3,10 +3,6 @@ require 'rails_helper' describe Api::BaseController do - before do - stub_const('FakeService', Class.new) - end - controller do def success head 200 @@ -72,36 +68,4 @@ describe Api::BaseController do expect(response).to have_http_status(403) end end - - describe 'error handling' do - before do - routes.draw { get 'failure' => 'api/base#failure' } - end - - { - ActiveRecord::RecordInvalid => 422, - ActiveRecord::RecordNotFound => 404, - ActiveRecord::RecordNotUnique => 422, - Date::Error => 422, - HTTP::Error => 503, - Mastodon::InvalidParameterError => 400, - Mastodon::NotPermittedError => 403, - Mastodon::RaceConditionError => 503, - Mastodon::RateLimitExceededError => 429, - Mastodon::UnexpectedResponseError => 503, - Mastodon::ValidationError => 422, - OpenSSL::SSL::SSLError => 503, - Seahorse::Client::NetworkingError => 503, - Stoplight::Error::RedLight => 503, - }.each do |error, code| - it "Handles error class of #{error}" do - allow(FakeService).to receive(:new).and_raise(error) - - get :failure - - expect(response).to have_http_status(code) - expect(FakeService).to have_received(:new) - end - end - end end diff --git a/spec/controllers/concerns/api/error_handling_spec.rb b/spec/controllers/concerns/api/error_handling_spec.rb new file mode 100644 index 000000000..9b36fc20a --- /dev/null +++ b/spec/controllers/concerns/api/error_handling_spec.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe Api::ErrorHandling do + before do + stub_const('FakeService', Class.new) + end + + controller(Api::BaseController) do + def failure + FakeService.new + end + end + + describe 'error handling' do + before do + routes.draw { get 'failure' => 'api/base#failure' } + end + + { + ActiveRecord::RecordInvalid => 422, + ActiveRecord::RecordNotFound => 404, + ActiveRecord::RecordNotUnique => 422, + Date::Error => 422, + HTTP::Error => 503, + Mastodon::InvalidParameterError => 400, + Mastodon::NotPermittedError => 403, + Mastodon::RaceConditionError => 503, + Mastodon::RateLimitExceededError => 429, + Mastodon::UnexpectedResponseError => 503, + Mastodon::ValidationError => 422, + OpenSSL::SSL::SSLError => 503, + Seahorse::Client::NetworkingError => 503, + Stoplight::Error::RedLight => 503, + }.each do |error, code| + it "Handles error class of #{error}" do + allow(FakeService) + .to receive(:new) + .and_raise(error) + + get :failure + + expect(response) + .to have_http_status(code) + expect(FakeService) + .to have_received(:new) + end + end + end +end From 4991198b703f5020ab136062fe7d5ef44e8f0aec Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 14 Mar 2024 10:18:24 +0100 Subject: [PATCH 28/45] Change design of metadata underneath posts in web UI (#29585) --- .../components/edited_timestamp/index.jsx | 4 +- .../status/components/detailed_status.jsx | 72 +++++++++---------- app/javascript/mastodon/locales/en.json | 4 +- .../styles/mastodon/components.scss | 45 +++++++----- 4 files changed, 65 insertions(+), 60 deletions(-) diff --git a/app/javascript/mastodon/components/edited_timestamp/index.jsx b/app/javascript/mastodon/components/edited_timestamp/index.jsx index 7b70f9d6e..fbf14ec4b 100644 --- a/app/javascript/mastodon/components/edited_timestamp/index.jsx +++ b/app/javascript/mastodon/components/edited_timestamp/index.jsx @@ -5,9 +5,7 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import ArrowDropDownIcon from '@/material-icons/400-24px/arrow_drop_down.svg?react'; import { openModal } from 'mastodon/actions/modal'; -import { Icon } from 'mastodon/components/icon'; import InlineAccount from 'mastodon/components/inline_account'; import { RelativeTimestamp } from 'mastodon/components/relative_timestamp'; @@ -67,7 +65,7 @@ class EditedTimestamp extends PureComponent { return ( ); diff --git a/app/javascript/mastodon/features/status/components/detailed_status.jsx b/app/javascript/mastodon/features/status/components/detailed_status.jsx index d10c8966e..45935716c 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.jsx +++ b/app/javascript/mastodon/features/status/components/detailed_status.jsx @@ -9,8 +9,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react'; -import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react'; -import StarIcon from '@/material-icons/400-24px/star-fill.svg?react'; import { AnimatedNumber } from 'mastodon/components/animated_number'; import EditedTimestamp from 'mastodon/components/edited_timestamp'; import { getHashtagBarForStatus } from 'mastodon/components/hashtag_bar'; @@ -143,10 +141,7 @@ class DetailedStatus extends ImmutablePureComponent { let media = ''; let applicationLink = ''; let reblogLink = ''; - const reblogIcon = 'retweet'; - const reblogIconComponent = RepeatIcon; let favouriteLink = ''; - let edited = ''; if (this.props.measureHeight) { outerStyle.height = `${this.state.height}px`; @@ -218,68 +213,53 @@ class DetailedStatus extends ImmutablePureComponent { } if (status.get('application')) { - applicationLink = <> · {status.getIn(['application', 'name'])}; + applicationLink = <>·{status.getIn(['application', 'name'])}; } - const visibilityLink = <> · ; + const visibilityLink = <>·; if (['private', 'direct'].includes(status.get('visibility'))) { reblogLink = ''; } else if (this.props.history) { reblogLink = ( - <> - {' · '} - - - - - - - + + + + + + ); } else { reblogLink = ( - <> - {' · '} - - - - - - - + + + + + + ); } if (this.props.history) { favouriteLink = ( - + ); } else { favouriteLink = ( - + ); } - if (status.get('edited_at')) { - edited = ( - <> - {' · '} - - - ); - } - const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status); const expanded = !status.get('hidden') || status.get('spoiler_text').length === 0; @@ -310,9 +290,23 @@ class DetailedStatus extends ImmutablePureComponent { {expanded && hashtagBar}
- - - {edited}{visibilityLink}{applicationLink}{reblogLink} · {favouriteLink} +
+ + + + + {visibilityLink} + + {applicationLink} +
+ + {status.get('edited_at') &&
} + +
+ {reblogLink} + · + {favouriteLink} +
diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 2f202bfe1..8a66695f3 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -662,10 +662,11 @@ "status.direct": "Privately mention @{name}", "status.direct_indicator": "Private mention", "status.edit": "Edit", - "status.edited": "Edited {date}", + "status.edited": "Last edited {date}", "status.edited_x_times": "Edited {count, plural, one {{count} time} other {{count} times}}", "status.embed": "Embed", "status.favourite": "Favorite", + "status.favourites": "{count, plural, one {favorite} other {favorites}}", "status.filter": "Filter this post", "status.filtered": "Filtered", "status.hide": "Hide post", @@ -686,6 +687,7 @@ "status.reblog": "Boost", "status.reblog_private": "Boost with original visibility", "status.reblogged_by": "{name} boosted", + "status.reblogs": "{count, plural, one {boost} other {boosts}}", "status.reblogs.empty": "No one has boosted this post yet. When someone does, they will show up here.", "status.redraft": "Delete & re-draft", "status.remove_bookmark": "Remove bookmark", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 6aa358850..398babb25 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1659,15 +1659,35 @@ body > [data-popper-placement] { } .detailed-status__meta { - margin-top: 16px; + margin-top: 24px; color: $dark-text-color; font-size: 14px; line-height: 18px; + &__line { + border-bottom: 1px solid var(--background-border-color); + padding: 8px 0; + display: flex; + align-items: center; + gap: 8px; + + &:first-child { + padding-top: 0; + } + + &:last-child { + padding-bottom: 0; + border-bottom: 0; + } + } + .icon { - width: 15px; - height: 15px; - vertical-align: middle; + width: 18px; + height: 18px; + } + + .animated-number { + color: $secondary-text-color; } } @@ -1711,19 +1731,6 @@ body > [data-popper-placement] { color: inherit; text-decoration: none; gap: 6px; - position: relative; - top: 0.145em; - - .icon { - top: 0; - } -} - -.detailed-status__favorites, -.detailed-status__reblogs { - font-weight: 500; - font-size: 12px; - line-height: 18px; } .domain { @@ -2292,6 +2299,10 @@ a.account__display-name { outline: 1px dotted; } + &:hover { + text-decoration: underline; + } + .icon { width: 15px; height: 15px; From 01ecc8011899949c19a1f58d715eb020bea4f387 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:18:31 -0400 Subject: [PATCH 29/45] Add module `accounts` route scope in api routes (#29582) --- config/routes/api.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/routes/api.rb b/config/routes/api.rb index 07340a634..d2d0e3900 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -181,12 +181,14 @@ namespace :api, format: false do end resources :accounts, only: [:create, :show] do - resources :statuses, only: :index, controller: 'accounts/statuses' - resources :followers, only: :index, controller: 'accounts/follower_accounts' - resources :following, only: :index, controller: 'accounts/following_accounts' - resources :lists, only: :index, controller: 'accounts/lists' - resources :identity_proofs, only: :index, controller: 'accounts/identity_proofs' - resources :featured_tags, only: :index, controller: 'accounts/featured_tags' + scope module: :accounts do + resources :statuses, only: :index + resources :followers, only: :index, controller: :follower_accounts + resources :following, only: :index, controller: :following_accounts + resources :lists, only: :index + resources :identity_proofs, only: :index + resources :featured_tags, only: :index + end member do post :follow From 18ffd4d925030a3d3a3826bc7156d3a22a44d78e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:18:36 -0400 Subject: [PATCH 30/45] Add module `instances` route scope in api routes (#29581) --- config/routes/api.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/config/routes/api.rb b/config/routes/api.rb index d2d0e3900..60fb0394e 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -125,14 +125,16 @@ namespace :api, format: false do end resource :instance, only: [:show] do - resources :peers, only: [:index], controller: 'instances/peers' - resources :rules, only: [:index], controller: 'instances/rules' - resources :domain_blocks, only: [:index], controller: 'instances/domain_blocks' - resource :privacy_policy, only: [:show], controller: 'instances/privacy_policies' - resource :extended_description, only: [:show], controller: 'instances/extended_descriptions' - resource :translation_languages, only: [:show], controller: 'instances/translation_languages' - resource :languages, only: [:show], controller: 'instances/languages' - resource :activity, only: [:show], controller: 'instances/activity' + scope module: :instances do + resources :peers, only: [:index] + resources :rules, only: [:index] + resources :domain_blocks, only: [:index] + resource :privacy_policy, only: [:show] + resource :extended_description, only: [:show] + resource :translation_languages, only: [:show] + resource :languages, only: [:show] + resource :activity, only: [:show], controller: :activity + end end namespace :peers do From 65e8349980d2f09eee63c7dde7edb1e5ebc0e5d5 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:18:41 -0400 Subject: [PATCH 31/45] Clean up `activitypub` module route scope near collections/boxes (#29580) --- config/routes.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 2ec749496..a3e3f368b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -126,11 +126,13 @@ Rails.application.routes.draw do resources :followers, only: [:index], controller: :follower_accounts resources :following, only: [:index], controller: :following_accounts - resource :outbox, only: [:show], module: :activitypub - resource :inbox, only: [:create], module: :activitypub - resource :claim, only: [:create], module: :activitypub - resources :collections, only: [:show], module: :activitypub - resource :followers_synchronization, only: [:show], module: :activitypub + scope module: :activitypub do + resource :outbox, only: [:show] + resource :inbox, only: [:create] + resource :claim, only: [:create] + resources :collections, only: [:show] + resource :followers_synchronization, only: [:show] + end end resource :inbox, only: [:create], module: :activitypub From 79e7590578770c906d7a30e6ce7e0b654f725972 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:18:46 -0400 Subject: [PATCH 32/45] Clean up `activitypub` module route scope near instance actor (#29579) --- config/routes.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index a3e3f368b..8d658b4de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,8 +77,10 @@ Rails.application.routes.draw do get 'remote_interaction_helper', to: 'remote_interaction_helper#index' resource :instance_actor, path: 'actor', only: [:show] do - resource :inbox, only: [:create], module: :activitypub - resource :outbox, only: [:show], module: :activitypub + scope module: :activitypub do + resource :inbox, only: [:create] + resource :outbox, only: [:show] + end end get '/invite/:invite_code', constraints: ->(req) { req.format == :json }, to: 'api/v1/invites#show' From 681a89f684a54f2686324ecfddca250356da338b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:24:00 -0400 Subject: [PATCH 33/45] Readability clean up in `ImportVacuum` spec (#28955) --- spec/lib/vacuum/imports_vacuum_spec.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/spec/lib/vacuum/imports_vacuum_spec.rb b/spec/lib/vacuum/imports_vacuum_spec.rb index c712b7b9b..3a273d827 100644 --- a/spec/lib/vacuum/imports_vacuum_spec.rb +++ b/spec/lib/vacuum/imports_vacuum_spec.rb @@ -13,7 +13,26 @@ RSpec.describe Vacuum::ImportsVacuum do describe '#perform' do it 'cleans up the expected imports' do - expect { subject.perform }.to change { BulkImport.pluck(:id) }.from([old_unconfirmed, new_unconfirmed, recent_ongoing, recent_finished, old_finished].map(&:id)).to([new_unconfirmed, recent_ongoing, recent_finished].map(&:id)) + expect { subject.perform } + .to change { ordered_bulk_imports.pluck(:id) } + .from(original_import_ids) + .to(remaining_import_ids) + end + + def ordered_bulk_imports + BulkImport.order(id: :asc) + end + + def original_import_ids + [old_unconfirmed, new_unconfirmed, recent_ongoing, recent_finished, old_finished].map(&:id) + end + + def vacuumed_import_ids + [old_unconfirmed, old_finished].map(&:id) + end + + def remaining_import_ids + original_import_ids - vacuumed_import_ids end end end From 19cbadfbd66be628a9c544debe752f92b293d345 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:31:15 -0400 Subject: [PATCH 34/45] Use enum-generated scope for `IpBlock` in CLI (#28144) --- app/models/ip_block.rb | 2 +- app/models/user.rb | 2 +- lib/mastodon/cli/ip_blocks.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/ip_block.rb b/app/models/ip_block.rb index 9def5b0cd..d6242efbf 100644 --- a/app/models/ip_block.rb +++ b/app/models/ip_block.rb @@ -23,7 +23,7 @@ class IpBlock < ApplicationRecord sign_up_requires_approval: 5000, sign_up_block: 5500, no_access: 9999, - } + }, prefix: true validates :ip, :severity, presence: true validates :ip, uniqueness: true diff --git a/app/models/user.rb b/app/models/user.rb index 14c2bb6e0..ee9116b9f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -446,7 +446,7 @@ class User < ApplicationRecord end def sign_up_from_ip_requires_approval? - sign_up_ip.present? && IpBlock.sign_up_requires_approval.exists?(['ip >>= ?', sign_up_ip.to_s]) + sign_up_ip.present? && IpBlock.severity_sign_up_requires_approval.exists?(['ip >>= ?', sign_up_ip.to_s]) end def sign_up_email_requires_approval? diff --git a/lib/mastodon/cli/ip_blocks.rb b/lib/mastodon/cli/ip_blocks.rb index 100bf7bad..3c5fdb275 100644 --- a/lib/mastodon/cli/ip_blocks.rb +++ b/lib/mastodon/cli/ip_blocks.rb @@ -105,7 +105,7 @@ module Mastodon::CLI tools. Only blocks with no_access severity are returned. LONG_DESC def export - IpBlock.where(severity: :no_access).find_each do |ip_block| + IpBlock.severity_no_access.find_each do |ip_block| case options[:format] when 'nginx' say "deny #{ip_block.ip}/#{ip_block.ip.prefix};" From 0bc17a3d48eeed102af3b4d733f0ff8ad2f9f62b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 05:31:57 -0400 Subject: [PATCH 35/45] Use enum-generated `public_visibility` scope on Status (#28156) --- app/models/concerns/account/statuses_search.rb | 2 +- app/models/concerns/status/search_concern.rb | 2 +- app/models/public_feed.rb | 2 +- app/models/status.rb | 1 - spec/search/models/concerns/account/statuses_search_spec.rb | 4 ++-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/models/concerns/account/statuses_search.rb b/app/models/concerns/account/statuses_search.rb index 334b71450..93452b78b 100644 --- a/app/models/concerns/account/statuses_search.rb +++ b/app/models/concerns/account/statuses_search.rb @@ -31,7 +31,7 @@ module Account::StatusesSearch def add_to_public_statuses_index! return unless Chewy.enabled? - statuses.without_reblogs.where(visibility: :public).reorder(nil).find_in_batches do |batch| + statuses.without_reblogs.public_visibility.reorder(nil).find_in_batches do |batch| PublicStatusesIndex.import(batch) end end diff --git a/app/models/concerns/status/search_concern.rb b/app/models/concerns/status/search_concern.rb index c16db8bd8..3f31b3b67 100644 --- a/app/models/concerns/status/search_concern.rb +++ b/app/models/concerns/status/search_concern.rb @@ -4,7 +4,7 @@ module Status::SearchConcern extend ActiveSupport::Concern included do - scope :indexable, -> { without_reblogs.where(visibility: :public).joins(:account).where(account: { indexable: true }) } + scope :indexable, -> { without_reblogs.public_visibility.joins(:account).where(account: { indexable: true }) } end def searchable_by diff --git a/app/models/public_feed.rb b/app/models/public_feed.rb index c208d6f66..1e2cca4d3 100644 --- a/app/models/public_feed.rb +++ b/app/models/public_feed.rb @@ -61,7 +61,7 @@ class PublicFeed end def public_scope - Status.with_public_visibility.joins(:account).merge(Account.without_suspended.without_silenced) + Status.public_visibility.joins(:account).merge(Account.without_suspended.without_silenced) end def local_only_scope diff --git a/app/models/status.rb b/app/models/status.rb index 0ec69c8dd..a9c0ea70f 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -108,7 +108,6 @@ class Status < ApplicationRecord scope :with_accounts, ->(ids) { where(id: ids).includes(:account) } scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') } scope :without_reblogs, -> { where(statuses: { reblog_of_id: nil }) } - scope :with_public_visibility, -> { where(visibility: :public) } scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) } scope :not_excluded_by_account, ->(account) { where.not(account_id: account.excluded_from_timeline_account_ids) } scope :not_domain_blocked_by_account, ->(account) { account.excluded_from_timeline_domains.blank? ? left_outer_joins(:account) : left_outer_joins(:account).where('accounts.domain IS NULL OR accounts.domain NOT IN (?)', account.excluded_from_timeline_domains) } diff --git a/spec/search/models/concerns/account/statuses_search_spec.rb b/spec/search/models/concerns/account/statuses_search_spec.rb index 915bc094c..a1b0bf405 100644 --- a/spec/search/models/concerns/account/statuses_search_spec.rb +++ b/spec/search/models/concerns/account/statuses_search_spec.rb @@ -21,7 +21,7 @@ describe Account::StatusesSearch, :sidekiq_inline do account.indexable = true account.save! - expect(PublicStatusesIndex.filter(term: { account_id: account.id }).count).to eq(account.statuses.where(visibility: :public).count) + expect(PublicStatusesIndex.filter(term: { account_id: account.id }).count).to eq(account.statuses.public_visibility.count) expect(StatusesIndex.filter(term: { account_id: account.id }).count).to eq(account.statuses.count) end end @@ -32,7 +32,7 @@ describe Account::StatusesSearch, :sidekiq_inline do context 'when picking an indexable account' do it 'has statuses in the PublicStatusesIndex' do - expect(PublicStatusesIndex.filter(term: { account_id: account.id }).count).to eq(account.statuses.where(visibility: :public).count) + expect(PublicStatusesIndex.filter(term: { account_id: account.id }).count).to eq(account.statuses.public_visibility.count) end it 'has statuses in the StatusesIndex' do From 95a5713ff73787bdea8a2d5cb848386bf8c4fe80 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 14 Mar 2024 10:34:36 +0100 Subject: [PATCH 36/45] Fix accounts not getting imported into redux store for some filtered notification types (#29588) --- app/javascript/mastodon/actions/notifications.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index 30b7601d5..b54cbe27b 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -552,7 +552,10 @@ export const fetchNotificationsForRequest = accountId => (dispatch, getState) => api(getState).get('/api/v1/notifications', { params }).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); + dispatch(importFetchedAccounts(response.data.map(item => item.account))); dispatch(importFetchedStatuses(response.data.map(item => item.status).filter(status => !!status))); + dispatch(importFetchedAccounts(response.data.filter(item => item.report).map(item => item.report.target_account))); + dispatch(fetchNotificationsForRequestSuccess(response.data, next?.uri)); }).catch(err => { dispatch(fetchNotificationsForRequestFail(err)); @@ -585,7 +588,10 @@ export const expandNotificationsForRequest = () => (dispatch, getState) => { api(getState).get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); + dispatch(importFetchedAccounts(response.data.map(item => item.account))); dispatch(importFetchedStatuses(response.data.map(item => item.status).filter(status => !!status))); + dispatch(importFetchedAccounts(response.data.filter(item => item.report).map(item => item.report.target_account))); + dispatch(expandNotificationsForRequestSuccess(response.data, next?.uri)); }).catch(err => { dispatch(expandNotificationsForRequestFail(err)); From 30483d618f94ed85ac90c78ae24fc40349891208 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 14 Mar 2024 11:01:55 +0100 Subject: [PATCH 37/45] Fix back button appearing in column header unexpectedly in web UI (#29551) --- app/javascript/mastodon/components/column_header.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/components/column_header.jsx b/app/javascript/mastodon/components/column_header.jsx index 8b7dcebc6..7fd646690 100644 --- a/app/javascript/mastodon/components/column_header.jsx +++ b/app/javascript/mastodon/components/column_header.jsx @@ -199,7 +199,7 @@ class ColumnHeader extends PureComponent {

{hasTitle && ( <> - {backButton} + {showBackButton && backButton}