diff --git a/.env.test b/.env.test index 539bdeb795034b..52379687b41bd7 100644 --- a/.env.test +++ b/.env.test @@ -6,7 +6,8 @@ LOCAL_HTTPS=true # Elasticsearch ES_PREFIX=test -# Required by ActiveRecord encryption feature -ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=fkSxKD2bF396kdQbrP1EJ7WbU7ZgNokR -ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=r0hvVmzBVsjxC7AMlwhOzmtc36ZCOS1E -ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=PhdFyyfy5xJ7WVd2lWBpcPScRQHzRTNr +# Secret values required by ActiveRecord encryption feature +# Use `bin/rails db:encryption:init` to generate fresh secrets +ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=test_determinist_key_DO_NOT_USE_IN_PRODUCTION +ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=test_salt_DO_NOT_USE_IN_PRODUCTION +ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=test_primary_key_DO_NOT_USE_IN_PRODUCTION diff --git a/Gemfile.lock b/Gemfile.lock index 6001c73db498e0..f1a1d2a938da1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,35 +10,35 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + actioncable (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailbox (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.2) - actionpack (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailer (7.1.3.3) + actionpack (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.2) - actionview (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -46,15 +46,15 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.2) - actionpack (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actiontext (7.1.3.3) + actionpack (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.2) - activesupport (= 7.1.3.2) + actionview (7.1.3.3) + activesupport (= 7.1.3.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -64,22 +64,22 @@ GEM activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.1.3.2) - activesupport (= 7.1.3.2) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.3.6) - activemodel (7.1.3.2) - activesupport (= 7.1.3.2) - activerecord (7.1.3.2) - activemodel (= 7.1.3.2) - activesupport (= 7.1.3.2) + activemodel (7.1.3.3) + activesupport (= 7.1.3.3) + activerecord (7.1.3.3) + activemodel (= 7.1.3.3) + activesupport (= 7.1.3.3) timeout (>= 0.4.0) - activestorage (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activesupport (= 7.1.3.2) + activestorage (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activesupport (= 7.1.3.3) marcel (~> 1.0) - activesupport (7.1.3.2) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -425,7 +425,7 @@ GEM mime-types-data (3.2024.0507) mini_mime (1.1.5) mini_portile2 (2.8.6) - minitest (5.22.3) + minitest (5.23.0) msgpack (1.7.2) multi_json (1.15.0) multipart-post (2.4.0) @@ -444,7 +444,7 @@ GEM timeout net-smtp (0.5.0) net-protocol - nio4r (2.7.1) + nio4r (2.7.3) nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -610,7 +610,7 @@ GEM pundit (2.3.2) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.7.3) + racc (1.8.0) rack (2.2.9) rack-attack (6.7.0) rack (>= 1.0, < 4) @@ -634,20 +634,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3.2) - actioncable (= 7.1.3.2) - actionmailbox (= 7.1.3.2) - actionmailer (= 7.1.3.2) - actionpack (= 7.1.3.2) - actiontext (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activemodel (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + rails (7.1.3.3) + actioncable (= 7.1.3.3) + actionmailbox (= 7.1.3.3) + actionmailer (= 7.1.3.3) + actionpack (= 7.1.3.3) + actiontext (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activemodel (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) bundler (>= 1.15.0) - railties (= 7.1.3.2) + railties (= 7.1.3.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -662,9 +662,9 @@ GEM rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -685,7 +685,7 @@ GEM redis (>= 4) redlock (1.3.2) redis (>= 3.0.0, < 6.0) - regexp_parser (2.9.0) + regexp_parser (2.9.2) reline (0.5.7) io-console (~> 0.5) request_store (1.6.0) @@ -746,7 +746,7 @@ GEM rubocop-performance (1.21.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.24.1) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -775,7 +775,7 @@ GEM scenic (1.8.0) activerecord (>= 4.0.0) railties (>= 4.0.0) - selenium-webdriver (4.21.0) + selenium-webdriver (4.21.1) base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb index 724af2360da9e0..8749a2ca773e5b 100644 --- a/app/controllers/admin/accounts_controller.rb +++ b/app/controllers/admin/accounts_controller.rb @@ -142,7 +142,7 @@ def remove_header def unblock_email authorize @account, :unblock_email? - CanonicalEmailBlock.matching_account(@account).delete_all + CanonicalEmailBlock.where(reference_account: @account).delete_all log_action :unblock_email, @account diff --git a/app/controllers/api/v1/apps/credentials_controller.rb b/app/controllers/api/v1/apps/credentials_controller.rb index 6256bed64cf831..29ab9203835840 100644 --- a/app/controllers/api/v1/apps/credentials_controller.rb +++ b/app/controllers/api/v1/apps/credentials_controller.rb @@ -4,6 +4,6 @@ class Api::V1::Apps::CredentialsController < Api::BaseController def show return doorkeeper_render_error unless valid_doorkeeper_token? - render json: doorkeeper_token.application, serializer: REST::ApplicationSerializer, fields: %i(name website vapid_key client_id scopes) + render json: doorkeeper_token.application, serializer: REST::ApplicationSerializer end end diff --git a/app/controllers/api/v1/apps_controller.rb b/app/controllers/api/v1/apps_controller.rb index 97177547a2b9ae..50feaf185470fa 100644 --- a/app/controllers/api/v1/apps_controller.rb +++ b/app/controllers/api/v1/apps_controller.rb @@ -5,7 +5,7 @@ class Api::V1::AppsController < Api::BaseController def create @app = Doorkeeper::Application.create!(application_options) - render json: @app, serializer: REST::ApplicationSerializer + render json: @app, serializer: REST::CredentialApplicationSerializer end private @@ -24,6 +24,6 @@ def app_scopes_or_default end def app_params - params.permit(:client_name, :redirect_uris, :scopes, :website) + params.permit(:client_name, :scopes, :website, :redirect_uris, redirect_uris: []) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8dee31e18d6cda..b11463f93fc16b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -254,6 +254,10 @@ def prerender_custom_emojis_from_hash(html, custom_emojis_hash) prerender_custom_emojis(html, JSON.parse([custom_emojis_hash].to_json, object_class: OpenStruct)) # rubocop:disable Style/OpenStructUse end + def mascot_url + full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg')) + end + def instance_presenter @instance_presenter ||= InstancePresenter.new end diff --git a/app/helpers/mascot_helper.rb b/app/helpers/mascot_helper.rb deleted file mode 100644 index 34b656411ebce3..00000000000000 --- a/app/helpers/mascot_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module MascotHelper - def mascot_url - full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg')) - end - - def instance_presenter - @instance_presenter ||= InstancePresenter.new - end -end diff --git a/app/javascript/mastodon/actions/account_notes.ts b/app/javascript/mastodon/actions/account_notes.ts index e524e5235bfe5a..c2ebaf54a43055 100644 --- a/app/javascript/mastodon/actions/account_notes.ts +++ b/app/javascript/mastodon/actions/account_notes.ts @@ -1,18 +1,10 @@ -import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships'; -import { createAppAsyncThunk } from 'mastodon/store/typed_functions'; +import { apiSubmitAccountNote } from 'mastodon/api/accounts'; +import { createDataLoadingThunk } from 'mastodon/store/typed_functions'; -import api from '../api'; - -export const submitAccountNote = createAppAsyncThunk( +export const submitAccountNote = createDataLoadingThunk( 'account_note/submit', - async (args: { id: string; value: string }, { getState }) => { - const response = await api(getState).post( - `/api/v1/accounts/${args.id}/note`, - { - comment: args.value, - }, - ); - - return { relationship: response.data }; - }, + ({ accountId, note }: { accountId: string; note: string }) => + apiSubmitAccountNote(accountId, note), + (relationship) => ({ relationship }), + { skipLoading: true }, ); diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js index 9f3bbba03313f6..cea915e5f17fd0 100644 --- a/app/javascript/mastodon/actions/accounts.js +++ b/app/javascript/mastodon/actions/accounts.js @@ -76,11 +76,11 @@ export const ACCOUNT_REVEAL = 'ACCOUNT_REVEAL'; export * from './accounts_typed'; export function fetchAccount(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchRelationships([id])); dispatch(fetchAccountRequest(id)); - api(getState).get(`/api/v1/accounts/${id}`).then(response => { + api().get(`/api/v1/accounts/${id}`).then(response => { dispatch(importFetchedAccount(response.data)); dispatch(fetchAccountSuccess()); }).catch(error => { @@ -89,10 +89,10 @@ export function fetchAccount(id) { }; } -export const lookupAccount = acct => (dispatch, getState) => { +export const lookupAccount = acct => (dispatch) => { dispatch(lookupAccountRequest(acct)); - api(getState).get('/api/v1/accounts/lookup', { params: { acct } }).then(response => { + api().get('/api/v1/accounts/lookup', { params: { acct } }).then(response => { dispatch(fetchRelationships([response.data.id])); dispatch(importFetchedAccount(response.data)); dispatch(lookupAccountSuccess()); @@ -146,7 +146,7 @@ export function followAccount(id, options = { reblogs: true }) { dispatch(followAccountRequest({ id, locked })); - api(getState).post(`/api/v1/accounts/${id}/follow`, options).then(response => { + api().post(`/api/v1/accounts/${id}/follow`, options).then(response => { dispatch(followAccountSuccess({relationship: response.data, alreadyFollowing})); }).catch(error => { dispatch(followAccountFail({ id, error, locked })); @@ -158,7 +158,7 @@ export function unfollowAccount(id) { return (dispatch, getState) => { dispatch(unfollowAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/unfollow`).then(response => { + api().post(`/api/v1/accounts/${id}/unfollow`).then(response => { dispatch(unfollowAccountSuccess({relationship: response.data, statuses: getState().get('statuses')})); }).catch(error => { dispatch(unfollowAccountFail({ id, error })); @@ -170,7 +170,7 @@ export function blockAccount(id) { return (dispatch, getState) => { dispatch(blockAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/block`).then(response => { + api().post(`/api/v1/accounts/${id}/block`).then(response => { // Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers dispatch(blockAccountSuccess({ relationship: response.data, statuses: getState().get('statuses') })); }).catch(error => { @@ -180,10 +180,10 @@ export function blockAccount(id) { } export function unblockAccount(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unblockAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/unblock`).then(response => { + api().post(`/api/v1/accounts/${id}/unblock`).then(response => { dispatch(unblockAccountSuccess({ relationship: response.data })); }).catch(error => { dispatch(unblockAccountFail({ id, error })); @@ -223,7 +223,7 @@ export function muteAccount(id, notifications, duration=0) { return (dispatch, getState) => { dispatch(muteAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications, duration }).then(response => { + api().post(`/api/v1/accounts/${id}/mute`, { notifications, duration }).then(response => { // Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers dispatch(muteAccountSuccess({ relationship: response.data, statuses: getState().get('statuses') })); }).catch(error => { @@ -233,10 +233,10 @@ export function muteAccount(id, notifications, duration=0) { } export function unmuteAccount(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unmuteAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/unmute`).then(response => { + api().post(`/api/v1/accounts/${id}/unmute`).then(response => { dispatch(unmuteAccountSuccess({ relationship: response.data })); }).catch(error => { dispatch(unmuteAccountFail({ id, error })); @@ -274,10 +274,10 @@ export function unmuteAccountFail(error) { export function fetchFollowers(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchFollowersRequest(id)); - api(getState).get(`/api/v1/accounts/${id}/followers`).then(response => { + api().get(`/api/v1/accounts/${id}/followers`).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); @@ -324,7 +324,7 @@ export function expandFollowers(id) { dispatch(expandFollowersRequest(id)); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); @@ -361,10 +361,10 @@ export function expandFollowersFail(id, error) { } export function fetchFollowing(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchFollowingRequest(id)); - api(getState).get(`/api/v1/accounts/${id}/following`).then(response => { + api().get(`/api/v1/accounts/${id}/following`).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); @@ -411,7 +411,7 @@ export function expandFollowing(id) { dispatch(expandFollowingRequest(id)); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); @@ -460,7 +460,7 @@ export function fetchRelationships(accountIds) { dispatch(fetchRelationshipsRequest(newAccountIds)); - api(getState).get(`/api/v1/accounts/relationships?with_suspended=true&${newAccountIds.map(id => `id[]=${id}`).join('&')}`).then(response => { + api().get(`/api/v1/accounts/relationships?with_suspended=true&${newAccountIds.map(id => `id[]=${id}`).join('&')}`).then(response => { dispatch(fetchRelationshipsSuccess({ relationships: response.data })); }).catch(error => { dispatch(fetchRelationshipsFail(error)); @@ -486,10 +486,10 @@ export function fetchRelationshipsFail(error) { } export function fetchFollowRequests() { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchFollowRequestsRequest()); - api(getState).get('/api/v1/follow_requests').then(response => { + api().get('/api/v1/follow_requests').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null)); @@ -528,7 +528,7 @@ export function expandFollowRequests() { dispatch(expandFollowRequestsRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(expandFollowRequestsSuccess(response.data, next ? next.uri : null)); @@ -558,10 +558,10 @@ export function expandFollowRequestsFail(error) { } export function authorizeFollowRequest(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(authorizeFollowRequestRequest(id)); - api(getState) + api() .post(`/api/v1/follow_requests/${id}/authorize`) .then(() => dispatch(authorizeFollowRequestSuccess({ id }))) .catch(error => dispatch(authorizeFollowRequestFail(id, error))); @@ -585,10 +585,10 @@ export function authorizeFollowRequestFail(id, error) { export function rejectFollowRequest(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(rejectFollowRequestRequest(id)); - api(getState) + api() .post(`/api/v1/follow_requests/${id}/reject`) .then(() => dispatch(rejectFollowRequestSuccess({ id }))) .catch(error => dispatch(rejectFollowRequestFail(id, error))); @@ -611,10 +611,10 @@ export function rejectFollowRequestFail(id, error) { } export function pinAccount(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(pinAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/pin`).then(response => { + api().post(`/api/v1/accounts/${id}/pin`).then(response => { dispatch(pinAccountSuccess({ relationship: response.data })); }).catch(error => { dispatch(pinAccountFail(error)); @@ -623,10 +623,10 @@ export function pinAccount(id) { } export function unpinAccount(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unpinAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/unpin`).then(response => { + api().post(`/api/v1/accounts/${id}/unpin`).then(response => { dispatch(unpinAccountSuccess({ relationship: response.data })); }).catch(error => { dispatch(unpinAccountFail(error)); @@ -662,7 +662,7 @@ export function unpinAccountFail(error) { }; } -export const updateAccount = ({ displayName, note, avatar, header, discoverable, indexable }) => (dispatch, getState) => { +export const updateAccount = ({ displayName, note, avatar, header, discoverable, indexable }) => (dispatch) => { const data = new FormData(); data.append('display_name', displayName); @@ -672,7 +672,7 @@ export const updateAccount = ({ displayName, note, avatar, header, discoverable, data.append('discoverable', discoverable); data.append('indexable', indexable); - return api(getState).patch('/api/v1/accounts/update_credentials', data).then(response => { + return api().patch('/api/v1/accounts/update_credentials', data).then(response => { dispatch(importFetchedAccount(response.data)); }); }; diff --git a/app/javascript/mastodon/actions/announcements.js b/app/javascript/mastodon/actions/announcements.js index 339c5f3adc5a8e..7657b05dc42364 100644 --- a/app/javascript/mastodon/actions/announcements.js +++ b/app/javascript/mastodon/actions/announcements.js @@ -26,10 +26,10 @@ export const ANNOUNCEMENTS_TOGGLE_SHOW = 'ANNOUNCEMENTS_TOGGLE_SHOW'; const noOp = () => {}; -export const fetchAnnouncements = (done = noOp) => (dispatch, getState) => { +export const fetchAnnouncements = (done = noOp) => (dispatch) => { dispatch(fetchAnnouncementsRequest()); - api(getState).get('/api/v1/announcements').then(response => { + api().get('/api/v1/announcements').then(response => { dispatch(fetchAnnouncementsSuccess(response.data.map(x => normalizeAnnouncement(x)))); }).catch(error => { dispatch(fetchAnnouncementsFail(error)); @@ -61,10 +61,10 @@ export const updateAnnouncements = announcement => ({ announcement: normalizeAnnouncement(announcement), }); -export const dismissAnnouncement = announcementId => (dispatch, getState) => { +export const dismissAnnouncement = announcementId => (dispatch) => { dispatch(dismissAnnouncementRequest(announcementId)); - api(getState).post(`/api/v1/announcements/${announcementId}/dismiss`).then(() => { + api().post(`/api/v1/announcements/${announcementId}/dismiss`).then(() => { dispatch(dismissAnnouncementSuccess(announcementId)); }).catch(error => { dispatch(dismissAnnouncementFail(announcementId, error)); @@ -103,7 +103,7 @@ export const addReaction = (announcementId, name) => (dispatch, getState) => { dispatch(addReactionRequest(announcementId, name, alreadyAdded)); } - api(getState).put(`/api/v1/announcements/${announcementId}/reactions/${encodeURIComponent(name)}`).then(() => { + api().put(`/api/v1/announcements/${announcementId}/reactions/${encodeURIComponent(name)}`).then(() => { dispatch(addReactionSuccess(announcementId, name, alreadyAdded)); }).catch(err => { if (!alreadyAdded) { @@ -134,10 +134,10 @@ export const addReactionFail = (announcementId, name, error) => ({ skipLoading: true, }); -export const removeReaction = (announcementId, name) => (dispatch, getState) => { +export const removeReaction = (announcementId, name) => (dispatch) => { dispatch(removeReactionRequest(announcementId, name)); - api(getState).delete(`/api/v1/announcements/${announcementId}/reactions/${encodeURIComponent(name)}`).then(() => { + api().delete(`/api/v1/announcements/${announcementId}/reactions/${encodeURIComponent(name)}`).then(() => { dispatch(removeReactionSuccess(announcementId, name)); }).catch(err => { dispatch(removeReactionFail(announcementId, name, err)); diff --git a/app/javascript/mastodon/actions/blocks.js b/app/javascript/mastodon/actions/blocks.js index 54296d0905c9a9..5c66e27bec2d0b 100644 --- a/app/javascript/mastodon/actions/blocks.js +++ b/app/javascript/mastodon/actions/blocks.js @@ -13,10 +13,10 @@ export const BLOCKS_EXPAND_SUCCESS = 'BLOCKS_EXPAND_SUCCESS'; export const BLOCKS_EXPAND_FAIL = 'BLOCKS_EXPAND_FAIL'; export function fetchBlocks() { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchBlocksRequest()); - api(getState).get('/api/v1/blocks').then(response => { + api().get('/api/v1/blocks').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(fetchBlocksSuccess(response.data, next ? next.uri : null)); @@ -56,7 +56,7 @@ export function expandBlocks() { dispatch(expandBlocksRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(expandBlocksSuccess(response.data, next ? next.uri : null)); diff --git a/app/javascript/mastodon/actions/bookmarks.js b/app/javascript/mastodon/actions/bookmarks.js index 91c1d61e1080ed..133e49e839ea06 100644 --- a/app/javascript/mastodon/actions/bookmarks.js +++ b/app/javascript/mastodon/actions/bookmarks.js @@ -20,7 +20,7 @@ export function fetchBookmarkedStatuses() { dispatch(fetchBookmarkedStatusesRequest()); - api(getState).get('/api/v1/bookmarks').then(response => { + api().get('/api/v1/bookmarks').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); dispatch(fetchBookmarkedStatusesSuccess(response.data, next ? next.uri : null)); @@ -61,7 +61,7 @@ export function expandBookmarkedStatuses() { dispatch(expandBookmarkedStatusesRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); dispatch(expandBookmarkedStatusesSuccess(response.data, next ? next.uri : null)); diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index b013e134fe3f2a..8a8540522fc944 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -207,7 +207,7 @@ export function submitCompose(routerHistory) { }); } - api(getState).request({ + api().request({ url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`, method: statusId === null ? 'post' : 'put', data: { @@ -327,7 +327,7 @@ export function uploadCompose(files) { const data = new FormData(); data.append('file', file); - api(getState).post('/api/v2/media', data, { + api().post('/api/v2/media', data, { onUploadProgress: function({ loaded }){ progress[i] = loaded; dispatch(uploadComposeProgress(progress.reduce((a, v) => a + v, 0), total)); @@ -348,7 +348,7 @@ export function uploadCompose(files) { let tryCount = 1; const poll = () => { - api(getState).get(`/api/v1/media/${data.id}`).then(response => { + api().get(`/api/v1/media/${data.id}`).then(response => { if (response.status === 200) { dispatch(uploadComposeSuccess(response.data, file)); } else if (response.status === 206) { @@ -370,7 +370,7 @@ export const uploadComposeProcessing = () => ({ type: COMPOSE_UPLOAD_PROCESSING, }); -export const uploadThumbnail = (id, file) => (dispatch, getState) => { +export const uploadThumbnail = (id, file) => (dispatch) => { dispatch(uploadThumbnailRequest()); const total = file.size; @@ -378,7 +378,7 @@ export const uploadThumbnail = (id, file) => (dispatch, getState) => { data.append('thumbnail', file); - api(getState).put(`/api/v1/media/${id}`, data, { + api().put(`/api/v1/media/${id}`, data, { onUploadProgress: ({ loaded }) => { dispatch(uploadThumbnailProgress(loaded, total)); }, @@ -461,7 +461,7 @@ export function changeUploadCompose(id, params) { dispatch(changeUploadComposeSuccess(data, true)); } else { - api(getState).put(`/api/v1/media/${id}`, params).then(response => { + api().put(`/api/v1/media/${id}`, params).then(response => { dispatch(changeUploadComposeSuccess(response.data, false)); }).catch(error => { dispatch(changeUploadComposeFail(id, error)); @@ -549,7 +549,7 @@ const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) => fetchComposeSuggestionsAccountsController = new AbortController(); - api(getState).get('/api/v1/accounts/search', { + api().get('/api/v1/accounts/search', { signal: fetchComposeSuggestionsAccountsController.signal, params: { @@ -583,7 +583,7 @@ const fetchComposeSuggestionsTags = throttle((dispatch, getState, token) => { fetchComposeSuggestionsTagsController = new AbortController(); - api(getState).get('/api/v2/search', { + api().get('/api/v2/search', { signal: fetchComposeSuggestionsTagsController.signal, params: { diff --git a/app/javascript/mastodon/actions/conversations.js b/app/javascript/mastodon/actions/conversations.js index 8c4c4529fb7e8b..03174c485dd4c0 100644 --- a/app/javascript/mastodon/actions/conversations.js +++ b/app/javascript/mastodon/actions/conversations.js @@ -28,13 +28,13 @@ export const unmountConversations = () => ({ type: CONVERSATIONS_UNMOUNT, }); -export const markConversationRead = conversationId => (dispatch, getState) => { +export const markConversationRead = conversationId => (dispatch) => { dispatch({ type: CONVERSATIONS_READ, id: conversationId, }); - api(getState).post(`/api/v1/conversations/${conversationId}/read`); + api().post(`/api/v1/conversations/${conversationId}/read`); }; export const expandConversations = ({ maxId } = {}) => (dispatch, getState) => { @@ -48,7 +48,7 @@ export const expandConversations = ({ maxId } = {}) => (dispatch, getState) => { const isLoadingRecent = !!params.since_id; - api(getState).get('/api/v1/conversations', { params }) + api().get('/api/v1/conversations', { params }) .then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); @@ -88,10 +88,10 @@ export const updateConversations = conversation => dispatch => { }); }; -export const deleteConversation = conversationId => (dispatch, getState) => { +export const deleteConversation = conversationId => (dispatch) => { dispatch(deleteConversationRequest(conversationId)); - api(getState).delete(`/api/v1/conversations/${conversationId}`) + api().delete(`/api/v1/conversations/${conversationId}`) .then(() => dispatch(deleteConversationSuccess(conversationId))) .catch(error => dispatch(deleteConversationFail(conversationId, error))); }; diff --git a/app/javascript/mastodon/actions/custom_emojis.js b/app/javascript/mastodon/actions/custom_emojis.js index 9ec8156b170a21..fb65f072dc8db7 100644 --- a/app/javascript/mastodon/actions/custom_emojis.js +++ b/app/javascript/mastodon/actions/custom_emojis.js @@ -5,10 +5,10 @@ export const CUSTOM_EMOJIS_FETCH_SUCCESS = 'CUSTOM_EMOJIS_FETCH_SUCCESS'; export const CUSTOM_EMOJIS_FETCH_FAIL = 'CUSTOM_EMOJIS_FETCH_FAIL'; export function fetchCustomEmojis() { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchCustomEmojisRequest()); - api(getState).get('/api/v1/custom_emojis').then(response => { + api().get('/api/v1/custom_emojis').then(response => { dispatch(fetchCustomEmojisSuccess(response.data)); }).catch(error => { dispatch(fetchCustomEmojisFail(error)); diff --git a/app/javascript/mastodon/actions/directory.js b/app/javascript/mastodon/actions/directory.js index cda63f2b5a43eb..7a0748029d97c1 100644 --- a/app/javascript/mastodon/actions/directory.js +++ b/app/javascript/mastodon/actions/directory.js @@ -11,10 +11,10 @@ export const DIRECTORY_EXPAND_REQUEST = 'DIRECTORY_EXPAND_REQUEST'; export const DIRECTORY_EXPAND_SUCCESS = 'DIRECTORY_EXPAND_SUCCESS'; export const DIRECTORY_EXPAND_FAIL = 'DIRECTORY_EXPAND_FAIL'; -export const fetchDirectory = params => (dispatch, getState) => { +export const fetchDirectory = params => (dispatch) => { dispatch(fetchDirectoryRequest()); - api(getState).get('/api/v1/directory', { params: { ...params, limit: 20 } }).then(({ data }) => { + api().get('/api/v1/directory', { params: { ...params, limit: 20 } }).then(({ data }) => { dispatch(importFetchedAccounts(data)); dispatch(fetchDirectorySuccess(data)); dispatch(fetchRelationships(data.map(x => x.id))); @@ -40,7 +40,7 @@ export const expandDirectory = params => (dispatch, getState) => { const loadedItems = getState().getIn(['user_lists', 'directory', 'items']).size; - api(getState).get('/api/v1/directory', { params: { ...params, offset: loadedItems, limit: 20 } }).then(({ data }) => { + api().get('/api/v1/directory', { params: { ...params, offset: loadedItems, limit: 20 } }).then(({ data }) => { dispatch(importFetchedAccounts(data)); dispatch(expandDirectorySuccess(data)); dispatch(fetchRelationships(data.map(x => x.id))); diff --git a/app/javascript/mastodon/actions/domain_blocks.js b/app/javascript/mastodon/actions/domain_blocks.js index 55c0a6ce9d0ab7..727f800af3b528 100644 --- a/app/javascript/mastodon/actions/domain_blocks.js +++ b/app/javascript/mastodon/actions/domain_blocks.js @@ -24,7 +24,7 @@ export function blockDomain(domain) { return (dispatch, getState) => { dispatch(blockDomainRequest(domain)); - api(getState).post('/api/v1/domain_blocks', { domain }).then(() => { + api().post('/api/v1/domain_blocks', { domain }).then(() => { const at_domain = '@' + domain; const accounts = getState().get('accounts').filter(item => item.get('acct').endsWith(at_domain)).valueSeq().map(item => item.get('id')); @@ -54,7 +54,7 @@ export function unblockDomain(domain) { return (dispatch, getState) => { dispatch(unblockDomainRequest(domain)); - api(getState).delete('/api/v1/domain_blocks', { params: { domain } }).then(() => { + api().delete('/api/v1/domain_blocks', { params: { domain } }).then(() => { const at_domain = '@' + domain; const accounts = getState().get('accounts').filter(item => item.get('acct').endsWith(at_domain)).valueSeq().map(item => item.get('id')); dispatch(unblockDomainSuccess({ domain, accounts })); @@ -80,10 +80,10 @@ export function unblockDomainFail(domain, error) { } export function fetchDomainBlocks() { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchDomainBlocksRequest()); - api(getState).get('/api/v1/domain_blocks').then(response => { + api().get('/api/v1/domain_blocks').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(fetchDomainBlocksSuccess(response.data, next ? next.uri : null)); }).catch(err => { @@ -123,7 +123,7 @@ export function expandDomainBlocks() { dispatch(expandDomainBlocksRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(expandDomainBlocksSuccess(response.data, next ? next.uri : null)); }).catch(err => { diff --git a/app/javascript/mastodon/actions/favourites.js b/app/javascript/mastodon/actions/favourites.js index e5e2c481aabce8..6270f3473ad10a 100644 --- a/app/javascript/mastodon/actions/favourites.js +++ b/app/javascript/mastodon/actions/favourites.js @@ -20,7 +20,7 @@ export function fetchFavouritedStatuses() { dispatch(fetchFavouritedStatusesRequest()); - api(getState).get('/api/v1/favourites').then(response => { + api().get('/api/v1/favourites').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); dispatch(fetchFavouritedStatusesSuccess(response.data, next ? next.uri : null)); @@ -64,7 +64,7 @@ export function expandFavouritedStatuses() { dispatch(expandFavouritedStatusesRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); dispatch(expandFavouritedStatusesSuccess(response.data, next ? next.uri : null)); diff --git a/app/javascript/mastodon/actions/featured_tags.js b/app/javascript/mastodon/actions/featured_tags.js index 18bb615394571c..6ee4dee2bcd34a 100644 --- a/app/javascript/mastodon/actions/featured_tags.js +++ b/app/javascript/mastodon/actions/featured_tags.js @@ -11,7 +11,7 @@ export const fetchFeaturedTags = (id) => (dispatch, getState) => { dispatch(fetchFeaturedTagsRequest(id)); - api(getState).get(`/api/v1/accounts/${id}/featured_tags`) + api().get(`/api/v1/accounts/${id}/featured_tags`) .then(({ data }) => dispatch(fetchFeaturedTagsSuccess(id, data))) .catch(err => dispatch(fetchFeaturedTagsFail(id, err))); }; diff --git a/app/javascript/mastodon/actions/filters.js b/app/javascript/mastodon/actions/filters.js index a11956ac564c6a..588e390f0a95f8 100644 --- a/app/javascript/mastodon/actions/filters.js +++ b/app/javascript/mastodon/actions/filters.js @@ -23,13 +23,13 @@ export const initAddFilter = (status, { contextType }) => dispatch => }, })); -export const fetchFilters = () => (dispatch, getState) => { +export const fetchFilters = () => (dispatch) => { dispatch({ type: FILTERS_FETCH_REQUEST, skipLoading: true, }); - api(getState) + api() .get('/api/v2/filters') .then(({ data }) => dispatch({ type: FILTERS_FETCH_SUCCESS, @@ -44,10 +44,10 @@ export const fetchFilters = () => (dispatch, getState) => { })); }; -export const createFilterStatus = (params, onSuccess, onFail) => (dispatch, getState) => { +export const createFilterStatus = (params, onSuccess, onFail) => (dispatch) => { dispatch(createFilterStatusRequest()); - api(getState).post(`/api/v2/filters/${params.filter_id}/statuses`, params).then(response => { + api().post(`/api/v2/filters/${params.filter_id}/statuses`, params).then(response => { dispatch(createFilterStatusSuccess(response.data)); if (onSuccess) onSuccess(); }).catch(error => { @@ -70,10 +70,10 @@ export const createFilterStatusFail = error => ({ error, }); -export const createFilter = (params, onSuccess, onFail) => (dispatch, getState) => { +export const createFilter = (params, onSuccess, onFail) => (dispatch) => { dispatch(createFilterRequest()); - api(getState).post('/api/v2/filters', params).then(response => { + api().post('/api/v2/filters', params).then(response => { dispatch(createFilterSuccess(response.data)); if (onSuccess) onSuccess(response.data); }).catch(error => { diff --git a/app/javascript/mastodon/actions/history.js b/app/javascript/mastodon/actions/history.js index 52401b7dce3f95..07732ea187459d 100644 --- a/app/javascript/mastodon/actions/history.js +++ b/app/javascript/mastodon/actions/history.js @@ -15,7 +15,7 @@ export const fetchHistory = statusId => (dispatch, getState) => { dispatch(fetchHistoryRequest(statusId)); - api(getState).get(`/api/v1/statuses/${statusId}/history`).then(({ data }) => { + api().get(`/api/v1/statuses/${statusId}/history`).then(({ data }) => { dispatch(importFetchedAccounts(data.map(x => x.account))); dispatch(fetchHistorySuccess(statusId, data)); }).catch(error => dispatch(fetchHistoryFail(error))); diff --git a/app/javascript/mastodon/actions/interactions.js b/app/javascript/mastodon/actions/interactions.js index 640c5c312884d2..6c60a704654914 100644 --- a/app/javascript/mastodon/actions/interactions.js +++ b/app/javascript/mastodon/actions/interactions.js @@ -3,10 +3,6 @@ import api, { getLinks } from '../api'; import { fetchRelationships } from './accounts'; import { importFetchedAccounts, importFetchedStatus, importFetchedStatuses } from './importer'; -export const REBLOG_REQUEST = 'REBLOG_REQUEST'; -export const REBLOG_SUCCESS = 'REBLOG_SUCCESS'; -export const REBLOG_FAIL = 'REBLOG_FAIL'; - export const REBLOGS_EXPAND_REQUEST = 'REBLOGS_EXPAND_REQUEST'; export const REBLOGS_EXPAND_SUCCESS = 'REBLOGS_EXPAND_SUCCESS'; export const REBLOGS_EXPAND_FAIL = 'REBLOGS_EXPAND_FAIL'; @@ -19,10 +15,6 @@ export const EMOJIREACT_REQUEST = 'EMOJIREACT_REQUEST'; export const EMOJIREACT_SUCCESS = 'EMOJIREACT_SUCCESS'; export const EMOJIREACT_FAIL = 'EMOJIREACT_FAIL'; -export const UNREBLOG_REQUEST = 'UNREBLOG_REQUEST'; -export const UNREBLOG_SUCCESS = 'UNREBLOG_SUCCESS'; -export const UNREBLOG_FAIL = 'UNREBLOG_FAIL'; - export const UNFAVOURITE_REQUEST = 'UNFAVOURITE_REQUEST'; export const UNFAVOURITE_SUCCESS = 'UNFAVOURITE_SUCCESS'; export const UNFAVOURITE_FAIL = 'UNFAVOURITE_FAIL'; @@ -79,89 +71,13 @@ export const MENTIONED_USERS_EXPAND_REQUEST = 'MENTIONED_USERS_EXPAND_REQUEST'; export const MENTIONED_USERS_EXPAND_SUCCESS = 'MENTIONED_USERS_EXPAND_SUCCESS'; export const MENTIONED_USERS_EXPAND_FAIL = 'MENTIONED_USERS_EXPAND_FAIL'; -export function reblog(status, visibility) { - return function (dispatch, getState) { - dispatch(reblogRequest(status)); - - api(getState).post(`/api/v1/statuses/${status.get('id')}/reblog`, { visibility }).then(function (response) { - // The reblog API method returns a new status wrapped around the original. In this case we are only - // interested in how the original is modified, hence passing it skipping the wrapper - dispatch(importFetchedStatus(response.data.reblog)); - dispatch(reblogSuccess(status)); - }).catch(function (error) { - dispatch(reblogFail(status, error)); - }); - }; -} - -export function unreblog(status) { - return (dispatch, getState) => { - dispatch(unreblogRequest(status)); - - api(getState).post(`/api/v1/statuses/${status.get('id')}/unreblog`).then(response => { - dispatch(importFetchedStatus(response.data)); - dispatch(unreblogSuccess(status)); - }).catch(error => { - dispatch(unreblogFail(status, error)); - }); - }; -} - -export function reblogRequest(status) { - return { - type: REBLOG_REQUEST, - status: status, - skipLoading: true, - }; -} - -export function reblogSuccess(status) { - return { - type: REBLOG_SUCCESS, - status: status, - skipLoading: true, - }; -} - -export function reblogFail(status, error) { - return { - type: REBLOG_FAIL, - status: status, - error: error, - skipLoading: true, - }; -} - -export function unreblogRequest(status) { - return { - type: UNREBLOG_REQUEST, - status: status, - skipLoading: true, - }; -} - -export function unreblogSuccess(status) { - return { - type: UNREBLOG_SUCCESS, - status: status, - skipLoading: true, - }; -} - -export function unreblogFail(status, error) { - return { - type: UNREBLOG_FAIL, - status: status, - error: error, - skipLoading: true, - }; -} +export * from "./interactions_typed"; export function favourite(status) { - return function (dispatch, getState) { + return function (dispatch) { dispatch(favouriteRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/favourite`).then(function (response) { + api().post(`/api/v1/statuses/${status.get('id')}/favourite`).then(function (response) { dispatch(importFetchedStatus(response.data)); dispatch(favouriteSuccess(status)); }).catch(function (error) { @@ -171,10 +87,10 @@ export function favourite(status) { } export function unfavourite(status) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unfavouriteRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/unfavourite`).then(response => { + api().post(`/api/v1/statuses/${status.get('id')}/unfavourite`).then(response => { dispatch(importFetchedStatus(response.data)); dispatch(unfavouriteSuccess(status)); }).catch(error => { @@ -319,10 +235,10 @@ export function unEmojiReactFail(status, emoji, error) { } export function bookmark(status) { - return function (dispatch, getState) { + return function (dispatch) { dispatch(bookmarkRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) { + api().post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) { dispatch(importFetchedStatus(response.data)); dispatch(bookmarkSuccess(status, response.data)); }).catch(function (error) { @@ -332,10 +248,10 @@ export function bookmark(status) { } export function unbookmark(status) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unbookmarkRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => { + api().post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => { dispatch(importFetchedStatus(response.data)); dispatch(unbookmarkSuccess(status, response.data)); }).catch(error => { @@ -391,10 +307,10 @@ export function unbookmarkFail(status, error) { } export function fetchReblogs(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchReblogsRequest(id)); - api(getState).get(`/api/v1/statuses/${id}/reblogged_by`).then(response => { + api().get(`/api/v1/statuses/${id}/reblogged_by`).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(fetchReblogsSuccess(id, response.data, next ? next.uri : null)); @@ -438,7 +354,7 @@ export function expandReblogs(id) { dispatch(expandReblogsRequest(id)); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); @@ -473,10 +389,10 @@ export function expandReblogsFail(id, error) { } export function fetchFavourites(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchFavouritesRequest(id)); - api(getState).get(`/api/v1/statuses/${id}/favourited_by`).then(response => { + api().get(`/api/v1/statuses/${id}/favourited_by`).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(fetchFavouritesSuccess(id, response.data, next ? next.uri : null)); @@ -520,7 +436,7 @@ export function expandFavourites(id) { dispatch(expandFavouritesRequest(id)); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); @@ -669,10 +585,10 @@ export function fetchStatusReferencesFail(id, error) { } export function pin(status) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(pinRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/pin`).then(response => { + api().post(`/api/v1/statuses/${status.get('id')}/pin`).then(response => { dispatch(importFetchedStatus(response.data)); dispatch(pinSuccess(status)); }).catch(error => { @@ -707,10 +623,10 @@ export function pinFail(status, error) { } export function unpin (status) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unpinRequest(status)); - api(getState).post(`/api/v1/statuses/${status.get('id')}/unpin`).then(response => { + api().post(`/api/v1/statuses/${status.get('id')}/unpin`).then(response => { dispatch(importFetchedStatus(response.data)); dispatch(unpinSuccess(status)); }).catch(error => { diff --git a/app/javascript/mastodon/actions/interactions_typed.ts b/app/javascript/mastodon/actions/interactions_typed.ts new file mode 100644 index 00000000000000..f58faffa86d468 --- /dev/null +++ b/app/javascript/mastodon/actions/interactions_typed.ts @@ -0,0 +1,35 @@ +import { apiReblog, apiUnreblog } from 'mastodon/api/interactions'; +import type { StatusVisibility } from 'mastodon/models/status'; +import { createDataLoadingThunk } from 'mastodon/store/typed_functions'; + +import { importFetchedStatus } from './importer'; + +export const reblog = createDataLoadingThunk( + 'status/reblog', + ({ + statusId, + visibility, + }: { + statusId: string; + visibility: StatusVisibility; + }) => apiReblog(statusId, visibility), + (data, { dispatch, discardLoadData }) => { + // The reblog API method returns a new status wrapped around the original. In this case we are only + // interested in how the original is modified, hence passing it skipping the wrapper + dispatch(importFetchedStatus(data.reblog)); + + // The payload is not used in any actions + return discardLoadData; + }, +); + +export const unreblog = createDataLoadingThunk( + 'status/unreblog', + ({ statusId }: { statusId: string }) => apiUnreblog(statusId), + (data, { dispatch, discardLoadData }) => { + dispatch(importFetchedStatus(data)); + + // The payload is not used in any actions + return discardLoadData; + }, +); diff --git a/app/javascript/mastodon/actions/lists.js b/app/javascript/mastodon/actions/lists.js index e494a40a5dbce3..a7cc1a9329ae79 100644 --- a/app/javascript/mastodon/actions/lists.js +++ b/app/javascript/mastodon/actions/lists.js @@ -59,7 +59,7 @@ export const fetchList = id => (dispatch, getState) => { dispatch(fetchListRequest(id)); - api(getState).get(`/api/v1/lists/${id}`) + api().get(`/api/v1/lists/${id}`) .then(({ data }) => dispatch(fetchListSuccess(data))) .catch(err => dispatch(fetchListFail(id, err))); }; @@ -80,10 +80,10 @@ export const fetchListFail = (id, error) => ({ error, }); -export const fetchLists = () => (dispatch, getState) => { +export const fetchLists = () => (dispatch) => { dispatch(fetchListsRequest()); - api(getState).get('/api/v1/lists') + api().get('/api/v1/lists') .then(({ data }) => dispatch(fetchListsSuccess(data))) .catch(err => dispatch(fetchListsFail(err))); }; @@ -127,10 +127,10 @@ export const changeListEditorTitle = value => ({ value, }); -export const createList = (title, shouldReset) => (dispatch, getState) => { +export const createList = (title, shouldReset) => (dispatch) => { dispatch(createListRequest()); - api(getState).post('/api/v1/lists', { title }).then(({ data }) => { + api().post('/api/v1/lists', { title }).then(({ data }) => { dispatch(createListSuccess(data)); if (shouldReset) { @@ -153,10 +153,10 @@ export const createListFail = error => ({ error, }); -export const updateList = (id, title, shouldReset, isExclusive, replies_policy, notify) => (dispatch, getState) => { +export const updateList = (id, title, shouldReset, isExclusive, replies_policy, notify) => (dispatch) => { dispatch(updateListRequest(id)); - api(getState).put(`/api/v1/lists/${id}`, { + api().put(`/api/v1/lists/${id}`, { title, replies_policy, exclusive: typeof isExclusive === 'undefined' ? undefined : !!isExclusive, @@ -190,10 +190,10 @@ export const resetListEditor = () => ({ type: LIST_EDITOR_RESET, }); -export const deleteList = id => (dispatch, getState) => { +export const deleteList = id => (dispatch) => { dispatch(deleteListRequest(id)); - api(getState).delete(`/api/v1/lists/${id}`) + api().delete(`/api/v1/lists/${id}`) .then(() => dispatch(deleteListSuccess(id))) .catch(err => dispatch(deleteListFail(id, err))); }; @@ -214,10 +214,10 @@ export const deleteListFail = (id, error) => ({ error, }); -export const fetchListAccounts = listId => (dispatch, getState) => { +export const fetchListAccounts = listId => (dispatch) => { dispatch(fetchListAccountsRequest(listId)); - api(getState).get(`/api/v1/lists/${listId}/accounts`, { params: { limit: 0 } }).then(({ data }) => { + api().get(`/api/v1/lists/${listId}/accounts`, { params: { limit: 0 } }).then(({ data }) => { dispatch(importFetchedAccounts(data)); dispatch(fetchListAccountsSuccess(listId, data)); }).catch(err => dispatch(fetchListAccountsFail(listId, err))); @@ -241,14 +241,14 @@ export const fetchListAccountsFail = (id, error) => ({ error, }); -export const fetchListSuggestions = q => (dispatch, getState) => { +export const fetchListSuggestions = q => (dispatch) => { const params = { q, resolve: false, following: true, }; - api(getState).get('/api/v1/accounts/search', { params }).then(({ data }) => { + api().get('/api/v1/accounts/search', { params }).then(({ data }) => { dispatch(importFetchedAccounts(data)); dispatch(fetchListSuggestionsReady(q, data)); }).catch(error => dispatch(showAlertForError(error))); @@ -273,10 +273,10 @@ export const addToListEditor = accountId => (dispatch, getState) => { dispatch(addToList(getState().getIn(['listEditor', 'listId']), accountId)); }; -export const addToList = (listId, accountId) => (dispatch, getState) => { +export const addToList = (listId, accountId) => (dispatch) => { dispatch(addToListRequest(listId, accountId)); - api(getState).post(`/api/v1/lists/${listId}/accounts`, { account_ids: [accountId] }) + api().post(`/api/v1/lists/${listId}/accounts`, { account_ids: [accountId] }) .then(() => dispatch(addToListSuccess(listId, accountId))) .catch(err => dispatch(addToListFail(listId, accountId, err))); }; @@ -304,10 +304,10 @@ export const removeFromListEditor = accountId => (dispatch, getState) => { dispatch(removeFromList(getState().getIn(['listEditor', 'listId']), accountId)); }; -export const removeFromList = (listId, accountId) => (dispatch, getState) => { +export const removeFromList = (listId, accountId) => (dispatch) => { dispatch(removeFromListRequest(listId, accountId)); - api(getState).delete(`/api/v1/lists/${listId}/accounts`, { params: { account_ids: [accountId] } }) + api().delete(`/api/v1/lists/${listId}/accounts`, { params: { account_ids: [accountId] } }) .then(() => dispatch(removeFromListSuccess(listId, accountId))) .catch(err => dispatch(removeFromListFail(listId, accountId, err))); }; @@ -344,10 +344,10 @@ export const setupListAdder = accountId => (dispatch, getState) => { dispatch(fetchAccountLists(accountId)); }; -export const fetchAccountLists = accountId => (dispatch, getState) => { +export const fetchAccountLists = accountId => (dispatch) => { dispatch(fetchAccountListsRequest(accountId)); - api(getState).get(`/api/v1/accounts/${accountId}/lists`) + api().get(`/api/v1/accounts/${accountId}/lists`) .then(({ data }) => dispatch(fetchAccountListsSuccess(accountId, data))) .catch(err => dispatch(fetchAccountListsFail(accountId, err))); }; @@ -376,4 +376,3 @@ export const addToListAdder = listId => (dispatch, getState) => { export const removeFromListAdder = listId => (dispatch, getState) => { dispatch(removeFromList(listId, getState().getIn(['listAdder', 'accountId']))); }; - diff --git a/app/javascript/mastodon/actions/markers.ts b/app/javascript/mastodon/actions/markers.ts index 91f78ee2867c2c..03f577c540fc5d 100644 --- a/app/javascript/mastodon/actions/markers.ts +++ b/app/javascript/mastodon/actions/markers.ts @@ -1,19 +1,24 @@ import { debounce } from 'lodash'; import type { MarkerJSON } from 'mastodon/api_types/markers'; +import { getAccessToken } from 'mastodon/initial_state'; import type { AppDispatch, RootState } from 'mastodon/store'; import { createAppAsyncThunk } from 'mastodon/store/typed_functions'; -import api, { authorizationTokenFromState } from '../api'; +import api from '../api'; import { compareId } from '../compare_id'; export const synchronouslySubmitMarkers = createAppAsyncThunk( 'markers/submit', async (_args, { getState }) => { - const accessToken = authorizationTokenFromState(getState); + const accessToken = getAccessToken(); const params = buildPostMarkersParams(getState()); - if (Object.keys(params).length === 0 || !accessToken) { + if ( + Object.keys(params).length === 0 || + !accessToken || + accessToken === '' + ) { return; } @@ -96,14 +101,14 @@ export const submitMarkersAction = createAppAsyncThunk<{ home: string | undefined; notifications: string | undefined; }>('markers/submitAction', async (_args, { getState }) => { - const accessToken = authorizationTokenFromState(getState); + const accessToken = getAccessToken(); const params = buildPostMarkersParams(getState()); - if (Object.keys(params).length === 0 || accessToken === '') { + if (Object.keys(params).length === 0 || !accessToken || accessToken === '') { return { home: undefined, notifications: undefined }; } - await api(getState).post('/api/v1/markers', params); + await api().post('/api/v1/markers', params); return { home: params.home?.last_read_id, @@ -133,14 +138,11 @@ export const submitMarkers = createAppAsyncThunk( }, ); -export const fetchMarkers = createAppAsyncThunk( - 'markers/fetch', - async (_args, { getState }) => { - const response = await api(getState).get>( - `/api/v1/markers`, - { params: { timeline: ['notifications'] } }, - ); +export const fetchMarkers = createAppAsyncThunk('markers/fetch', async () => { + const response = await api().get>( + `/api/v1/markers`, + { params: { timeline: ['notifications'] } }, + ); - return { markers: response.data }; - }, -); + return { markers: response.data }; +}); diff --git a/app/javascript/mastodon/actions/mutes.js b/app/javascript/mastodon/actions/mutes.js index 99c113f4147302..3676748cf3fe77 100644 --- a/app/javascript/mastodon/actions/mutes.js +++ b/app/javascript/mastodon/actions/mutes.js @@ -13,10 +13,10 @@ export const MUTES_EXPAND_SUCCESS = 'MUTES_EXPAND_SUCCESS'; export const MUTES_EXPAND_FAIL = 'MUTES_EXPAND_FAIL'; export function fetchMutes() { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchMutesRequest()); - api(getState).get('/api/v1/mutes').then(response => { + api().get('/api/v1/mutes').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(fetchMutesSuccess(response.data, next ? next.uri : null)); @@ -56,7 +56,7 @@ export function expandMutes() { dispatch(expandMutesRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data)); dispatch(expandMutesSuccess(response.data, next ? next.uri : null)); diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index c8b1178d771dc2..9cb47636999e31 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -233,7 +233,7 @@ export function expandNotifications({ maxId, forceLoad } = {}, done = noOp) { dispatch(expandNotificationsRequest(isLoadingMore)); - api(getState).get('/api/v1/notifications', { params, signal: expandNotificationsController.signal }).then(response => { + api().get('/api/v1/notifications', { params, signal: expandNotificationsController.signal }).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data.map(item => item.account))); @@ -279,12 +279,12 @@ export function expandNotificationsFail(error, isLoadingMore) { } export function clearNotifications() { - return (dispatch, getState) => { + return (dispatch) => { dispatch({ type: NOTIFICATIONS_CLEAR, }); - api(getState).post('/api/v1/notifications/clear'); + api().post('/api/v1/notifications/clear'); }; } @@ -363,10 +363,10 @@ export function setBrowserPermission (value) { }; } -export const fetchNotificationPolicy = () => (dispatch, getState) => { +export const fetchNotificationPolicy = () => (dispatch) => { dispatch(fetchNotificationPolicyRequest()); - api(getState).get('/api/v1/notifications/policy').then(({ data }) => { + api().get('/api/v1/notifications/policy').then(({ data }) => { dispatch(fetchNotificationPolicySuccess(data)); }).catch(err => { dispatch(fetchNotificationPolicyFail(err)); @@ -387,10 +387,10 @@ export const fetchNotificationPolicyFail = error => ({ error, }); -export const updateNotificationsPolicy = params => (dispatch, getState) => { +export const updateNotificationsPolicy = params => (dispatch) => { dispatch(fetchNotificationPolicyRequest()); - api(getState).put('/api/v1/notifications/policy', params).then(({ data }) => { + api().put('/api/v1/notifications/policy', params).then(({ data }) => { dispatch(fetchNotificationPolicySuccess(data)); }).catch(err => { dispatch(fetchNotificationPolicyFail(err)); @@ -410,7 +410,7 @@ export const fetchNotificationRequests = () => (dispatch, getState) => { dispatch(fetchNotificationRequestsRequest()); - api(getState).get('/api/v1/notifications/requests', { params }).then(response => { + api().get('/api/v1/notifications/requests', { params }).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data.map(x => x.account))); dispatch(fetchNotificationRequestsSuccess(response.data, next ? next.uri : null)); @@ -443,7 +443,7 @@ export const expandNotificationRequests = () => (dispatch, getState) => { dispatch(expandNotificationRequestsRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedAccounts(response.data.map(x => x.account))); dispatch(expandNotificationRequestsSuccess(response.data, next?.uri)); @@ -476,7 +476,7 @@ export const fetchNotificationRequest = id => (dispatch, getState) => { dispatch(fetchNotificationRequestRequest(id)); - api(getState).get(`/api/v1/notifications/requests/${id}`).then(({ data }) => { + api().get(`/api/v1/notifications/requests/${id}`).then(({ data }) => { dispatch(fetchNotificationRequestSuccess(data)); }).catch(err => { dispatch(fetchNotificationRequestFail(id, err)); @@ -499,10 +499,10 @@ export const fetchNotificationRequestFail = (id, error) => ({ error, }); -export const acceptNotificationRequest = id => (dispatch, getState) => { +export const acceptNotificationRequest = id => (dispatch) => { dispatch(acceptNotificationRequestRequest(id)); - api(getState).post(`/api/v1/notifications/requests/${id}/accept`).then(() => { + api().post(`/api/v1/notifications/requests/${id}/accept`).then(() => { dispatch(acceptNotificationRequestSuccess(id)); }).catch(err => { dispatch(acceptNotificationRequestFail(id, err)); @@ -525,10 +525,10 @@ export const acceptNotificationRequestFail = (id, error) => ({ error, }); -export const dismissNotificationRequest = id => (dispatch, getState) => { +export const dismissNotificationRequest = id => (dispatch) => { dispatch(dismissNotificationRequestRequest(id)); - api(getState).post(`/api/v1/notifications/requests/${id}/dismiss`).then(() =>{ + api().post(`/api/v1/notifications/requests/${id}/dismiss`).then(() =>{ dispatch(dismissNotificationRequestSuccess(id)); }).catch(err => { dispatch(dismissNotificationRequestFail(id, err)); @@ -567,7 +567,7 @@ export const fetchNotificationsForRequest = accountId => (dispatch, getState) => dispatch(fetchNotificationsForRequestRequest()); - api(getState).get('/api/v1/notifications', { params }).then(response => { + api().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))); @@ -603,7 +603,7 @@ export const expandNotificationsForRequest = () => (dispatch, getState) => { dispatch(expandNotificationsForRequestRequest()); - api(getState).get(url).then(response => { + api().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))); diff --git a/app/javascript/mastodon/actions/pin_statuses.js b/app/javascript/mastodon/actions/pin_statuses.js index baa10d15627d66..d583eab5735a9e 100644 --- a/app/javascript/mastodon/actions/pin_statuses.js +++ b/app/javascript/mastodon/actions/pin_statuses.js @@ -8,10 +8,10 @@ export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS'; export const PINNED_STATUSES_FETCH_FAIL = 'PINNED_STATUSES_FETCH_FAIL'; export function fetchPinnedStatuses() { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchPinnedStatusesRequest()); - api(getState).get(`/api/v1/accounts/${me}/statuses`, { params: { pinned: true } }).then(response => { + api().get(`/api/v1/accounts/${me}/statuses`, { params: { pinned: true } }).then(response => { dispatch(importFetchedStatuses(response.data)); dispatch(fetchPinnedStatusesSuccess(response.data, null)); }).catch(error => { diff --git a/app/javascript/mastodon/actions/polls.js b/app/javascript/mastodon/actions/polls.js index a37410dc90fa4d..aa49341444c7bc 100644 --- a/app/javascript/mastodon/actions/polls.js +++ b/app/javascript/mastodon/actions/polls.js @@ -10,10 +10,10 @@ export const POLL_FETCH_REQUEST = 'POLL_FETCH_REQUEST'; export const POLL_FETCH_SUCCESS = 'POLL_FETCH_SUCCESS'; export const POLL_FETCH_FAIL = 'POLL_FETCH_FAIL'; -export const vote = (pollId, choices) => (dispatch, getState) => { +export const vote = (pollId, choices) => (dispatch) => { dispatch(voteRequest()); - api(getState).post(`/api/v1/polls/${pollId}/votes`, { choices }) + api().post(`/api/v1/polls/${pollId}/votes`, { choices }) .then(({ data }) => { dispatch(importFetchedPoll(data)); dispatch(voteSuccess(data)); @@ -21,10 +21,10 @@ export const vote = (pollId, choices) => (dispatch, getState) => { .catch(err => dispatch(voteFail(err))); }; -export const fetchPoll = pollId => (dispatch, getState) => { +export const fetchPoll = pollId => (dispatch) => { dispatch(fetchPollRequest()); - api(getState).get(`/api/v1/polls/${pollId}`) + api().get(`/api/v1/polls/${pollId}`) .then(({ data }) => { dispatch(importFetchedPoll(data)); dispatch(fetchPollSuccess(data)); diff --git a/app/javascript/mastodon/actions/reports.js b/app/javascript/mastodon/actions/reports.js index 756b8cd05e1648..49b89b0d131bf2 100644 --- a/app/javascript/mastodon/actions/reports.js +++ b/app/javascript/mastodon/actions/reports.js @@ -15,10 +15,10 @@ export const initReport = (account, status) => dispatch => }, })); -export const submitReport = (params, onSuccess, onFail) => (dispatch, getState) => { +export const submitReport = (params, onSuccess, onFail) => (dispatch) => { dispatch(submitReportRequest()); - api(getState).post('/api/v1/reports', params).then(response => { + api().post('/api/v1/reports', params).then(response => { dispatch(submitReportSuccess(response.data)); if (onSuccess) onSuccess(); }).catch(error => { diff --git a/app/javascript/mastodon/actions/search.js b/app/javascript/mastodon/actions/search.js index a34a490e760d6e..bde17ae0db17a2 100644 --- a/app/javascript/mastodon/actions/search.js +++ b/app/javascript/mastodon/actions/search.js @@ -46,7 +46,7 @@ export function submitSearch(type) { dispatch(fetchSearchRequest(type)); - api(getState).get('/api/v2/search', { + api().get('/api/v2/search', { params: { q: value, resolve: signedIn, @@ -99,7 +99,7 @@ export const expandSearch = type => (dispatch, getState) => { dispatch(expandSearchRequest(type)); - api(getState).get('/api/v2/search', { + api().get('/api/v2/search', { params: { q: value, type, @@ -156,7 +156,7 @@ export const openURL = (value, history, onFailure) => (dispatch, getState) => { dispatch(fetchSearchRequest()); - api(getState).get('/api/v2/search', { params: { q: value, resolve: true } }).then(response => { + api().get('/api/v2/search', { params: { q: value, resolve: true } }).then(response => { if (response.data.accounts?.length > 0) { dispatch(importFetchedAccounts(response.data.accounts)); history.push(`/@${response.data.accounts[0].acct}`); diff --git a/app/javascript/mastodon/actions/server.js b/app/javascript/mastodon/actions/server.js index 65f3efc3a72a3d..32ee093afa8423 100644 --- a/app/javascript/mastodon/actions/server.js +++ b/app/javascript/mastodon/actions/server.js @@ -25,7 +25,7 @@ export const fetchServer = () => (dispatch, getState) => { dispatch(fetchServerRequest()); - api(getState) + api() .get('/api/v2/instance').then(({ data }) => { if (data.contact.account) dispatch(importFetchedAccount(data.contact.account)); dispatch(fetchServerSuccess(data)); @@ -46,10 +46,10 @@ const fetchServerFail = error => ({ error, }); -export const fetchServerTranslationLanguages = () => (dispatch, getState) => { +export const fetchServerTranslationLanguages = () => (dispatch) => { dispatch(fetchServerTranslationLanguagesRequest()); - api(getState) + api() .get('/api/v1/instance/translation_languages').then(({ data }) => { dispatch(fetchServerTranslationLanguagesSuccess(data)); }).catch(err => dispatch(fetchServerTranslationLanguagesFail(err))); @@ -76,7 +76,7 @@ export const fetchExtendedDescription = () => (dispatch, getState) => { dispatch(fetchExtendedDescriptionRequest()); - api(getState) + api() .get('/api/v1/instance/extended_description') .then(({ data }) => dispatch(fetchExtendedDescriptionSuccess(data))) .catch(err => dispatch(fetchExtendedDescriptionFail(err))); @@ -103,7 +103,7 @@ export const fetchDomainBlocks = () => (dispatch, getState) => { dispatch(fetchDomainBlocksRequest()); - api(getState) + api() .get('/api/v1/instance/domain_blocks') .then(({ data }) => dispatch(fetchDomainBlocksSuccess(true, data))) .catch(err => { diff --git a/app/javascript/mastodon/actions/statuses.js b/app/javascript/mastodon/actions/statuses.js index 9807e6f67c22ca..ec07f2295784ad 100644 --- a/app/javascript/mastodon/actions/statuses.js +++ b/app/javascript/mastodon/actions/statuses.js @@ -61,7 +61,7 @@ export function fetchStatus(id, forceFetch = false) { dispatch(fetchStatusRequest(id, skipLoading)); - api(getState).get(`/api/v1/statuses/${id}`).then(response => { + api().get(`/api/v1/statuses/${id}`).then(response => { dispatch(importFetchedStatus(response.data)); dispatch(fetchStatusSuccess(skipLoading)); }).catch(error => { @@ -104,7 +104,7 @@ export const editStatus = (id, routerHistory) => (dispatch, getState) => { dispatch(fetchStatusSourceRequest()); - api(getState).get(`/api/v1/statuses/${id}/source`).then(response => { + api().get(`/api/v1/statuses/${id}/source`).then(response => { dispatch(fetchStatusSourceSuccess()); ensureComposeIsVisible(getState, routerHistory); dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text)); @@ -136,7 +136,7 @@ export function deleteStatus(id, routerHistory, withRedraft = false) { dispatch(deleteStatusRequest(id)); - api(getState).delete(`/api/v1/statuses/${id}`).then(response => { + api().delete(`/api/v1/statuses/${id}`).then(response => { dispatch(deleteStatusSuccess(id)); dispatch(deleteFromTimelines(id)); dispatch(importFetchedAccount(response.data.account)); @@ -177,10 +177,10 @@ export const updateStatus = status => dispatch => dispatch(importFetchedStatus(status)); export function fetchContext(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchContextRequest(id)); - api(getState).get(`/api/v1/statuses/${id}/context?with_reference=1`).then(response => { + api().get(`/api/v1/statuses/${id}/context?with_reference=1`).then(response => { dispatch(importFetchedStatuses(response.data.ancestors.concat(response.data.descendants).concat(response.data.references))); dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants, response.data.references)); @@ -222,10 +222,10 @@ export function fetchContextFail(id, error) { } export function muteStatus(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(muteStatusRequest(id)); - api(getState).post(`/api/v1/statuses/${id}/mute`).then(() => { + api().post(`/api/v1/statuses/${id}/mute`).then(() => { dispatch(muteStatusSuccess(id)); }).catch(error => { dispatch(muteStatusFail(id, error)); @@ -256,10 +256,10 @@ export function muteStatusFail(id, error) { } export function unmuteStatus(id) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(unmuteStatusRequest(id)); - api(getState).post(`/api/v1/statuses/${id}/unmute`).then(() => { + api().post(`/api/v1/statuses/${id}/unmute`).then(() => { dispatch(unmuteStatusSuccess(id)); }).catch(error => { dispatch(unmuteStatusFail(id, error)); @@ -319,10 +319,10 @@ export function toggleStatusCollapse(id, isCollapsed) { }; } -export const translateStatus = id => (dispatch, getState) => { +export const translateStatus = id => (dispatch) => { dispatch(translateStatusRequest(id)); - api(getState).post(`/api/v1/statuses/${id}/translate`).then(response => { + api().post(`/api/v1/statuses/${id}/translate`).then(response => { dispatch(translateStatusSuccess(id, response.data)); }).catch(error => { dispatch(translateStatusFail(id, error)); diff --git a/app/javascript/mastodon/actions/suggestions.js b/app/javascript/mastodon/actions/suggestions.js index 8eafe38b21ae0e..258ffa901de5d1 100644 --- a/app/javascript/mastodon/actions/suggestions.js +++ b/app/javascript/mastodon/actions/suggestions.js @@ -10,10 +10,10 @@ export const SUGGESTIONS_FETCH_FAIL = 'SUGGESTIONS_FETCH_FAIL'; export const SUGGESTIONS_DISMISS = 'SUGGESTIONS_DISMISS'; export function fetchSuggestions(withRelationships = false) { - return (dispatch, getState) => { + return (dispatch) => { dispatch(fetchSuggestionsRequest()); - api(getState).get('/api/v2/suggestions', { params: { limit: 20 } }).then(response => { + api().get('/api/v2/suggestions', { params: { limit: 20 } }).then(response => { dispatch(importFetchedAccounts(response.data.map(x => x.account))); dispatch(fetchSuggestionsSuccess(response.data)); @@ -48,11 +48,11 @@ export function fetchSuggestionsFail(error) { }; } -export const dismissSuggestion = accountId => (dispatch, getState) => { +export const dismissSuggestion = accountId => (dispatch) => { dispatch({ type: SUGGESTIONS_DISMISS, id: accountId, }); - api(getState).delete(`/api/v1/suggestions/${accountId}`).catch(() => {}); + api().delete(`/api/v1/suggestions/${accountId}`).catch(() => {}); }; diff --git a/app/javascript/mastodon/actions/tags.js b/app/javascript/mastodon/actions/tags.js index dda8c924bb59a4..d18d7e514fc8f2 100644 --- a/app/javascript/mastodon/actions/tags.js +++ b/app/javascript/mastodon/actions/tags.js @@ -20,10 +20,10 @@ export const HASHTAG_UNFOLLOW_REQUEST = 'HASHTAG_UNFOLLOW_REQUEST'; export const HASHTAG_UNFOLLOW_SUCCESS = 'HASHTAG_UNFOLLOW_SUCCESS'; export const HASHTAG_UNFOLLOW_FAIL = 'HASHTAG_UNFOLLOW_FAIL'; -export const fetchHashtag = name => (dispatch, getState) => { +export const fetchHashtag = name => (dispatch) => { dispatch(fetchHashtagRequest()); - api(getState).get(`/api/v1/tags/${name}`).then(({ data }) => { + api().get(`/api/v1/tags/${name}`).then(({ data }) => { dispatch(fetchHashtagSuccess(name, data)); }).catch(err => { dispatch(fetchHashtagFail(err)); @@ -45,10 +45,10 @@ export const fetchHashtagFail = error => ({ error, }); -export const fetchFollowedHashtags = () => (dispatch, getState) => { +export const fetchFollowedHashtags = () => (dispatch) => { dispatch(fetchFollowedHashtagsRequest()); - api(getState).get('/api/v1/followed_tags').then(response => { + api().get('/api/v1/followed_tags').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(fetchFollowedHashtagsSuccess(response.data, next ? next.uri : null)); }).catch(err => { @@ -87,7 +87,7 @@ export function expandFollowedHashtags() { dispatch(expandFollowedHashtagsRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(expandFollowedHashtagsSuccess(response.data, next ? next.uri : null)); }).catch(error => { @@ -117,10 +117,10 @@ export function expandFollowedHashtagsFail(error) { }; } -export const followHashtag = name => (dispatch, getState) => { +export const followHashtag = name => (dispatch) => { dispatch(followHashtagRequest(name)); - api(getState).post(`/api/v1/tags/${name}/follow`).then(({ data }) => { + api().post(`/api/v1/tags/${name}/follow`).then(({ data }) => { dispatch(followHashtagSuccess(name, data)); }).catch(err => { dispatch(followHashtagFail(name, err)); @@ -144,10 +144,10 @@ export const followHashtagFail = (name, error) => ({ error, }); -export const unfollowHashtag = name => (dispatch, getState) => { +export const unfollowHashtag = name => (dispatch) => { dispatch(unfollowHashtagRequest(name)); - api(getState).post(`/api/v1/tags/${name}/unfollow`).then(({ data }) => { + api().post(`/api/v1/tags/${name}/unfollow`).then(({ data }) => { dispatch(unfollowHashtagSuccess(name, data)); }).catch(err => { dispatch(unfollowHashtagFail(name, err)); diff --git a/app/javascript/mastodon/actions/timelines.js b/app/javascript/mastodon/actions/timelines.js index 786eb7e4b32c1f..d67a917e3f686d 100644 --- a/app/javascript/mastodon/actions/timelines.js +++ b/app/javascript/mastodon/actions/timelines.js @@ -114,7 +114,7 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) { dispatch(expandTimelineRequest(timelineId, isLoadingMore)); - api(getState).get(path, { params }).then(response => { + api().get(path, { params }).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); diff --git a/app/javascript/mastodon/actions/trends.js b/app/javascript/mastodon/actions/trends.js index d314423884efe1..0b840b41ce6085 100644 --- a/app/javascript/mastodon/actions/trends.js +++ b/app/javascript/mastodon/actions/trends.js @@ -18,10 +18,10 @@ export const TRENDS_STATUSES_EXPAND_REQUEST = 'TRENDS_STATUSES_EXPAND_REQUEST'; export const TRENDS_STATUSES_EXPAND_SUCCESS = 'TRENDS_STATUSES_EXPAND_SUCCESS'; export const TRENDS_STATUSES_EXPAND_FAIL = 'TRENDS_STATUSES_EXPAND_FAIL'; -export const fetchTrendingHashtags = () => (dispatch, getState) => { +export const fetchTrendingHashtags = () => (dispatch) => { dispatch(fetchTrendingHashtagsRequest()); - api(getState) + api() .get('/api/v1/trends/tags') .then(({ data }) => dispatch(fetchTrendingHashtagsSuccess(data))) .catch(err => dispatch(fetchTrendingHashtagsFail(err))); @@ -45,10 +45,10 @@ export const fetchTrendingHashtagsFail = error => ({ skipAlert: true, }); -export const fetchTrendingLinks = () => (dispatch, getState) => { +export const fetchTrendingLinks = () => (dispatch) => { dispatch(fetchTrendingLinksRequest()); - api(getState) + api() .get('/api/v1/trends/links') .then(({ data }) => dispatch(fetchTrendingLinksSuccess(data))) .catch(err => dispatch(fetchTrendingLinksFail(err))); @@ -79,7 +79,7 @@ export const fetchTrendingStatuses = () => (dispatch, getState) => { dispatch(fetchTrendingStatusesRequest()); - api(getState).get('/api/v1/trends/statuses').then(response => { + api().get('/api/v1/trends/statuses').then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); dispatch(fetchTrendingStatusesSuccess(response.data, next ? next.uri : null)); @@ -115,7 +115,7 @@ export const expandTrendingStatuses = () => (dispatch, getState) => { dispatch(expandTrendingStatusesRequest()); - api(getState).get(url).then(response => { + api().get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); dispatch(expandTrendingStatusesSuccess(response.data, next ? next.uri : null)); diff --git a/app/javascript/mastodon/api.ts b/app/javascript/mastodon/api.ts index de597a3e3b62f5..e133125a29cf33 100644 --- a/app/javascript/mastodon/api.ts +++ b/app/javascript/mastodon/api.ts @@ -1,9 +1,9 @@ -import type { AxiosResponse, RawAxiosRequestHeaders } from 'axios'; +import type { AxiosResponse, Method, RawAxiosRequestHeaders } from 'axios'; import axios from 'axios'; import LinkHeader from 'http-link-header'; +import { getAccessToken } from './initial_state'; import ready from './ready'; -import type { GetState } from './store'; export const getLinks = (response: AxiosResponse) => { const value = response.headers.link as string | undefined; @@ -29,30 +29,22 @@ const setCSRFHeader = () => { void ready(setCSRFHeader); -export const authorizationTokenFromState = (getState?: GetState) => { - return ( - getState && (getState().meta.get('access_token', '') as string | false) - ); -}; +const authorizationTokenFromInitialState = (): RawAxiosRequestHeaders => { + const accessToken = getAccessToken(); -const authorizationHeaderFromState = (getState?: GetState) => { - const accessToken = authorizationTokenFromState(getState); - - if (!accessToken) { - return {}; - } + if (!accessToken) return {}; return { Authorization: `Bearer ${accessToken}`, - } as RawAxiosRequestHeaders; + }; }; // eslint-disable-next-line import/no-default-export -export default function api(getState: GetState) { +export default function api(withAuthorization = true) { return axios.create({ headers: { ...csrfHeader, - ...authorizationHeaderFromState(getState), + ...(withAuthorization ? authorizationTokenFromInitialState() : {}), }, transformResponse: [ @@ -66,3 +58,17 @@ export default function api(getState: GetState) { ], }); } + +export async function apiRequest( + method: Method, + url: string, + params?: Record, +) { + const { data } = await api().request({ + method, + url: '/api/' + url, + data: params, + }); + + return data; +} diff --git a/app/javascript/mastodon/api/accounts.ts b/app/javascript/mastodon/api/accounts.ts new file mode 100644 index 00000000000000..3d89e44b2673d3 --- /dev/null +++ b/app/javascript/mastodon/api/accounts.ts @@ -0,0 +1,7 @@ +import { apiRequest } from 'mastodon/api'; +import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships'; + +export const apiSubmitAccountNote = (id: string, value: string) => + apiRequest('post', `v1/accounts/${id}/note`, { + comment: value, + }); diff --git a/app/javascript/mastodon/api/interactions.ts b/app/javascript/mastodon/api/interactions.ts new file mode 100644 index 00000000000000..4c466a1b46d90b --- /dev/null +++ b/app/javascript/mastodon/api/interactions.ts @@ -0,0 +1,10 @@ +import { apiRequest } from 'mastodon/api'; +import type { Status, StatusVisibility } from 'mastodon/models/status'; + +export const apiReblog = (statusId: string, visibility: StatusVisibility) => + apiRequest<{ reblog: Status }>('post', `v1/statuses/${statusId}/reblog`, { + visibility, + }); + +export const apiUnreblog = (statusId: string) => + apiRequest('post', `v1/statuses/${statusId}/unreblog`); diff --git a/app/javascript/mastodon/components/admin/Counter.jsx b/app/javascript/mastodon/components/admin/Counter.jsx index 9fd9ab9cd3bd2d..e3f5cc6aead617 100644 --- a/app/javascript/mastodon/components/admin/Counter.jsx +++ b/app/javascript/mastodon/components/admin/Counter.jsx @@ -49,7 +49,7 @@ export default class Counter extends PureComponent { componentDidMount () { const { measure, start_at, end_at, params } = this.props; - api().post('/api/v1/admin/measures', { keys: [measure], start_at, end_at, [measure]: params }).then(res => { + api(false).post('/api/v1/admin/measures', { keys: [measure], start_at, end_at, [measure]: params }).then(res => { this.setState({ loading: false, data: res.data, diff --git a/app/javascript/mastodon/components/admin/Dimension.jsx b/app/javascript/mastodon/components/admin/Dimension.jsx index 1ba68fd1697028..5ed91bede09d24 100644 --- a/app/javascript/mastodon/components/admin/Dimension.jsx +++ b/app/javascript/mastodon/components/admin/Dimension.jsx @@ -27,7 +27,7 @@ export default class Dimension extends PureComponent { componentDidMount () { const { start_at, end_at, dimension, limit, params } = this.props; - api().post('/api/v1/admin/dimensions', { keys: [dimension], start_at, end_at, limit, [dimension]: params }).then(res => { + api(false).post('/api/v1/admin/dimensions', { keys: [dimension], start_at, end_at, limit, [dimension]: params }).then(res => { this.setState({ loading: false, data: res.data, diff --git a/app/javascript/mastodon/components/admin/ImpactReport.jsx b/app/javascript/mastodon/components/admin/ImpactReport.jsx index c27ee0ab08102f..add54134b6fe92 100644 --- a/app/javascript/mastodon/components/admin/ImpactReport.jsx +++ b/app/javascript/mastodon/components/admin/ImpactReport.jsx @@ -27,7 +27,7 @@ export default class ImpactReport extends PureComponent { include_subdomains: true, }; - api().post('/api/v1/admin/measures', { + api(false).post('/api/v1/admin/measures', { keys: ['instance_accounts', 'instance_follows', 'instance_followers'], start_at: null, end_at: null, diff --git a/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx b/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx index 90f4334a6e1ad2..cc05e5c163c320 100644 --- a/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx +++ b/app/javascript/mastodon/components/admin/ReportReasonSelector.jsx @@ -105,7 +105,7 @@ class ReportReasonSelector extends PureComponent { }; componentDidMount() { - api().get('/api/v1/instance').then(res => { + api(false).get('/api/v1/instance').then(res => { this.setState({ rules: res.data.rules, }); @@ -122,7 +122,7 @@ class ReportReasonSelector extends PureComponent { return; } - api().put(`/api/v1/admin/reports/${id}`, { + api(false).put(`/api/v1/admin/reports/${id}`, { category, rule_ids: category === 'violation' ? rule_ids : [], }).catch(err => { diff --git a/app/javascript/mastodon/components/admin/Retention.jsx b/app/javascript/mastodon/components/admin/Retention.jsx index 1e8ef48b7abde3..87746e9f497bf6 100644 --- a/app/javascript/mastodon/components/admin/Retention.jsx +++ b/app/javascript/mastodon/components/admin/Retention.jsx @@ -34,7 +34,7 @@ export default class Retention extends PureComponent { componentDidMount () { const { start_at, end_at, frequency } = this.props; - api().post('/api/v1/admin/retention', { start_at, end_at, frequency }).then(res => { + api(false).post('/api/v1/admin/retention', { start_at, end_at, frequency }).then(res => { this.setState({ loading: false, data: res.data, diff --git a/app/javascript/mastodon/components/admin/Trends.jsx b/app/javascript/mastodon/components/admin/Trends.jsx index c69b4a8cbaf414..fd6db106d54183 100644 --- a/app/javascript/mastodon/components/admin/Trends.jsx +++ b/app/javascript/mastodon/components/admin/Trends.jsx @@ -22,7 +22,7 @@ export default class Trends extends PureComponent { componentDidMount () { const { limit } = this.props; - api().get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { + api(false).get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { this.setState({ loading: false, data: res.data, diff --git a/app/javascript/mastodon/components/column_header.jsx b/app/javascript/mastodon/components/column_header.jsx index a7d07ffdb07108..42183f336dbd5b 100644 --- a/app/javascript/mastodon/components/column_header.jsx +++ b/app/javascript/mastodon/components/column_header.jsx @@ -14,8 +14,10 @@ import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import SettingsIcon from '@/material-icons/400-24px/settings.svg?react'; import { Icon } from 'mastodon/components/icon'; import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; + import { useAppHistory } from './router'; const messages = defineMessages({ @@ -51,12 +53,8 @@ BackButton.propTypes = { }; class ColumnHeader extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, intl: PropTypes.object.isRequired, title: PropTypes.node, icon: PropTypes.string, @@ -171,7 +169,7 @@ class ColumnHeader extends PureComponent { ); } - if (this.context.identity.signedIn && (children || (multiColumn && this.props.onPin))) { + if (this.props.identity.signedIn && (children || (multiColumn && this.props.onPin))) { collapseButton = ( } + {!showResults && } {!showResults && <> · } {showResults && !this.props.disabled && <> · } {votesCount} @@ -247,4 +244,4 @@ class Poll extends ImmutablePureComponent { } -export default injectIntl(Poll); +export default injectIntl(withIdentity(Poll)); diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index c2be106293b64c..597bd030692fab 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -23,6 +23,7 @@ import RepeatActiveIcon from '@/svg-icons/repeat_active.svg?react'; import RepeatDisabledIcon from '@/svg-icons/repeat_disabled.svg?react'; import RepeatPrivateIcon from '@/svg-icons/repeat_private.svg?react'; import RepeatPrivateActiveIcon from '@/svg-icons/repeat_private_active.svg?react'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -85,12 +86,8 @@ const mapStateToProps = (state, { status }) => ({ }); class StatusActionBar extends ImmutablePureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, status: ImmutablePropTypes.map.isRequired, relationship: ImmutablePropTypes.record, onReply: PropTypes.func, @@ -134,7 +131,7 @@ class StatusActionBar extends ImmutablePureComponent { ]; handleReplyClick = () => { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { this.props.onReply(this.props.status, this.props.history); @@ -152,7 +149,7 @@ class StatusActionBar extends ImmutablePureComponent { }; handleFavouriteClick = () => { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { this.props.onFavourite(this.props.status); @@ -174,7 +171,7 @@ class StatusActionBar extends ImmutablePureComponent { handleEmojiPickInnerButton = () => {}; handleReblogClick = e => { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { this.props.onReblog(this.props.status, e); @@ -306,7 +303,7 @@ class StatusActionBar extends ImmutablePureComponent { render () { const { status, relationship, intl, withDismiss, withCounters, scrollKey } = this.props; - const { signedIn, permissions } = this.context.identity; + const { signedIn, permissions } = this.props.identity; const publicStatus = ['public', 'unlisted', 'public_unlisted', 'login'].includes(status.get('visibility_ex')); const anonymousStatus = ['public', 'unlisted', 'public_unlisted'].includes(status.get('visibility_ex')); @@ -546,4 +543,4 @@ class StatusActionBar extends ImmutablePureComponent { } -export default withRouter(connect(mapStateToProps)(injectIntl(StatusActionBar))); +export default withRouter(withIdentity(connect(mapStateToProps)(injectIntl(StatusActionBar)))); diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx index 762208600be4dd..5df74d0b34e639 100644 --- a/app/javascript/mastodon/components/status_content.jsx +++ b/app/javascript/mastodon/components/status_content.jsx @@ -12,8 +12,10 @@ import { connect } from 'react-redux'; import ChevronRightIcon from '@/material-icons/400-24px/chevron_right.svg?react'; import { Icon } from 'mastodon/components/icon'; import PollContainer from 'mastodon/containers/poll_container'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { autoPlayGif, languages as preloadedLanguages } from 'mastodon/initial_state'; + const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top) /** @@ -67,12 +69,8 @@ const mapStateToProps = state => ({ }); class StatusContent extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, status: ImmutablePropTypes.map.isRequired, statusContent: PropTypes.string, expanded: PropTypes.bool, @@ -246,7 +244,7 @@ class StatusContent extends PureComponent { const contentLocale = intl.locale.replace(/[_-].*/, ''); const targetLanguages = this.props.languages?.get(status.get('language') || 'und'); const renderTranslate = this.props.onTranslate && - this.context.identity.signedIn && + this.props.identity.signedIn && (['public', 'unlisted'].includes(status.get('visibility')) || status.getIn(['account', 'other_settings', 'translatable_private'])) && status.get('search_index').trim().length > 0 && status.get('language') && @@ -333,4 +331,4 @@ class StatusContent extends PureComponent { } -export default withRouter(connect(mapStateToProps)(injectIntl(StatusContent))); +export default withRouter(withIdentity(connect(mapStateToProps)(injectIntl(StatusContent)))); diff --git a/app/javascript/mastodon/containers/mastodon.jsx b/app/javascript/mastodon/containers/mastodon.jsx index 9cf21cfa09b1a9..d7ab46b54e84d3 100644 --- a/app/javascript/mastodon/containers/mastodon.jsx +++ b/app/javascript/mastodon/containers/mastodon.jsx @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { Helmet } from 'react-helmet'; @@ -16,6 +15,7 @@ import { connectUserStream } from 'mastodon/actions/streaming'; import ErrorBoundary from 'mastodon/components/error_boundary'; import { Router } from 'mastodon/components/router'; import UI from 'mastodon/features/ui'; +import { IdentityContext, createIdentityContext } from 'mastodon/identity_context'; import initialState, { title as siteTitle } from 'mastodon/initial_state'; import { IntlProvider } from 'mastodon/locales'; import { store } from 'mastodon/store'; @@ -32,33 +32,9 @@ if (initialState.meta.me) { store.dispatch(fetchCircles()); } -const createIdentityContext = state => ({ - signedIn: !!state.meta.me, - accountId: state.meta.me, - disabledAccountId: state.meta.disabled_account_id, - accessToken: state.meta.access_token, - permissions: state.role ? state.role.permissions : 0, -}); - export default class Mastodon extends PureComponent { - - static childContextTypes = { - identity: PropTypes.shape({ - signedIn: PropTypes.bool.isRequired, - accountId: PropTypes.string, - disabledAccountId: PropTypes.string, - accessToken: PropTypes.string, - }).isRequired, - }; - identity = createIdentityContext(initialState); - getChildContext() { - return { - identity: this.identity, - }; - } - componentDidMount() { if (this.identity.signedIn) { this.disconnect = store.dispatch(connectUserStream()); @@ -78,19 +54,21 @@ export default class Mastodon extends PureComponent { render () { return ( - - - - - - - - - - - - - + + + + + + + + + + + + + + + ); } diff --git a/app/javascript/mastodon/containers/status_container.jsx b/app/javascript/mastodon/containers/status_container.jsx index dee58bc16493ff..1ed546a57bf43b 100644 --- a/app/javascript/mastodon/containers/status_container.jsx +++ b/app/javascript/mastodon/containers/status_container.jsx @@ -101,9 +101,9 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({ onModalReblog (status, privacy) { if (status.get('reblogged')) { - dispatch(unreblog(status)); + dispatch(unreblog({ statusId: status.get('id') })); } else { - dispatch(reblog(status, privacy)); + dispatch(reblog({ statusId: status.get('id'), visibility: privacy })); } }, diff --git a/app/javascript/mastodon/features/account/components/header.jsx b/app/javascript/mastodon/features/account/components/header.jsx index 1f96a8ec40378f..b0b19861cf6d0f 100644 --- a/app/javascript/mastodon/features/account/components/header.jsx +++ b/app/javascript/mastodon/features/account/components/header.jsx @@ -26,6 +26,7 @@ import { IconButton } from 'mastodon/components/icon_button'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import { ShortNumber } from 'mastodon/components/short_number'; import DropdownMenuContainer from 'mastodon/containers/dropdown_menu_container'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { autoPlayGif, me, domain as localDomain, isShowItem } from 'mastodon/initial_state'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -115,6 +116,7 @@ const dateFormatOptions = { class Header extends ImmutablePureComponent { static propTypes = { + identity: identityContextPropShape, account: ImmutablePropTypes.record, featuredTags: PropTypes.array, identity_props: ImmutablePropTypes.list, @@ -144,10 +146,6 @@ class Header extends ImmutablePureComponent { ...WithRouterPropTypes, }; - static contextTypes = { - identity: PropTypes.object, - }; - setRef = c => { this.node = c; }; @@ -277,7 +275,7 @@ class Header extends ImmutablePureComponent { render () { const { account, hidden, intl } = this.props; - const { signedIn, permissions } = this.context.identity; + const { signedIn, permissions } = this.props.identity; if (!account) { return null; @@ -554,4 +552,4 @@ class Header extends ImmutablePureComponent { } -export default withRouter(injectIntl(Header)); +export default withRouter(withIdentity(injectIntl(Header))); diff --git a/app/javascript/mastodon/features/account/containers/account_note_container.js b/app/javascript/mastodon/features/account/containers/account_note_container.js index 20304a4524346c..1530242d694992 100644 --- a/app/javascript/mastodon/features/account/containers/account_note_container.js +++ b/app/javascript/mastodon/features/account/containers/account_note_container.js @@ -11,7 +11,7 @@ const mapStateToProps = (state, { account }) => ({ const mapDispatchToProps = (dispatch, { account }) => ({ onSave (value) { - dispatch(submitAccountNote({ id: account.get('id'), value})); + dispatch(submitAccountNote({ accountId: account.get('id'), note: value })); }, }); diff --git a/app/javascript/mastodon/features/community_timeline/index.jsx b/app/javascript/mastodon/features/community_timeline/index.jsx index 0aa1f9aa23a22a..5652ea5327980c 100644 --- a/app/javascript/mastodon/features/community_timeline/index.jsx +++ b/app/javascript/mastodon/features/community_timeline/index.jsx @@ -9,6 +9,7 @@ import { connect } from 'react-redux'; import PeopleIcon from '@/material-icons/400-24px/group.svg?react'; import { DismissableBanner } from 'mastodon/components/dismissable_banner'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { domain } from 'mastodon/initial_state'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; @@ -38,16 +39,12 @@ const mapStateToProps = (state, { columnId }) => { }; class CommunityTimeline extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static defaultProps = { onlyMedia: false, }; static propTypes = { + identity: identityContextPropShape, dispatch: PropTypes.func.isRequired, columnId: PropTypes.string, intl: PropTypes.object.isRequired, @@ -77,7 +74,7 @@ class CommunityTimeline extends PureComponent { componentDidMount () { const { dispatch, onlyMedia } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; dispatch(expandCommunityTimeline({ onlyMedia })); @@ -87,7 +84,7 @@ class CommunityTimeline extends PureComponent { } componentDidUpdate (prevProps) { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (prevProps.onlyMedia !== this.props.onlyMedia) { const { dispatch, onlyMedia } = this.props; @@ -161,4 +158,4 @@ class CommunityTimeline extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(CommunityTimeline)); +export default withIdentity(connect(mapStateToProps)(injectIntl(CommunityTimeline))); diff --git a/app/javascript/mastodon/features/compose/components/search.jsx b/app/javascript/mastodon/features/compose/components/search.jsx index 7c5c39f0377922..466487a5f6a52f 100644 --- a/app/javascript/mastodon/features/compose/components/search.jsx +++ b/app/javascript/mastodon/features/compose/components/search.jsx @@ -12,6 +12,7 @@ import CancelIcon from '@/material-icons/400-24px/cancel-fill.svg?react'; import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import SearchIcon from '@/material-icons/400-24px/search.svg?react'; import { Icon } from 'mastodon/components/icon'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { domain, searchEnabled } from 'mastodon/initial_state'; import { HASHTAG_REGEX } from 'mastodon/utils/hashtags'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -33,12 +34,8 @@ const labelForRecentSearch = search => { }; class Search extends PureComponent { - - static contextTypes = { - identity: PropTypes.object.isRequired, - }; - static propTypes = { + identity: identityContextPropShape, value: PropTypes.string.isRequired, recent: ImmutablePropTypes.orderedSet, submitted: PropTypes.bool, @@ -279,7 +276,7 @@ class Search extends PureComponent { } _calculateOptions (value) { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; const trimmedValue = value.trim(); const options = []; @@ -321,7 +318,7 @@ class Search extends PureComponent { render () { const { intl, value, submitted, recent } = this.props; const { expanded, options, selectedOption } = this.state; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; const hasValue = value.length > 0 || submitted; @@ -405,4 +402,4 @@ class Search extends PureComponent { } -export default withRouter(injectIntl(Search)); +export default withRouter(withIdentity(injectIntl(Search))); diff --git a/app/javascript/mastodon/features/explore/index.jsx b/app/javascript/mastodon/features/explore/index.jsx index d77aec7013e5e9..83e5df22f85ede 100644 --- a/app/javascript/mastodon/features/explore/index.jsx +++ b/app/javascript/mastodon/features/explore/index.jsx @@ -13,6 +13,7 @@ import SearchIcon from '@/material-icons/400-24px/search.svg?react'; import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; import Search from 'mastodon/features/compose/containers/search_container'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { trendsEnabled } from 'mastodon/initial_state'; import Links from './links'; @@ -32,12 +33,8 @@ const mapStateToProps = state => ({ }); class Explore extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, isSearching: PropTypes.bool, @@ -53,7 +50,7 @@ class Explore extends PureComponent { render() { const { intl, multiColumn, isSearching } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; return ( @@ -114,4 +111,4 @@ class Explore extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(Explore)); +export default withIdentity(connect(mapStateToProps)(injectIntl(Explore))); diff --git a/app/javascript/mastodon/features/firehose/index.jsx b/app/javascript/mastodon/features/firehose/index.jsx index 85f7405ceb253f..aca088c6412ac9 100644 --- a/app/javascript/mastodon/features/firehose/index.jsx +++ b/app/javascript/mastodon/features/firehose/index.jsx @@ -6,13 +6,14 @@ import { useIntl, defineMessages, FormattedMessage } from 'react-intl'; import { Helmet } from 'react-helmet'; import { NavLink } from 'react-router-dom'; +import { useIdentity } from '@/mastodon/identity_context'; import PublicIcon from '@/material-icons/400-24px/public.svg?react'; import { addColumn } from 'mastodon/actions/columns'; import { changeSetting } from 'mastodon/actions/settings'; import { connectPublicStream, connectCommunityStream } from 'mastodon/actions/streaming'; import { expandPublicTimeline, expandCommunityTimeline } from 'mastodon/actions/timelines'; import { DismissableBanner } from 'mastodon/components/dismissable_banner'; -import initialState, { domain, enableLocalTimeline } from 'mastodon/initial_state'; +import { domain, enableLocalTimeline } from 'mastodon/initial_state'; import { useAppDispatch, useAppSelector } from 'mastodon/store'; import Column from '../../components/column'; @@ -24,15 +25,6 @@ const messages = defineMessages({ title: { id: 'column.firehose', defaultMessage: 'Live feeds' }, }); -// TODO: use a proper React context later on -const useIdentity = () => ({ - signedIn: !!initialState.meta.me, - accountId: initialState.meta.me, - disabledAccountId: initialState.meta.disabled_account_id, - accessToken: initialState.meta.access_token, - permissions: initialState.role ? initialState.role.permissions : 0, -}); - const ColumnSettings = () => { const dispatch = useAppDispatch(); const settings = useAppSelector((state) => state.getIn(['settings', 'firehose'])); diff --git a/app/javascript/mastodon/features/getting_started/index.jsx b/app/javascript/mastodon/features/getting_started/index.jsx index ac037eb40460e9..a52f53233051e7 100644 --- a/app/javascript/mastodon/features/getting_started/index.jsx +++ b/app/javascript/mastodon/features/getting_started/index.jsx @@ -26,6 +26,7 @@ import { fetchFollowRequests } from 'mastodon/actions/accounts'; import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; import LinkFooter from 'mastodon/features/ui/components/link_footer'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { dtlTag, enableDtlMenu, me, showTrends } from '../../initial_state'; import { NavigationBar } from '../compose/components/navigation_bar'; @@ -80,12 +81,8 @@ const badgeDisplay = (number, limit) => { }; class GettingStarted extends ImmutablePureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, intl: PropTypes.object.isRequired, myAccount: ImmutablePropTypes.record, multiColumn: PropTypes.bool, @@ -96,7 +93,7 @@ class GettingStarted extends ImmutablePureComponent { componentDidMount () { const { fetchFollowRequests } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (!signedIn) { return; @@ -107,7 +104,7 @@ class GettingStarted extends ImmutablePureComponent { render () { const { intl, myAccount, multiColumn, unreadFollowRequests } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; const navItems = []; @@ -183,4 +180,4 @@ class GettingStarted extends ImmutablePureComponent { } -export default connect(mapStateToProps, mapDispatchToProps)(injectIntl(GettingStarted)); +export default withIdentity(connect(mapStateToProps, mapDispatchToProps)(injectIntl(GettingStarted))); diff --git a/app/javascript/mastodon/features/hashtag_timeline/index.jsx b/app/javascript/mastodon/features/hashtag_timeline/index.jsx index f431a7e9b72130..42a668859e0f3c 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/index.jsx +++ b/app/javascript/mastodon/features/hashtag_timeline/index.jsx @@ -17,6 +17,7 @@ import { fetchHashtag, followHashtag, unfollowHashtag } from 'mastodon/actions/t import { expandHashtagTimeline, clearTimeline } from 'mastodon/actions/timelines'; import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import StatusListContainer from '../ui/containers/status_list_container'; @@ -29,14 +30,10 @@ const mapStateToProps = (state, props) => ({ }); class HashtagTimeline extends PureComponent { - disconnects = []; - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, params: PropTypes.object.isRequired, columnId: PropTypes.string, dispatch: PropTypes.func.isRequired, @@ -94,7 +91,7 @@ class HashtagTimeline extends PureComponent { }; _subscribe (dispatch, id, tags = {}, local) { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (!signedIn) { return; @@ -168,7 +165,7 @@ class HashtagTimeline extends PureComponent { handleFollow = () => { const { dispatch, params, tag } = this.props; const { id } = params; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (!signedIn) { return; @@ -185,7 +182,7 @@ class HashtagTimeline extends PureComponent { const { hasUnread, columnId, multiColumn, tag } = this.props; const { id, local } = this.props.params; const pinned = !!columnId; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; return ( @@ -225,4 +222,4 @@ class HashtagTimeline extends PureComponent { } -export default connect(mapStateToProps)(HashtagTimeline); +export default connect(mapStateToProps)(withIdentity(HashtagTimeline)); diff --git a/app/javascript/mastodon/features/home_timeline/index.jsx b/app/javascript/mastodon/features/home_timeline/index.jsx index 6e7dc2b6c8c8a7..00b5835a161e92 100644 --- a/app/javascript/mastodon/features/home_timeline/index.jsx +++ b/app/javascript/mastodon/features/home_timeline/index.jsx @@ -14,6 +14,7 @@ import { fetchAnnouncements, toggleShowAnnouncements } from 'mastodon/actions/an import { IconWithBadge } from 'mastodon/components/icon_with_badge'; import { NotSignedInIndicator } from 'mastodon/components/not_signed_in_indicator'; import AnnouncementsContainer from 'mastodon/features/getting_started/containers/announcements_container'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { criticalUpdatesPending } from 'mastodon/initial_state'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; @@ -40,12 +41,8 @@ const mapStateToProps = state => ({ }); class HomeTimeline extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, hasUnread: PropTypes.bool, @@ -126,7 +123,7 @@ class HomeTimeline extends PureComponent { render () { const { intl, hasUnread, columnId, multiColumn, hasAnnouncements, unreadAnnouncements, showAnnouncements } = this.props; const pinned = !!columnId; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; const banners = []; let announcementsButton; @@ -190,4 +187,4 @@ class HomeTimeline extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(HomeTimeline)); +export default connect(mapStateToProps)(withIdentity(injectIntl(HomeTimeline))); diff --git a/app/javascript/mastodon/features/notifications/components/column_settings.jsx b/app/javascript/mastodon/features/notifications/components/column_settings.jsx index 58ee58fe0282f0..1fd24b8f6984a2 100644 --- a/app/javascript/mastodon/features/notifications/components/column_settings.jsx +++ b/app/javascript/mastodon/features/notifications/components/column_settings.jsx @@ -5,6 +5,7 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { enableEmojiReaction } from 'mastodon/initial_state'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'mastodon/permissions'; @@ -13,13 +14,9 @@ import ClearColumnButton from './clear_column_button'; import GrantPermissionButton from './grant_permission_button'; import SettingToggle from './setting_toggle'; -export default class ColumnSettings extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - +class ColumnSettings extends PureComponent { static propTypes = { + identity: identityContextPropShape, settings: ImmutablePropTypes.map.isRequired, pushSettings: ImmutablePropTypes.map.isRequired, onChange: PropTypes.func.isRequired, @@ -258,7 +255,7 @@ export default class ColumnSettings extends PureComponent { - {((this.context.identity.permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) && ( + {((this.props.identity.permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) && (

@@ -271,7 +268,7 @@ export default class ColumnSettings extends PureComponent {
)} - {((this.context.identity.permissions & PERMISSION_MANAGE_REPORTS) === PERMISSION_MANAGE_REPORTS) && ( + {((this.props.identity.permissions & PERMISSION_MANAGE_REPORTS) === PERMISSION_MANAGE_REPORTS) && (

@@ -288,3 +285,5 @@ export default class ColumnSettings extends PureComponent { } } + +export default withIdentity(ColumnSettings); diff --git a/app/javascript/mastodon/features/notifications/containers/notification_container.js b/app/javascript/mastodon/features/notifications/containers/notification_container.js index 9cb00b55956b3c..9cb25785134c16 100644 --- a/app/javascript/mastodon/features/notifications/containers/notification_container.js +++ b/app/javascript/mastodon/features/notifications/containers/notification_container.js @@ -40,12 +40,12 @@ const mapDispatchToProps = dispatch => ({ }, onModalReblog (status, privacy) { - dispatch(reblog(status, privacy)); + dispatch(reblog({ statusId: status.get('id'), visibility: privacy })); }, onReblog (status, e) { if (status.get('reblogged')) { - dispatch(unreblog(status)); + dispatch(unreblog({ statusId: status.get('id') })); } else { if (e.shiftKey || !boostModal) { this.onModalReblog(status); diff --git a/app/javascript/mastodon/features/notifications/index.jsx b/app/javascript/mastodon/features/notifications/index.jsx index e062957ff89a19..d45f517152ea16 100644 --- a/app/javascript/mastodon/features/notifications/index.jsx +++ b/app/javascript/mastodon/features/notifications/index.jsx @@ -17,6 +17,7 @@ import NotificationsIcon from '@/material-icons/400-24px/notifications-fill.svg? import { compareId } from 'mastodon/compare_id'; import { Icon } from 'mastodon/components/icon'; import { NotSignedInIndicator } from 'mastodon/components/not_signed_in_indicator'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; import { submitMarkers } from '../../actions/markers'; @@ -77,12 +78,8 @@ const mapStateToProps = state => ({ }); class Notifications extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, columnId: PropTypes.string, notifications: ImmutablePropTypes.list.isRequired, dispatch: PropTypes.func.isRequired, @@ -190,7 +187,7 @@ class Notifications extends PureComponent { const { intl, notifications, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props; const pinned = !!columnId; const emptyMessage = ; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; let scrollableContent = null; @@ -299,4 +296,4 @@ class Notifications extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(Notifications)); +export default connect(mapStateToProps)(withIdentity(injectIntl(Notifications))); diff --git a/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx b/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx index 6b7a739b0b0fb4..86aa28aa41e4b5 100644 --- a/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx +++ b/app/javascript/mastodon/features/picture_in_picture/components/footer.jsx @@ -18,6 +18,7 @@ import { replyCompose } from 'mastodon/actions/compose'; import { reblog, favourite, unreblog, unfavourite } from 'mastodon/actions/interactions'; import { openModal } from 'mastodon/actions/modal'; import { IconButton } from 'mastodon/components/icon_button'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { me, boostModal } from 'mastodon/initial_state'; import { makeGetStatus } from 'mastodon/selectors'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -47,12 +48,8 @@ const makeMapStateToProps = () => { }; class Footer extends ImmutablePureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, statusId: PropTypes.string.isRequired, status: ImmutablePropTypes.map.isRequired, intl: PropTypes.object.isRequired, @@ -75,7 +72,7 @@ class Footer extends ImmutablePureComponent { handleReplyClick = () => { const { dispatch, askReplyConfirmation, status, intl } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { if (askReplyConfirmation) { @@ -104,7 +101,7 @@ class Footer extends ImmutablePureComponent { handleFavouriteClick = () => { const { dispatch, status } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { if (status.get('favourited')) { @@ -126,16 +123,16 @@ class Footer extends ImmutablePureComponent { _performReblog = (status, privacy) => { const { dispatch } = this.props; - dispatch(reblog(status, privacy)); + dispatch(reblog({ statusId: status.get('id'), visibility: privacy })); }; handleReblogClick = e => { const { dispatch, status } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { if (status.get('reblogged')) { - dispatch(unreblog(status)); + dispatch(unreblog({ statusId: status.get('id') })); } else if ((e && e.shiftKey) || !boostModal) { this._performReblog(status); } else { @@ -209,4 +206,4 @@ class Footer extends ImmutablePureComponent { } -export default connect(makeMapStateToProps)(withRouter(injectIntl(Footer))); +export default connect(makeMapStateToProps)(withIdentity(withRouter(injectIntl(Footer)))); diff --git a/app/javascript/mastodon/features/public_timeline/index.jsx b/app/javascript/mastodon/features/public_timeline/index.jsx index 3601dfeae80a12..91351901f532a1 100644 --- a/app/javascript/mastodon/features/public_timeline/index.jsx +++ b/app/javascript/mastodon/features/public_timeline/index.jsx @@ -9,6 +9,7 @@ import { connect } from 'react-redux'; import PublicIcon from '@/material-icons/400-24px/public.svg?react'; import { DismissableBanner } from 'mastodon/components/dismissable_banner'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { domain } from 'mastodon/initial_state'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; @@ -40,16 +41,12 @@ const mapStateToProps = (state, { columnId }) => { }; class PublicTimeline extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static defaultProps = { onlyMedia: false, }; static propTypes = { + identity: identityContextPropShape, dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, columnId: PropTypes.string, @@ -80,7 +77,7 @@ class PublicTimeline extends PureComponent { componentDidMount () { const { dispatch, onlyMedia, onlyRemote } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; dispatch(expandPublicTimeline({ onlyMedia, onlyRemote })); @@ -90,7 +87,7 @@ class PublicTimeline extends PureComponent { } componentDidUpdate (prevProps) { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (prevProps.onlyMedia !== this.props.onlyMedia || prevProps.onlyRemote !== this.props.onlyRemote) { const { dispatch, onlyMedia, onlyRemote } = this.props; @@ -164,4 +161,4 @@ class PublicTimeline extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(PublicTimeline)); +export default connect(mapStateToProps)(withIdentity(injectIntl(PublicTimeline))); diff --git a/app/javascript/mastodon/features/status/components/action_bar.jsx b/app/javascript/mastodon/features/status/components/action_bar.jsx index 15078e7f75bda8..6eb4fb1a47036b 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -22,6 +22,7 @@ import RepeatActiveIcon from '@/svg-icons/repeat_active.svg?react'; import RepeatDisabledIcon from '@/svg-icons/repeat_disabled.svg?react'; import RepeatPrivateIcon from '@/svg-icons/repeat_private.svg?react'; import RepeatPrivateActiveIcon from '@/svg-icons/repeat_private_active.svg?react'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -77,12 +78,8 @@ const mapStateToProps = (state, { status }) => ({ }); class ActionBar extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, status: ImmutablePropTypes.map.isRequired, relationship: ImmutablePropTypes.record, onReply: PropTypes.func.isRequired, @@ -243,7 +240,7 @@ class ActionBar extends PureComponent { render () { const { status, relationship, intl } = this.props; - const { signedIn, permissions } = this.context.identity; + const { signedIn, permissions } = this.props.identity; const publicStatus = ['public', 'unlisted', 'public_unlisted', 'login'].includes(status.get('visibility_ex')); const anonymousStatus = ['public', 'unlisted', 'public_unlisted'].includes(status.get('visibility_ex')); @@ -449,4 +446,4 @@ class ActionBar extends PureComponent { } -export default withRouter(connect(mapStateToProps)(injectIntl(ActionBar))); +export default withRouter(connect(mapStateToProps)(withIdentity(injectIntl(ActionBar)))); diff --git a/app/javascript/mastodon/features/status/containers/detailed_status_container.js b/app/javascript/mastodon/features/status/containers/detailed_status_container.js index 69919e55c4716a..c6215c706dc0b8 100644 --- a/app/javascript/mastodon/features/status/containers/detailed_status_container.js +++ b/app/javascript/mastodon/features/status/containers/detailed_status_container.js @@ -76,12 +76,12 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ }, onModalReblog (status, privacy) { - dispatch(reblog(status, privacy)); + dispatch(reblog({ statusId: status.get('id'), visibility: privacy })); }, onReblog (status, e) { if (status.get('reblogged')) { - dispatch(unreblog(status)); + dispatch(unreblog({ statusId: status.get('id') })); } else { if (e.shiftKey || !boostModal) { this.onModalReblog(status); diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index 4f69a2f8bf63cc..cb183054713c8a 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -20,6 +20,7 @@ import { Icon } from 'mastodon/components/icon'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import ScrollContainer from 'mastodon/containers/scroll_container'; import BundleColumnError from 'mastodon/features/ui/components/bundle_column_error'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; import { @@ -201,12 +202,8 @@ const titleFromStatus = (intl, status) => { }; class Status extends ImmutablePureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, status: ImmutablePropTypes.map, @@ -257,7 +254,7 @@ class Status extends ImmutablePureComponent { handleFavouriteClick = (status) => { const { dispatch } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { if (status.get('favourited')) { @@ -310,7 +307,7 @@ class Status extends ImmutablePureComponent { handleReplyClick = (status) => { const { askReplyConfirmation, dispatch, intl } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { if (askReplyConfirmation) { @@ -338,16 +335,16 @@ class Status extends ImmutablePureComponent { }; handleModalReblog = (status, privacy) => { - this.props.dispatch(reblog(status, privacy)); + this.props.dispatch(reblog({ statusId: status.get('id'), visibility: privacy })); }; handleReblogClick = (status, e, force = false) => { const { dispatch } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; if (signedIn) { if (status.get('reblogged')) { - dispatch(unreblog(status)); + dispatch(unreblog({ statusId: status.get('id') })); } else { if (!force && ((e && e.shiftKey) || !boostModal)) { this.handleModalReblog(status); @@ -829,4 +826,4 @@ class Status extends ImmutablePureComponent { } -export default withRouter(injectIntl(connect(makeMapStateToProps)(Status))); +export default withRouter(injectIntl(connect(makeMapStateToProps)(withIdentity(Status)))); diff --git a/app/javascript/mastodon/features/ui/components/compose_panel.jsx b/app/javascript/mastodon/features/ui/components/compose_panel.jsx index e6ac79bdd93c7c..18321cbe63eaf4 100644 --- a/app/javascript/mastodon/features/ui/components/compose_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/compose_panel.jsx @@ -7,16 +7,13 @@ import { changeComposing, mountCompose, unmountCompose } from 'mastodon/actions/ import ServerBanner from 'mastodon/components/server_banner'; import ComposeFormContainer from 'mastodon/features/compose/containers/compose_form_container'; import SearchContainer from 'mastodon/features/compose/containers/search_container'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import LinkFooter from './link_footer'; class ComposePanel extends PureComponent { - - static contextTypes = { - identity: PropTypes.object.isRequired, - }; - static propTypes = { + identity: identityContextPropShape, dispatch: PropTypes.func.isRequired, }; @@ -41,7 +38,7 @@ class ComposePanel extends PureComponent { } render() { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; return (
@@ -65,4 +62,4 @@ class ComposePanel extends PureComponent { } -export default connect()(ComposePanel); +export default connect()(withIdentity(ComposePanel)); diff --git a/app/javascript/mastodon/features/ui/components/header.jsx b/app/javascript/mastodon/features/ui/components/header.jsx index d256615b5278f6..8f4ce2ec0ea859 100644 --- a/app/javascript/mastodon/features/ui/components/header.jsx +++ b/app/javascript/mastodon/features/ui/components/header.jsx @@ -14,6 +14,7 @@ import { fetchServer } from 'mastodon/actions/server'; import { Avatar } from 'mastodon/components/avatar'; import { Icon } from 'mastodon/components/icon'; import { WordmarkLogo, SymbolLogo } from 'mastodon/components/logo'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { registrationsOpen, me, sso_redirect } from 'mastodon/initial_state'; const Account = connect(state => ({ @@ -43,12 +44,8 @@ const mapDispatchToProps = (dispatch) => ({ }); class Header extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, openClosedRegistrationsModal: PropTypes.func, location: PropTypes.object, signupUrl: PropTypes.string.isRequired, @@ -67,7 +64,7 @@ class Header extends PureComponent { } render () { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; const { location, openClosedRegistrationsModal, signupUrl, intl } = this.props; let content; @@ -129,4 +126,4 @@ class Header extends PureComponent { } -export default injectIntl(withRouter(connect(mapStateToProps, mapDispatchToProps)(Header))); +export default injectIntl(withRouter(withIdentity(connect(mapStateToProps, mapDispatchToProps)(Header)))); diff --git a/app/javascript/mastodon/features/ui/components/link_footer.jsx b/app/javascript/mastodon/features/ui/components/link_footer.jsx index 6b1555243b7668..08af6fa4442658 100644 --- a/app/javascript/mastodon/features/ui/components/link_footer.jsx +++ b/app/javascript/mastodon/features/ui/components/link_footer.jsx @@ -8,6 +8,7 @@ import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import { openModal } from 'mastodon/actions/modal'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { domain, version, source_url, statusPageUrl, profile_directory as profileDirectory } from 'mastodon/initial_state'; import { PERMISSION_INVITE_USERS } from 'mastodon/permissions'; import { logOut } from 'mastodon/utils/log_out'; @@ -32,12 +33,8 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ }); class LinkFooter extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, multiColumn: PropTypes.bool, onLogout: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, @@ -53,7 +50,7 @@ class LinkFooter extends PureComponent { }; render () { - const { signedIn, permissions } = this.context.identity; + const { signedIn, permissions } = this.props.identity; const { multiColumn } = this.props; const canInvite = signedIn && ((permissions & PERMISSION_INVITE_USERS) === PERMISSION_INVITE_USERS); @@ -108,4 +105,4 @@ class LinkFooter extends PureComponent { } -export default injectIntl(connect(null, mapDispatchToProps)(LinkFooter)); +export default injectIntl(withIdentity(connect(null, mapDispatchToProps)(LinkFooter))); diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx index 10464fbeefa530..e9d6077646e055 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx @@ -33,6 +33,7 @@ import { fetchFollowRequests } from 'mastodon/actions/accounts'; import { IconWithBadge } from 'mastodon/components/icon_with_badge'; import { WordmarkLogo } from 'mastodon/components/logo'; import { NavigationPortal } from 'mastodon/components/navigation_portal'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { enableDtlMenu, timelinePreview, trendsEnabled, dtlTag, enableLocalTimeline, isHideItem } from 'mastodon/initial_state'; import { transientSingleColumn } from 'mastodon/is_mobile'; @@ -103,12 +104,8 @@ const FollowRequestsLink = () => { }; class NavigationPanel extends Component { - - static contextTypes = { - identity: PropTypes.object.isRequired, - }; - static propTypes = { + identity: identityContextPropShape, intl: PropTypes.object.isRequired, }; @@ -122,7 +119,7 @@ class NavigationPanel extends Component { render () { const { intl } = this.props; - const { signedIn, disabledAccountId } = this.context.identity; + const { signedIn, disabledAccountId } = this.props.identity; const explorer = (trendsEnabled ? ( @@ -226,4 +223,4 @@ class NavigationPanel extends Component { } -export default injectIntl(NavigationPanel); +export default injectIntl(withIdentity(NavigationPanel)); diff --git a/app/javascript/mastodon/features/ui/index.jsx b/app/javascript/mastodon/features/ui/index.jsx index 1d12f885e9ba7a..172044d735727f 100644 --- a/app/javascript/mastodon/features/ui/index.jsx +++ b/app/javascript/mastodon/features/ui/index.jsx @@ -15,6 +15,7 @@ import { focusApp, unfocusApp, changeLayout } from 'mastodon/actions/app'; import { synchronouslySubmitMarkers, submitMarkers, fetchMarkers } from 'mastodon/actions/markers'; import { INTRODUCTION_VERSION } from 'mastodon/actions/onboarding'; import { PictureInPicture } from 'mastodon/features/picture_in_picture'; +import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; import { layoutFromWindow } from 'mastodon/is_mobile'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -134,12 +135,8 @@ const keyMap = { }; class SwitchingColumnsArea extends PureComponent { - - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { + identity: identityContextPropShape, children: PropTypes.node, location: PropTypes.object, singleColumn: PropTypes.bool, @@ -174,7 +171,7 @@ class SwitchingColumnsArea extends PureComponent { render () { const { children, singleColumn } = this.props; - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; const pathName = this.props.location.pathname; let redirect; @@ -282,12 +279,8 @@ class SwitchingColumnsArea extends PureComponent { } class UI extends PureComponent { - - static contextTypes = { - identity: PropTypes.object.isRequired, - }; - static propTypes = { + identity: identityContextPropShape, dispatch: PropTypes.func.isRequired, children: PropTypes.node, isComposing: PropTypes.bool, @@ -339,7 +332,7 @@ class UI extends PureComponent { this.dragTargets.push(e.target); } - if (e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) { + if (e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files') && this.props.canUploadMore && this.props.identity.signedIn) { this.setState({ draggingOver: true }); } }; @@ -367,7 +360,7 @@ class UI extends PureComponent { this.setState({ draggingOver: false }); this.dragTargets = []; - if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) { + if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.props.identity.signedIn) { this.props.dispatch(uploadCompose(e.dataTransfer.files)); } }; @@ -419,7 +412,7 @@ class UI extends PureComponent { }; componentDidMount () { - const { signedIn } = this.context.identity; + const { signedIn } = this.props.identity; window.addEventListener('focus', this.handleWindowFocus, false); window.addEventListener('blur', this.handleWindowBlur, false); @@ -621,7 +614,7 @@ class UI extends PureComponent {
- + {children} @@ -637,4 +630,4 @@ class UI extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(withRouter(UI))); +export default connect(mapStateToProps)(injectIntl(withRouter(withIdentity(UI)))); diff --git a/app/javascript/mastodon/identity_context.tsx b/app/javascript/mastodon/identity_context.tsx new file mode 100644 index 00000000000000..7f28ab77a34a7d --- /dev/null +++ b/app/javascript/mastodon/identity_context.tsx @@ -0,0 +1,70 @@ +import PropTypes from 'prop-types'; +import { createContext, useContext } from 'react'; + +import hoistStatics from 'hoist-non-react-statics'; + +import type { InitialState } from 'mastodon/initial_state'; + +export interface IdentityContextType { + signedIn: boolean; + accountId: string | undefined; + disabledAccountId: string | undefined; + permissions: number; +} + +export const identityContextPropShape = PropTypes.shape({ + signedIn: PropTypes.bool.isRequired, + accountId: PropTypes.string, + disabledAccountId: PropTypes.string, +}).isRequired; + +export const createIdentityContext = (state: InitialState) => ({ + signedIn: !!state.meta.me, + accountId: state.meta.me, + disabledAccountId: state.meta.disabled_account_id, + permissions: state.role?.permissions ?? 0, +}); + +export const IdentityContext = createContext({ + signedIn: false, + permissions: 0, + accountId: undefined, + disabledAccountId: undefined, +}); + +export const useIdentity = () => useContext(IdentityContext); + +export interface IdentityProps { + ref?: unknown; + wrappedComponentRef?: unknown; +} + +/* Injects an `identity` props into the wrapped component to be able to use the new context in class components */ +export function withIdentity< + ComponentType extends React.ComponentType, +>(Component: ComponentType) { + const displayName = `withIdentity(${Component.displayName ?? Component.name})`; + const C = (props: React.ComponentProps) => { + const { wrappedComponentRef, ...remainingProps } = props; + + return ( + + {(context) => { + return ( + // @ts-expect-error - Dynamic covariant generic components are tough to type. + + ); + }} + + ); + }; + + C.displayName = displayName; + C.WrappedComponent = Component; + + return hoistStatics(C, Component); +} diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index ecf3032aeda6ee..dc04c5449d8247 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -71,12 +71,22 @@ * @property {string} sso_redirect */ +/** + * @typedef Role + * @property {string} id + * @property {string} name + * @property {string} permissions + * @property {string} color + * @property {boolean} highlighted + */ + /** * @typedef InitialState * @property {Record} accounts * @property {InitialStateLanguage[]} languages * @property {boolean=} critical_updates_pending * @property {InitialStateMeta} meta + * @property {Role?} role */ const element = document.getElementById('initial-state'); @@ -159,4 +169,11 @@ export const criticalUpdatesPending = initialState?.critical_updates_pending; export const statusPageUrl = getMeta('status_page_url'); export const sso_redirect = getMeta('sso_redirect'); +/** + * @returns {string | undefined} + */ +export function getAccessToken() { + return getMeta('access_token'); +} + export default initialState; diff --git a/app/javascript/mastodon/locales/be.json b/app/javascript/mastodon/locales/be.json index 2b7673312fbe57..61e96e4b585b91 100644 --- a/app/javascript/mastodon/locales/be.json +++ b/app/javascript/mastodon/locales/be.json @@ -469,6 +469,7 @@ "notification.follow": "{name} падпісаўся на вас", "notification.follow_request": "{name} адправіў запыт на падпіску", "notification.mention": "{name} згадаў вас", + "notification.moderation-warning.learn_more": "Даведацца больш", "notification.own_poll": "Ваша апытанне скончылася", "notification.poll": "Апытанне, дзе вы прынялі ўдзел, скончылася", "notification.reblog": "{name} пашырыў ваш допіс", diff --git a/app/javascript/mastodon/locales/fil.json b/app/javascript/mastodon/locales/fil.json index 894d73c8cc42ba..1f9b0496b9d427 100644 --- a/app/javascript/mastodon/locales/fil.json +++ b/app/javascript/mastodon/locales/fil.json @@ -50,6 +50,8 @@ "admin.dashboard.retention.cohort_size": "Mga bagong tagagamit", "alert.rate_limited.message": "Mangyaring subukan muli pagkatapos ng {retry_time, time, medium}.", "audio.hide": "Itago ang tunog", + "block_modal.show_less": "Magpakita ng mas kaunti", + "block_modal.show_more": "Magpakita ng higit pa", "block_modal.title": "Harangan ang tagagamit?", "bundle_column_error.error.title": "Naku!", "bundle_column_error.network.body": "Nagkaroon ng kamalian habang sinusubukang i-karga ang pahinang ito. Maaaring dahil ito sa pansamantalang problema ng iyong koneksyon sa internet o ang server na ito.", @@ -102,6 +104,7 @@ "compose_form.encryption_warning": "Ang mga post sa Mastodon ay hindi naka-encrypt nang dulo-dulo. Huwag magbahagi ng anumang sensitibong impormasyon sa Mastodon.", "compose_form.hashtag_warning": "Hindi maililista ang post na ito sa anumang hashtag dahil hindi ito nakapubliko. Mga nakapublikong post lamang ang mahahanap ayon sa hashtag.", "compose_form.placeholder": "Anong nangyari?", + "compose_form.poll.duration": "Tagal ng botohan", "compose_form.poll.multiple": "Maraming pagpipilian", "compose_form.poll.single": "Piliin ang isa", "compose_form.reply": "Tumugon", @@ -173,6 +176,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", + "explore.suggested_follows": "Mga tao", "explore.title": "Tuklasin", "explore.trending_links": "Mga balita", "filter_modal.select_filter.search": "Hanapin o gumawa", @@ -186,9 +190,14 @@ "follow_suggestions.who_to_follow": "Sinong maaaring sundan", "footer.about": "Tungkol dito", "footer.get_app": "Kunin ang app", + "footer.status": "Katayuan", "generic.saved": "Nakaimbak", "hashtag.column_header.tag_mode.all": "at {additional}", "hashtag.column_header.tag_mode.any": "o {additional}", + "hashtag.column_settings.tag_mode.all": "Lahat ng nandito", + "hashtag.column_settings.tag_mode.any": "Ilan dito", + "hashtag.column_settings.tag_mode.none": "Wala dito", + "hashtags.and_other": "…at {count, plural, one {# iba pa} other {# na iba pa}}", "home.column_settings.show_replies": "Ipakita ang mga tugon", "home.pending_critical_update.body": "Mangyaring i-update ang iyong serbiro ng Mastodon sa lalong madaling panahon!", "interaction_modal.login.action": "Iuwi mo ako", @@ -199,6 +208,7 @@ "intervals.full.days": "{number, plural, one {# araw} other {# na araw}}", "intervals.full.hours": "{number, plural, one {# oras} other {# na oras}}", "intervals.full.minutes": "{number, plural, one {# minuto} other {# na minuto}}", + "keyboard_shortcuts.blocked": "Buksan ang talaan ng mga nakaharang na mga tagagamit", "keyboard_shortcuts.description": "Paglalarawan", "keyboard_shortcuts.down": "Ilipat pababa sa talaan", "keyboard_shortcuts.mention": "Banggitin ang may-akda", @@ -215,17 +225,23 @@ "lists.replies_policy.title": "Ipakita ang mga tugon sa:", "lists.subheading": "Iyong mga talaan", "loading_indicator.label": "Kumakarga…", + "mute_modal.hide_from_notifications": "Itago mula sa mga abiso", "navigation_bar.about": "Tungkol dito", "navigation_bar.blocks": "Nakaharang na mga tagagamit", "navigation_bar.direct": "Mga palihim na banggit", + "navigation_bar.discover": "Tuklasin", + "navigation_bar.explore": "Tuklasin", "navigation_bar.favourites": "Mga paborito", + "navigation_bar.follow_requests": "Mga hiling sa pagsunod", "navigation_bar.follows_and_followers": "Mga sinusundan at tagasunod", "navigation_bar.lists": "Mga listahan", + "navigation_bar.public_timeline": "Pinagsamang timeline", "navigation_bar.search": "Maghanap", "notification.admin.report": "Iniulat ni {name} si {target}", "notification.follow": "Sinundan ka ni {name}", "notification.follow_request": "Hinihiling ni {name} na sundan ka", "notification.mention": "Binanggit ka ni {name}", + "notification.moderation_warning": "Mayroong kang natanggap na babala sa pagtitimpi", "notification.relationships_severance_event.learn_more": "Matuto nang higit pa", "notification_requests.accept": "Tanggapin", "notification_requests.notifications_from": "Mga abiso mula kay/sa {name}", @@ -234,10 +250,12 @@ "notifications.column_settings.alert": "Mga abiso sa Desktop", "notifications.column_settings.favourite": "Mga paborito:", "notifications.column_settings.follow": "Mga bagong tagasunod:", + "notifications.column_settings.poll": "Resulta ng botohan:", "notifications.column_settings.unread_notifications.category": "Hindi Nabasang mga Abiso", "notifications.column_settings.update": "Mga pagbago:", "notifications.filter.all": "Lahat", "notifications.filter.favourites": "Mga paborito", + "notifications.filter.polls": "Resulta ng botohan", "notifications.mark_as_read": "Markahan lahat ng abiso bilang nabasa na", "notifications.policy.filter_not_followers_title": "Mga taong hindi ka susundan", "notifications.policy.filter_not_following_title": "Mga taong hindi mo sinusundan", @@ -246,6 +264,7 @@ "onboarding.profile.note_hint": "Maaari mong @bangitin ang ibang mga tao o mga #hashtag…", "onboarding.profile.save_and_continue": "Iimbak at magpatuloy", "onboarding.share.next_steps": "Mga posibleng susunod na hakbang:", + "picture_in_picture.restore": "Ilagay ito pabalik", "poll.closed": "Sarado", "poll.reveal": "Ipakita ang mga resulta", "poll.voted": "Binoto mo para sa sagot na ito", @@ -280,10 +299,13 @@ "report.thanks.title": "Ayaw mo bang makita ito?", "report.thanks.title_actionable": "Salamat sa pag-uulat, titingnan namin ito.", "report_notification.categories.other": "Iba pa", + "report_notification.categories.violation": "Paglabag sa patakaran", + "report_notification.open": "Buksan ang ulat", "search.quick_action.open_url": "Buksan ang URL sa Mastodon", "search.search_or_paste": "Maghanap o ilagay ang URL", "search_popout.full_text_search_disabled_message": "Hindi magagamit sa {domain}.", "search_popout.full_text_search_logged_out_message": "Magagamit lamang kapag naka-log in.", + "search_popout.recent": "Kamakailang mga paghahanap", "search_results.all": "Lahat", "search_results.see_all": "Ipakita lahat", "server_banner.learn_more": "Matuto nang higit pa", diff --git a/app/javascript/mastodon/locales/ia.json b/app/javascript/mastodon/locales/ia.json index 313563bdfe3294..47c64e3f0dde88 100644 --- a/app/javascript/mastodon/locales/ia.json +++ b/app/javascript/mastodon/locales/ia.json @@ -19,7 +19,7 @@ "account.block_domain": "Blocar dominio {domain}", "account.block_short": "Blocar", "account.blocked": "Blocate", - "account.browse_more_on_origin_server": "Navigar plus sur le profilo original", + "account.browse_more_on_origin_server": "Percurrer plus sur le profilo original", "account.cancel_follow_request": "Cancellar sequimento", "account.copy": "Copiar ligamine a profilo", "account.direct": "Mentionar privatemente @{name}", @@ -122,7 +122,7 @@ "column.direct": "Mentiones private", "column.directory": "Navigar profilos", "column.domain_blocks": "Dominios blocate", - "column.favourites": "Favoritos", + "column.favourites": "Favorites", "column.firehose": "Fluxos in directo", "column.follow_requests": "Requestas de sequimento", "column.home": "Initio", @@ -204,7 +204,7 @@ "disabled_account_banner.account_settings": "Parametros de conto", "disabled_account_banner.text": "Tu conto {disabledAccount} es actualmente disactivate.", "dismissable_banner.community_timeline": "Ecce le messages public le plus recente del personas con contos sur {domain}.", - "dismissable_banner.dismiss": "Dimitter", + "dismissable_banner.dismiss": "Clauder", "dismissable_banner.explore_links": "Istes es le articulos de novas que se condivide le plus sur le rete social hodie. Le articulos de novas le plus recente, publicate per plus personas differente, se classifica plus in alto.", "dismissable_banner.explore_statuses": "Ecce le messages de tote le rete social que gania popularitate hodie. Le messages plus nove con plus impulsos e favorites se classifica plus in alto.", "dismissable_banner.explore_tags": "Ecce le hashtags que gania popularitate sur le rete social hodie. Le hashtags usate per plus personas differente se classifica plus in alto.", @@ -212,8 +212,8 @@ "domain_block_modal.block": "Blocar le servitor", "domain_block_modal.block_account_instead": "Blocar @{name} in su loco", "domain_block_modal.they_can_interact_with_old_posts": "Le personas de iste servitor pote interager con tu messages ancian.", - "domain_block_modal.they_cant_follow": "Nulle persona ab iste servitor pote sequer te.", - "domain_block_modal.they_wont_know": "Illes non sapera que illes ha essite blocate.", + "domain_block_modal.they_cant_follow": "Necuno de iste servitor pote sequer te.", + "domain_block_modal.they_wont_know": "Ille non sapera que ille ha essite blocate.", "domain_block_modal.title": "Blocar dominio?", "domain_block_modal.you_will_lose_followers": "Omne sequitores ab iste servitor essera removite.", "domain_block_modal.you_wont_see_posts": "Tu non videra messages e notificationes ab usatores sur iste servitor.", @@ -307,7 +307,7 @@ "follow_request.reject": "Rejectar", "follow_requests.unlocked_explanation": "Benque tu conto non es serrate, le personal de {domain} pensa que es un bon idea que tu revide manualmente le sequente requestas de iste contos.", "follow_suggestions.curated_suggestion": "Selection del equipa", - "follow_suggestions.dismiss": "Non monstrar novemente", + "follow_suggestions.dismiss": "Non monstrar de novo", "follow_suggestions.featured_longer": "Seligite con cura per le equipa de {domain}", "follow_suggestions.friends_of_friends_longer": "Popular inter le gente que tu seque", "follow_suggestions.hints.featured": "Iste profilo ha essite seligite manualmente per le equipa de {domain}.", @@ -412,7 +412,7 @@ "lightbox.next": "Sequente", "lightbox.previous": "Precedente", "limited_account_hint.action": "Monstrar profilo in omne caso", - "limited_account_hint.title": "Iste profilo esseva celate per le moderatores de {domain}.", + "limited_account_hint.title": "Iste profilo ha essite celate per le moderatores de {domain}.", "link_preview.author": "Per {name}", "lists.account.add": "Adder al lista", "lists.account.remove": "Remover del lista", @@ -432,12 +432,12 @@ "loading_indicator.label": "Cargante…", "media_gallery.toggle_visible": "{number, plural, one {Celar imagine} other {Celar imagines}}", "moved_to_account_banner.text": "Tu conto {disabledAccount} es actualmente disactivate perque tu ha cambiate de conto a {movedToAccount}.", - "mute_modal.hide_from_notifications": "Celar ab notificationes", + "mute_modal.hide_from_notifications": "Celar in notificationes", "mute_modal.hide_options": "Celar optiones", "mute_modal.indefinite": "Usque io dissilentia iste persona", "mute_modal.show_options": "Monstrar optiones", - "mute_modal.they_can_mention_and_follow": "Illes pote mentionar te e sequer te, ma tu non potera vider los.", - "mute_modal.they_wont_know": "Illes non sapera que illes ha essite silentiate.", + "mute_modal.they_can_mention_and_follow": "Ille pote mentionar te e sequer te, ma tu non potera vider le.", + "mute_modal.they_wont_know": "Ille non sapera que ille ha essite silentiate.", "mute_modal.title": "Silentiar le usator?", "mute_modal.you_wont_see_mentions": "Tu non videra le messages que mentiona iste persona.", "mute_modal.you_wont_see_posts": "Iste persona pote totevia vider tu messages, ma tu non videra le sues.", @@ -451,13 +451,13 @@ "navigation_bar.discover": "Discoperir", "navigation_bar.domain_blocks": "Dominios blocate", "navigation_bar.explore": "Explorar", - "navigation_bar.favourites": "Favoritos", + "navigation_bar.favourites": "Favorites", "navigation_bar.filters": "Parolas silentiate", "navigation_bar.follow_requests": "Requestas de sequimento", "navigation_bar.followed_tags": "Hashtags sequite", "navigation_bar.follows_and_followers": "Sequites e sequitores", "navigation_bar.lists": "Listas", - "navigation_bar.logout": "Clauder le session", + "navigation_bar.logout": "Clauder session", "navigation_bar.mutes": "Usatores silentiate", "navigation_bar.opened_in_classic_interface": "Messages, contos e altere paginas specific es aperite per predefinition in le interfacie web classic.", "navigation_bar.personal": "Personal", @@ -501,7 +501,7 @@ "notifications.column_settings.admin.report": "Nove signalationes:", "notifications.column_settings.admin.sign_up": "Nove inscriptiones:", "notifications.column_settings.alert": "Notificationes de scriptorio", - "notifications.column_settings.favourite": "Favoritos:", + "notifications.column_settings.favourite": "Favorites:", "notifications.column_settings.filter_bar.advanced": "Monstrar tote le categorias", "notifications.column_settings.filter_bar.category": "Barra de filtro rapide", "notifications.column_settings.follow": "Nove sequitores:", @@ -518,7 +518,7 @@ "notifications.column_settings.update": "Modificationes:", "notifications.filter.all": "Toto", "notifications.filter.boosts": "Impulsos", - "notifications.filter.favourites": "Favoritos", + "notifications.filter.favourites": "Favorites", "notifications.filter.follows": "Sequites", "notifications.filter.mentions": "Mentiones", "notifications.filter.polls": "Resultatos del sondage", @@ -717,7 +717,7 @@ "status.edited": "Ultime modification le {date}", "status.edited_x_times": "Modificate {count, plural, one {{count} vice} other {{count} vices}}", "status.embed": "Incastrar", - "status.favourite": "Adder al favoritos", + "status.favourite": "Adder al favorites", "status.favourites": "{count, plural, one {favorite} other {favorites}}", "status.filter": "Filtrar iste message", "status.filtered": "Filtrate", diff --git a/app/javascript/mastodon/locales/lv.json b/app/javascript/mastodon/locales/lv.json index 32ea6e47c45a7c..b61a2c0c360c5d 100644 --- a/app/javascript/mastodon/locales/lv.json +++ b/app/javascript/mastodon/locales/lv.json @@ -90,7 +90,7 @@ "attachments_list.unprocessed": "(neapstrādāti)", "audio.hide": "Slēpt audio", "block_modal.remote_users_caveat": "Mēs vaicāsim serverim {domain} ņemt vērā Tavu lēmumu. Tomēr atbilstība nav nodrošināta, jo atsevišķi serveri var apstrādāt bloķēšanu citādi. Publiski ieraksti joprojām var būt redzami lietotājiem, kuri nav pieteikušies.", - "block_modal.show_less": "Parādīt vairāk", + "block_modal.show_less": "Rādīt mazāk", "block_modal.show_more": "Parādīt mazāk", "boost_modal.combo": "Nospied {combo}, lai nākamreiz šo izlaistu", "bundle_column_error.copy_stacktrace": "Kopēt kļūdu ziņojumu", @@ -309,7 +309,7 @@ "hashtag.counter_by_uses_today": "{count, plural, zero {{counter} ierakstu} one {{counter} ieraksts} other {{counter} ieraksti}} šodien", "hashtag.follow": "Sekot tēmturim", "hashtag.unfollow": "Pārstāt sekot tēmturim", - "hashtags.and_other": "..un {count, plural, other {# vairāk}}", + "hashtags.and_other": "… un {count, plural, other {vēl #}}", "home.column_settings.show_reblogs": "Rādīt pastiprinātos ierakstus", "home.column_settings.show_replies": "Rādīt atbildes", "home.hide_announcements": "Slēpt paziņojumus", @@ -491,7 +491,7 @@ "onboarding.actions.go_to_home": "Dodieties uz manu mājas plūsmu", "onboarding.compose.template": "Sveiki, #Mastodon!", "onboarding.follows.empty": "Diemžēl pašlaik nevar parādīt rezultātus. Vari mēģināt izmantot meklēšanu vai pārlūkot izpētes lapu, lai atrastu cilvēkus, kuriem sekot, vai vēlāk mēģināt vēlreiz.", - "onboarding.follows.lead": "Tava mājas plūsma ir galvenais veids, kā izbaudīt Mastodon. Jo vairāk cilvēku sekosi, jo aktīvāk un interesantāk tas būs. Lai sāktu, šeit ir daži ieteikumi:", + "onboarding.follows.lead": "Tava mājas plūsma ir galvenais veids, kā pieredzēt Mastodon. Jo vairāk cilvēkiem sekosi, jo dzīvīgāka un aizraujošāka tā būs. Lai sāktu, šeit ir daži ieteikumi:", "onboarding.follows.title": "Pielāgo savu mājas barotni", "onboarding.profile.discoverable": "Padarīt manu profilu atklājamu", "onboarding.profile.display_name": "Attēlojamais vārds", diff --git a/app/javascript/mastodon/locales/ru.json b/app/javascript/mastodon/locales/ru.json index cd09a505b3e93c..07a41385a2bf26 100644 --- a/app/javascript/mastodon/locales/ru.json +++ b/app/javascript/mastodon/locales/ru.json @@ -468,6 +468,7 @@ "notification.follow": "{name} подписался (-лась) на вас", "notification.follow_request": "{name} отправил запрос на подписку", "notification.mention": "{name} упомянул(а) вас", + "notification.moderation_warning.action_delete_statuses": "Некоторые из ваших публикаций были удалены.", "notification.own_poll": "Ваш опрос закончился", "notification.poll": "Опрос, в котором вы приняли участие, завершился", "notification.reblog": "{name} продвинул(а) ваш пост", diff --git a/app/javascript/mastodon/locales/sl.json b/app/javascript/mastodon/locales/sl.json index 459d05ce3ecfe8..7806abc6b55fbb 100644 --- a/app/javascript/mastodon/locales/sl.json +++ b/app/javascript/mastodon/locales/sl.json @@ -474,6 +474,7 @@ "notification.follow_request": "{name} vam želi slediti", "notification.mention": "{name} vas je omenil/a", "notification.moderation-warning.learn_more": "Več o tem", + "notification.moderation_warning": "Prejeli ste opozorilo moderatorjev", "notification.moderation_warning.action_delete_statuses": "Nekatere vaše objave so odstranjene.", "notification.moderation_warning.action_disable": "Vaš račun je bil onemogočen.", "notification.moderation_warning.action_mark_statuses_as_sensitive": "Nekatere vaše objave so bile označene kot občutljive.", diff --git a/app/javascript/mastodon/locales/th.json b/app/javascript/mastodon/locales/th.json index 7c6b2ade4e3629..b1b9407ba11d9a 100644 --- a/app/javascript/mastodon/locales/th.json +++ b/app/javascript/mastodon/locales/th.json @@ -158,7 +158,7 @@ "compose_form.poll.option_placeholder": "ตัวเลือก {number}", "compose_form.poll.single": "เลือกอย่างใดอย่างหนึ่ง", "compose_form.poll.switch_to_multiple": "เปลี่ยนการสำรวจความคิดเห็นเป็นอนุญาตหลายตัวเลือก", - "compose_form.poll.switch_to_single": "เปลี่ยนการสำรวจความคิดเห็นเป็นอนุญาตตัวเลือกเดี่ยว", + "compose_form.poll.switch_to_single": "เปลี่ยนการสำรวจความคิดเห็นเป็นอนุญาตตัวเลือกเดียว", "compose_form.poll.type": "ลักษณะ", "compose_form.publish": "โพสต์", "compose_form.publish_form": "โพสต์ใหม่", diff --git a/app/javascript/mastodon/reducers/meta.js b/app/javascript/mastodon/reducers/meta.js index 96baf2f1152cbb..ddb78845929464 100644 --- a/app/javascript/mastodon/reducers/meta.js +++ b/app/javascript/mastodon/reducers/meta.js @@ -6,7 +6,6 @@ import { layoutFromWindow } from 'mastodon/is_mobile'; const initialState = ImmutableMap({ streaming_api_base_url: null, - access_token: null, layout: layoutFromWindow(), permissions: '0', }); @@ -14,7 +13,8 @@ const initialState = ImmutableMap({ export default function meta(state = initialState, action) { switch(action.type) { case STORE_HYDRATE: - return state.merge(action.state.get('meta')).set('permissions', action.state.getIn(['role', 'permissions'])); + // we do not want `access_token` to be stored in the state + return state.merge(action.state.get('meta')).delete('access_token').set('permissions', action.state.getIn(['role', 'permissions'])); case changeLayout.type: return state.set('layout', action.payload.layout); default: diff --git a/app/javascript/mastodon/reducers/statuses.js b/app/javascript/mastodon/reducers/statuses.js index 458df42f08c8f3..78af2faaf0bc14 100644 --- a/app/javascript/mastodon/reducers/statuses.js +++ b/app/javascript/mastodon/reducers/statuses.js @@ -9,10 +9,6 @@ import { import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; import { normalizeStatusTranslation } from '../actions/importer/normalizer'; import { - REBLOG_REQUEST, - REBLOG_FAIL, - UNREBLOG_REQUEST, - UNREBLOG_FAIL, FAVOURITE_REQUEST, FAVOURITE_FAIL, UNFAVOURITE_REQUEST, @@ -22,6 +18,10 @@ import { UNBOOKMARK_REQUEST, UNBOOKMARK_FAIL, } from '../actions/interactions'; +import { + reblog, + unreblog, +} from '../actions/interactions_typed'; import { STATUS_MUTE_SUCCESS, STATUS_UNMUTE_SUCCESS, @@ -99,6 +99,7 @@ const statusTranslateUndo = (state, id) => { const initialState = ImmutableMap(); +/** @type {import('@reduxjs/toolkit').Reducer} */ export default function statuses(state = initialState, action) { switch(action.type) { case STATUS_FETCH_REQUEST: @@ -129,14 +130,6 @@ export default function statuses(state = initialState, action) { return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'bookmarked'], false); case UNBOOKMARK_FAIL: return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'bookmarked'], true); - case REBLOG_REQUEST: - return state.setIn([action.status.get('id'), 'reblogged'], true); - case REBLOG_FAIL: - return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'reblogged'], false); - case UNREBLOG_REQUEST: - return state.setIn([action.status.get('id'), 'reblogged'], false); - case UNREBLOG_FAIL: - return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'reblogged'], true); case STATUS_MUTE_SUCCESS: return state.setIn([action.id, 'muted'], true); case STATUS_UNMUTE_SUCCESS: @@ -168,6 +161,15 @@ export default function statuses(state = initialState, action) { case STATUS_EMOJI_REACTION_UPDATE: return updateStatusEmojiReaction(state, action.emoji_reaction); default: - return state; + if(reblog.pending.match(action)) + return state.setIn([action.meta.arg.statusId, 'reblogged'], true); + else if(reblog.rejected.match(action)) + return state.get(action.meta.arg.statusId) === undefined ? state : state.setIn([action.meta.arg.statusId, 'reblogged'], false); + else if(unreblog.pending.match(action)) + return state.setIn([action.meta.arg.statusId, 'reblogged'], false); + else if(unreblog.rejected.match(action)) + return state.get(action.meta.arg.statusId) === undefined ? state : state.setIn([action.meta.arg.statusId, 'reblogged'], true); + else + return state; } } diff --git a/app/javascript/mastodon/store/typed_functions.ts b/app/javascript/mastodon/store/typed_functions.ts index b66d7545c5dd4c..0392f373c0c6bb 100644 --- a/app/javascript/mastodon/store/typed_functions.ts +++ b/app/javascript/mastodon/store/typed_functions.ts @@ -2,6 +2,8 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; // eslint-disable-next-line @typescript-eslint/no-restricted-imports import { useDispatch, useSelector } from 'react-redux'; +import type { BaseThunkAPI } from '@reduxjs/toolkit/dist/createAsyncThunk'; + import type { AppDispatch, RootState } from './store'; export const useAppDispatch = useDispatch.withTypes(); @@ -13,8 +15,192 @@ export interface AsyncThunkRejectValue { error?: unknown; } +interface AppMeta { + skipLoading?: boolean; +} + export const createAppAsyncThunk = createAsyncThunk.withTypes<{ state: RootState; dispatch: AppDispatch; rejectValue: AsyncThunkRejectValue; }>(); + +type AppThunkApi = Pick< + BaseThunkAPI< + RootState, + unknown, + AppDispatch, + AsyncThunkRejectValue, + AppMeta, + AppMeta + >, + 'getState' | 'dispatch' +>; + +interface AppThunkOptions { + skipLoading?: boolean; +} + +const createBaseAsyncThunk = createAsyncThunk.withTypes<{ + state: RootState; + dispatch: AppDispatch; + rejectValue: AsyncThunkRejectValue; + fulfilledMeta: AppMeta; + rejectedMeta: AppMeta; +}>(); + +export function createThunk( + name: string, + creator: (arg: Arg, api: AppThunkApi) => Returned | Promise, + options: AppThunkOptions = {}, +) { + return createBaseAsyncThunk( + name, + async ( + arg: Arg, + { getState, dispatch, fulfillWithValue, rejectWithValue }, + ) => { + try { + const result = await creator(arg, { dispatch, getState }); + + return fulfillWithValue(result, { + skipLoading: options.skipLoading, + }); + } catch (error) { + return rejectWithValue({ error }, { skipLoading: true }); + } + }, + { + getPendingMeta() { + if (options.skipLoading) return { skipLoading: true }; + return {}; + }, + }, + ); +} + +const discardLoadDataInPayload = Symbol('discardLoadDataInPayload'); +type DiscardLoadData = typeof discardLoadDataInPayload; + +type OnData = ( + data: LoadDataResult, + api: AppThunkApi & { + discardLoadData: DiscardLoadData; + }, +) => ReturnedData | DiscardLoadData | Promise; + +// Overload when there is no `onData` method, the payload is the `onData` result +export function createDataLoadingThunk< + LoadDataResult, + Args extends Record, +>( + name: string, + loadData: (args: Args) => Promise, + thunkOptions?: AppThunkOptions, +): ReturnType>; + +// Overload when the `onData` method returns discardLoadDataInPayload, then the payload is empty +export function createDataLoadingThunk< + LoadDataResult, + Args extends Record, +>( + name: string, + loadData: (args: Args) => Promise, + onDataOrThunkOptions?: + | AppThunkOptions + | OnData, + thunkOptions?: AppThunkOptions, +): ReturnType>; + +// Overload when the `onData` method returns nothing, then the mayload is the `onData` result +export function createDataLoadingThunk< + LoadDataResult, + Args extends Record, +>( + name: string, + loadData: (args: Args) => Promise, + onDataOrThunkOptions?: AppThunkOptions | OnData, + thunkOptions?: AppThunkOptions, +): ReturnType>; + +// Overload when there is an `onData` method returning something +export function createDataLoadingThunk< + LoadDataResult, + Args extends Record, + Returned, +>( + name: string, + loadData: (args: Args) => Promise, + onDataOrThunkOptions?: AppThunkOptions | OnData, + thunkOptions?: AppThunkOptions, +): ReturnType>; + +/** + * This function creates a Redux Thunk that handles loading data asynchronously (usually from the API), dispatching `pending`, `fullfilled` and `rejected` actions. + * + * You can run a callback on the `onData` results to either dispatch side effects or modify the payload. + * + * It is a wrapper around RTK's [`createAsyncThunk`](https://redux-toolkit.js.org/api/createAsyncThunk) + * @param name Prefix for the actions types + * @param loadData Function that loads the data. It's (object) argument will become the thunk's argument + * @param onDataOrThunkOptions + * Callback called on the results from `loadData`. + * + * First argument will be the return from `loadData`. + * + * Second argument is an object with: `dispatch`, `getState` and `discardLoadData`. + * It can return: + * - `undefined` (or no explicit return), meaning that the `onData` results will be the payload + * - `discardLoadData` to discard the `onData` results and return an empty payload + * - anything else, which will be the payload + * + * You can also omit this parameter and pass `thunkOptions` directly + * @param maybeThunkOptions + * Additional Mastodon specific options for the thunk. Currently supports: + * - `skipLoading` to avoid showing the loading bar when the request is in progress + * @returns The created thunk + */ +export function createDataLoadingThunk< + LoadDataResult, + Args extends Record, + Returned, +>( + name: string, + loadData: (args: Args) => Promise, + onDataOrThunkOptions?: AppThunkOptions | OnData, + maybeThunkOptions?: AppThunkOptions, +) { + let onData: OnData | undefined; + let thunkOptions: AppThunkOptions | undefined; + + if (typeof onDataOrThunkOptions === 'function') onData = onDataOrThunkOptions; + else if (typeof onDataOrThunkOptions === 'object') + thunkOptions = onDataOrThunkOptions; + + if (maybeThunkOptions) { + thunkOptions = maybeThunkOptions; + } + + return createThunk( + name, + async (arg, { getState, dispatch }) => { + const data = await loadData(arg); + + if (!onData) return data as Returned; + + const result = await onData(data, { + dispatch, + getState, + discardLoadData: discardLoadDataInPayload, + }); + + // if there is no return in `onData`, we return the `onData` result + if (typeof result === 'undefined') return data as Returned; + // the user explicitely asked to discard the payload + else if (result === discardLoadDataInPayload) + return undefined as Returned; + else return result; + }, + thunkOptions, + ); +} diff --git a/app/javascript/mastodon/stream.js b/app/javascript/mastodon/stream.js index de67b2d301cd36..cad34fb06d4b21 100644 --- a/app/javascript/mastodon/stream.js +++ b/app/javascript/mastodon/stream.js @@ -2,6 +2,8 @@ import WebSocketClient from '@gamestdio/websocket'; +import { getAccessToken } from './initial_state'; + /** * @type {WebSocketClient | undefined} */ @@ -147,9 +149,11 @@ const channelNameWithInlineParams = (channelName, params) => { // @ts-expect-error export const connectStream = (channelName, params, callbacks) => (dispatch, getState) => { const streamingAPIBaseURL = getState().getIn(['meta', 'streaming_api_base_url']); - const accessToken = getState().getIn(['meta', 'access_token']); + const accessToken = getAccessToken(); const { onConnect, onReceive, onDisconnect } = callbacks(dispatch, getState); + if(!accessToken) throw new Error("Trying to connect to the streaming server but no access token is available."); + // If we cannot use a websockets connection, we must fall back // to using individual connections for each channel if (!streamingAPIBaseURL.startsWith('ws')) { diff --git a/app/javascript/mastodon/test_helpers.tsx b/app/javascript/mastodon/test_helpers.tsx index 69d57b95a0437b..93b5a8453accf1 100644 --- a/app/javascript/mastodon/test_helpers.tsx +++ b/app/javascript/mastodon/test_helpers.tsx @@ -1,7 +1,3 @@ -import PropTypes from 'prop-types'; -import type { PropsWithChildren } from 'react'; -import { Component } from 'react'; - import { IntlProvider } from 'react-intl'; import { MemoryRouter } from 'react-router'; @@ -9,44 +5,26 @@ import { MemoryRouter } from 'react-router'; // eslint-disable-next-line import/no-extraneous-dependencies import { render as rtlRender } from '@testing-library/react'; -class FakeIdentityWrapper extends Component< - PropsWithChildren<{ signedIn: boolean }> -> { - static childContextTypes = { - identity: PropTypes.shape({ - signedIn: PropTypes.bool.isRequired, - accountId: PropTypes.string, - disabledAccountId: PropTypes.string, - accessToken: PropTypes.string, - }).isRequired, - }; - - getChildContext() { - return { - identity: { - signedIn: this.props.signedIn, - accountId: '123', - accessToken: 'test-access-token', - }, - }; - } - - render() { - return this.props.children; - } -} +import { IdentityContext } from './identity_context'; function render( ui: React.ReactElement, { locale = 'en', signedIn = true, ...renderOptions } = {}, ) { + const fakeIdentity = { + signedIn: signedIn, + accountId: '123', + disabledAccountId: undefined, + permissions: 0, + }; + const Wrapper = (props: { children: React.ReactNode }) => { return ( - + {props.children} - + ); diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index f32eaaf6d62ab4..3ed6df49425b14 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -4521,7 +4521,7 @@ a.status-card { color: $primary-text-color; } - .icon { + .icon-sliders { transform: rotate(60deg); } } @@ -4532,7 +4532,7 @@ a.status-card { } } -.no-reduce-motion .column-header__button .icon { +.no-reduce-motion .column-header__button .icon-sliders { transition: transform 150ms ease-in-out; } diff --git a/app/lib/activitypub/parser/status_parser.rb b/app/lib/activitypub/parser/status_parser.rb index a77686dcb3a2a2..e982a12e633b43 100644 --- a/app/lib/activitypub/parser/status_parser.rb +++ b/app/lib/activitypub/parser/status_parser.rb @@ -3,6 +3,8 @@ class ActivityPub::Parser::StatusParser include JsonLdHelper + NORMALIZED_LOCALE_NAMES = LanguagesHelper::SUPPORTED_LOCALES.keys.index_by(&:downcase).freeze + # @param [Hash] json # @param [Hash] options # @option options [String] :followers_collection @@ -118,10 +120,13 @@ def limited_scope end def language - @language ||= original_language || (misskey_software? ? 'ja' : nil) + lang = raw_language_code || (misskey_software? ? 'ja' : nil) + lang.presence && NORMALIZED_LOCALE_NAMES.fetch(lang.downcase.to_sym, lang) end - def original_language + private + + def raw_language_code if content_language_map? @object['contentMap'].keys.first elsif name_language_map? @@ -131,8 +136,6 @@ def original_language end end - private - def audience_to as_array(@object['to'] || @json['to']).map { |x| value_or_id(x) } end diff --git a/app/lib/application_extension.rb b/app/lib/application_extension.rb index 400c51a023d09b..2fea1057cb6db3 100644 --- a/app/lib/application_extension.rb +++ b/app/lib/application_extension.rb @@ -23,6 +23,12 @@ def confirmation_redirect_uri redirect_uri.lines.first.strip end + def redirect_uris + # Doorkeeper stores the redirect_uri value as a newline delimeted list in + # the database: + redirect_uri.split + end + def push_to_streaming_api # TODO: #28793 Combine into a single topic payload = Oj.dump(event: :kill) diff --git a/app/lib/vacuum/imports_vacuum.rb b/app/lib/vacuum/imports_vacuum.rb index 8c8bb783acb84f..700bd81847f4ac 100644 --- a/app/lib/vacuum/imports_vacuum.rb +++ b/app/lib/vacuum/imports_vacuum.rb @@ -9,10 +9,10 @@ def perform private def clean_unconfirmed_imports! - BulkImport.state_unconfirmed.where('created_at <= ?', 10.minutes.ago).reorder(nil).in_batches.delete_all + BulkImport.state_unconfirmed.where(created_at: ..10.minutes.ago).reorder(nil).in_batches.delete_all end def clean_old_imports! - BulkImport.where('created_at <= ?', 1.week.ago).reorder(nil).in_batches.delete_all + BulkImport.where(created_at: ..1.week.ago).reorder(nil).in_batches.delete_all end end diff --git a/app/lib/vacuum/statuses_vacuum.rb b/app/lib/vacuum/statuses_vacuum.rb index 947ae560f6c607..d4aa7bd7ac79c2 100644 --- a/app/lib/vacuum/statuses_vacuum.rb +++ b/app/lib/vacuum/statuses_vacuum.rb @@ -34,7 +34,7 @@ def vacuum_statuses! def statuses_scope scope = Status.unscoped.kept .joins(:account).merge(Account.remote) - .where('statuses.id < ?', retention_period_as_id) + .where(statuses: { id: ...retention_period_as_id }) if Setting.delete_content_cache_without_reaction scope = scope.where.not(id: favourited_statuses) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index f8c1c9a8d0048b..81a2c0c6d04bbc 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -5,7 +5,6 @@ class UserMailer < Devise::Mailer helper :accounts helper :application - helper :mascot helper :formatting helper :instance helper :routing diff --git a/app/models/admin/action_log_filter.rb b/app/models/admin/action_log_filter.rb index cd4bf8879f7433..17af35fbc8baea 100644 --- a/app/models/admin/action_log_filter.rb +++ b/app/models/admin/action_log_filter.rb @@ -61,6 +61,7 @@ class Admin::ActionLogFilter unsuspend_account: { target_type: 'Account', action: 'unsuspend' }.freeze, update_announcement: { target_type: 'Announcement', action: 'update' }.freeze, update_custom_emoji: { target_type: 'CustomEmoji', action: 'update' }.freeze, + update_report: { target_type: 'Report', action: 'update' }.freeze, update_status: { target_type: 'Status', action: 'update' }.freeze, force_cw_status: { target_type: 'Status', action: 'force_cw' }.freeze, force_sensitive_status: { target_type: 'Status', action: 'force_sensitive' }.freeze, diff --git a/app/models/canonical_email_block.rb b/app/models/canonical_email_block.rb index c05eb9801dc48c..d09df6f5e2a531 100644 --- a/app/models/canonical_email_block.rb +++ b/app/models/canonical_email_block.rb @@ -20,7 +20,6 @@ class CanonicalEmailBlock < ApplicationRecord validates :canonical_email_hash, presence: true, uniqueness: true scope :matching_email, ->(email) { where(canonical_email_hash: email_to_canonical_email_hash(email)) } - scope :matching_account, ->(account) { matching_email(account&.user_email).or(where(reference_account: account)) } def to_log_human_identifier canonical_email_hash diff --git a/app/models/concerns/expireable.rb b/app/models/concerns/expireable.rb index c64fc7d807d006..26740e8213759d 100644 --- a/app/models/concerns/expireable.rb +++ b/app/models/concerns/expireable.rb @@ -4,7 +4,7 @@ module Expireable extend ActiveSupport::Concern included do - scope :expired, -> { where.not(expires_at: nil).where('expires_at < ?', Time.now.utc) } + scope :expired, -> { where.not(expires_at: nil).where(expires_at: ...Time.now.utc) } def expires_in return @expires_in if defined?(@expires_in) diff --git a/app/models/invite.rb b/app/models/invite.rb index 2fe9f22fbe1339..ea095a3ac17747 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -24,7 +24,7 @@ class Invite < ApplicationRecord belongs_to :user, inverse_of: :invites has_many :users, inverse_of: :invite, dependent: nil - scope :available, -> { where(expires_at: nil).or(where('expires_at >= ?', Time.now.utc)) } + scope :available, -> { where(expires_at: nil).or(where(expires_at: Time.now.utc..)) } validates :comment, length: { maximum: COMMENT_SIZE_LIMIT } diff --git a/app/policies/backup_policy.rb b/app/policies/backup_policy.rb index 86b8efbe96fa7d..7a4c5b4347497d 100644 --- a/app/policies/backup_policy.rb +++ b/app/policies/backup_policy.rb @@ -4,6 +4,6 @@ class BackupPolicy < ApplicationPolicy MIN_AGE = 6.days def create? - user_signed_in? && current_user.backups.where('created_at >= ?', MIN_AGE.ago).count.zero? + user_signed_in? && current_user.backups.where(created_at: MIN_AGE.ago..).count.zero? end end diff --git a/app/serializers/rest/application_serializer.rb b/app/serializers/rest/application_serializer.rb index 635508a17cbe64..1a7b9265f192f2 100644 --- a/app/serializers/rest/application_serializer.rb +++ b/app/serializers/rest/application_serializer.rb @@ -1,24 +1,18 @@ # frozen_string_literal: true class REST::ApplicationSerializer < ActiveModel::Serializer - attributes :id, :name, :website, :scopes, :redirect_uri, - :client_id, :client_secret + attributes :id, :name, :website, :scopes, :redirect_uris # NOTE: Deprecated in 4.3.0, needs to be removed in 5.0.0 attribute :vapid_key + # We should consider this property deprecated for 4.3.0 + attribute :redirect_uri + def id object.id.to_s end - def client_id - object.uid - end - - def client_secret - object.secret - end - def website object.website.presence end diff --git a/app/serializers/rest/credential_application_serializer.rb b/app/serializers/rest/credential_application_serializer.rb new file mode 100644 index 00000000000000..bfec7d03e80afa --- /dev/null +++ b/app/serializers/rest/credential_application_serializer.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class REST::CredentialApplicationSerializer < REST::ApplicationSerializer + attributes :client_id, :client_secret + + def client_id + object.uid + end + + def client_secret + object.secret + end +end diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index 30e4f23abb9d6a..761caabc053e43 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -57,7 +57,7 @@ def html @html_charset = res.charset - res.body_with_limit + res.truncated_body end end diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml index bcf7c073141543..f148b9a0822193 100644 --- a/app/views/admin/accounts/show.html.haml +++ b/app/views/admin/accounts/show.html.haml @@ -30,7 +30,7 @@ = render 'admin/accounts/counters', account: @account - if @account.local? && @account.user.nil? - = link_to t('admin.accounts.unblock_email'), unblock_email_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unblock_email, @account) && CanonicalEmailBlock.matching_account(@account).exists? + = link_to t('admin.accounts.unblock_email'), unblock_email_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unblock_email, @account) && CanonicalEmailBlock.exists?(reference_account_id: @account.id) - else .table-wrapper %table.table.inline-table diff --git a/app/workers/scheduler/ip_cleanup_scheduler.rb b/app/workers/scheduler/ip_cleanup_scheduler.rb index f78c0584d7f892..04fb0aaa3306cd 100644 --- a/app/workers/scheduler/ip_cleanup_scheduler.rb +++ b/app/workers/scheduler/ip_cleanup_scheduler.rb @@ -16,11 +16,11 @@ def perform private def clean_ip_columns! - SessionActivation.where('updated_at < ?', SESSION_RETENTION_PERIOD.ago).in_batches.destroy_all - SessionActivation.where('updated_at < ?', IP_RETENTION_PERIOD.ago).in_batches.update_all(ip: nil) - User.where('current_sign_in_at < ?', IP_RETENTION_PERIOD.ago).in_batches.update_all(sign_up_ip: nil) - LoginActivity.where('created_at < ?', IP_RETENTION_PERIOD.ago).in_batches.destroy_all - Doorkeeper::AccessToken.where('last_used_at < ?', IP_RETENTION_PERIOD.ago).in_batches.update_all(last_used_ip: nil) + SessionActivation.where(updated_at: ...SESSION_RETENTION_PERIOD.ago).in_batches.destroy_all + SessionActivation.where(updated_at: ...IP_RETENTION_PERIOD.ago).in_batches.update_all(ip: nil) + User.where(current_sign_in_at: ...IP_RETENTION_PERIOD.ago).in_batches.update_all(sign_up_ip: nil) + LoginActivity.where(created_at: ...IP_RETENTION_PERIOD.ago).in_batches.destroy_all + Doorkeeper::AccessToken.where(last_used_at: ...IP_RETENTION_PERIOD.ago).in_batches.update_all(last_used_ip: nil) end def clean_expired_ip_blocks! diff --git a/app/workers/scheduler/scheduled_statuses_scheduler.rb b/app/workers/scheduler/scheduled_statuses_scheduler.rb index bdc07d1ffb7f01..14397bfa934aba 100644 --- a/app/workers/scheduler/scheduled_statuses_scheduler.rb +++ b/app/workers/scheduler/scheduled_statuses_scheduler.rb @@ -27,11 +27,11 @@ def unpublish_expired_statuses! end def due_statuses - ScheduledStatus.where('scheduled_at <= ?', Time.now.utc + PostStatusService::MIN_SCHEDULE_OFFSET) + ScheduledStatus.where(scheduled_at: ..Time.now.utc + PostStatusService::MIN_SCHEDULE_OFFSET) end def expired_statuses - ScheduledExpirationStatus.where('scheduled_at <= ?', Time.now.utc + PostStatusService::MIN_SCHEDULE_OFFSET) + ScheduledExpirationStatus.where(scheduled_at: ..Time.now.utc + PostStatusService::MIN_SCHEDULE_OFFSET) end def publish_scheduled_announcements! diff --git a/app/workers/scheduler/user_cleanup_scheduler.rb b/app/workers/scheduler/user_cleanup_scheduler.rb index 63ea876e5078dc..74abc2370189af 100644 --- a/app/workers/scheduler/user_cleanup_scheduler.rb +++ b/app/workers/scheduler/user_cleanup_scheduler.rb @@ -25,7 +25,7 @@ def clean_unconfirmed_accounts! end def clean_discarded_statuses! - Status.unscoped.discarded.where('deleted_at <= ?', DISCARDED_STATUSES_MAX_AGE_DAYS.days.ago).find_in_batches do |statuses| + Status.unscoped.discarded.where(deleted_at: ..DISCARDED_STATUSES_MAX_AGE_DAYS.days.ago).find_in_batches do |statuses| RemovalWorker.push_bulk(statuses) do |status| [status.id, { 'immediate' => true, 'skip_streaming' => true }] end diff --git a/config/initializers/active_record_encryption.rb b/config/initializers/active_record_encryption.rb index 7cda8c621c2b69..777bafc2730d05 100644 --- a/config/initializers/active_record_encryption.rb +++ b/config/initializers/active_record_encryption.rb @@ -5,7 +5,7 @@ ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY ).each do |key| - ENV.fetch(key) do + value = ENV.fetch(key) do abort <<~MESSAGE Mastodon now requires that these variables are set: @@ -14,9 +14,18 @@ - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY - Run `bin/rails db:encryption:init` to generate values and then assign the environment variables. + Run `bin/rails db:encryption:init` to generate new secrets and then assign the environment variables. MESSAGE end + + next unless Rails.env.production? && value.end_with?('DO_NOT_USE_IN_PRODUCTION') + + abort <<~MESSAGE + + It looks like you are trying to run Mastodon in production with a #{key} value from the test environment. + + Please generate fresh secrets using `bin/rails db:encryption:init` and use them instead. + MESSAGE end Rails.application.configure do diff --git a/config/initializers/opentelemetry.rb b/config/initializers/opentelemetry.rb index 9af0ab89c8698a..cf9f0b96f3bead 100644 --- a/config/initializers/opentelemetry.rb +++ b/config/initializers/opentelemetry.rb @@ -51,6 +51,9 @@ use_rack_events: false, # instead of events, use middleware; allows for untraced_endpoints to ignore child spans untraced_endpoints: ['/health'], }, + 'OpenTelemetry::Instrumentation::Sidekiq' => { + span_naming: :job_class, # Use the job class as the span name, otherwise this is the queue name and not very helpful + }, }) prefix = ENV.fetch('OTEL_SERVICE_NAME_PREFIX', 'mastodon') diff --git a/config/locales/an.yml b/config/locales/an.yml index 068a20187d6963..637aa8c8b37cdc 100644 --- a/config/locales/an.yml +++ b/config/locales/an.yml @@ -852,7 +852,6 @@ an: delete: Borrar edit_preset: Editar aviso predeterminau empty: Encara no has definiu garra preajuste d'alvertencia. - title: Editar configuración predeterminada d'avisos webhooks: add_new: Anyadir endpoint delete: Eliminar diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 02ba56d0b23213..2ca7538c324d00 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1013,7 +1013,6 @@ ar: delete: حذف edit_preset: تعديل نموذج التحذير empty: لم تحدد أي إعدادات تحذير مسبقة بعد. - title: إدارة نماذج التحذير webhooks: add_new: إضافة نقطة نهاية delete: حذف diff --git a/config/locales/ast.yml b/config/locales/ast.yml index 816858d4a09277..9e6ec6d2330cb9 100644 --- a/config/locales/ast.yml +++ b/config/locales/ast.yml @@ -400,8 +400,6 @@ ast: usable: Pue usase title: Tendencies trending: En tendencia - warning_presets: - title: Xestión d'alvertencies preconfiguraes webhooks: add_new: Amestar un estremu delete: Desaniciar diff --git a/config/locales/be.yml b/config/locales/be.yml index 13daa9897e7534..6f1f189523e61e 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -983,7 +983,6 @@ be: delete: Выдаліць edit_preset: Рэдагаваць шаблон папярэджання empty: Вы яшчэ не вызначылі ніякіх шаблонаў папярэджанняў. - title: Кіраванне шаблонамі папярэджанняў webhooks: add_new: Дадаць канцавую кропку delete: Выдаліць diff --git a/config/locales/bg.yml b/config/locales/bg.yml index f242039ed8dbf8..5aca8ad0fd3918 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -285,6 +285,7 @@ bg: update_custom_emoji_html: "%{name} обнови емоджито %{target}" update_domain_block_html: "%{name} обнови блокирането на домейна за %{target}" update_ip_block_html: "%{name} промени правило за IP на %{target}" + update_report_html: "%{name} осъвремени доклад %{target}" update_status_html: "%{name} обнови публикация от %{target}" update_user_role_html: "%{name} промени ролята %{target}" deleted_account: изтрит акаунт @@ -950,7 +951,7 @@ bg: delete: Изтриване edit_preset: Редакция на предварителните настройки empty: Все още няма предварителни настройки за предупрежденията. - title: Управление на предварителните настройки + title: Предупредителни образци webhooks: add_new: Добавяне на крайна точка delete: Изтриване diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 08fef736420556..ec32f771e929c8 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -285,6 +285,7 @@ ca: update_custom_emoji_html: "%{name} ha actualitzat l'emoji %{target}" update_domain_block_html: "%{name} ha actualitzat el bloqueig de domini per a %{target}" update_ip_block_html: "%{name} ha canviat la norma per la IP %{target}" + update_report_html: "%{name} ha actualitzat l'informe %{target}" update_status_html: "%{name} ha actualitzat l'estat de %{target}" update_user_role_html: "%{name} ha canviat el rol %{target}" deleted_account: compte eliminat @@ -950,7 +951,7 @@ ca: delete: Elimina edit_preset: Edita l'avís predeterminat empty: Encara no has definit cap preavís. - title: Gestiona les configuracions predefinides dels avisos + title: Predefinicions d'avís webhooks: add_new: Afegir extrem delete: Elimina diff --git a/config/locales/ckb.yml b/config/locales/ckb.yml index dfa035eca81cb7..93eea8273f514b 100644 --- a/config/locales/ckb.yml +++ b/config/locales/ckb.yml @@ -548,7 +548,6 @@ ckb: add_new: زیادکردنی نوێ delete: سڕینەوە edit_preset: دەستکاریکردنی ئاگاداری پێشگریمان - title: بەڕێوەبردنی ئاگادارکردنەوە پێش‌سازدان admin_mailer: new_pending_account: body: وردەکاریهەژمارە نوێیەکە لە خوارەوەیە. دەتوانیت ئەم نەرمەکالا پەسەند بکەیت یان ڕەت بکەیتەوە. diff --git a/config/locales/co.yml b/config/locales/co.yml index 7d8abcd112e6b8..6edbbc95ffb31f 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -510,7 +510,6 @@ co: add_new: Aghjunghje delete: Sguassà edit_preset: Cambià a preselezzione d'avertimentu - title: Amministrà e preselezzione d'avertimentu admin_mailer: new_pending_account: body: I ditagli di u novu contu sò quì sottu. Pudete appruvà o righjittà a dumanda. diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 56930773193a40..17c743f1de5b5e 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -984,7 +984,6 @@ cs: delete: Smazat edit_preset: Upravit předlohu pro varování empty: Zatím jste nedefinovali žádné předlohy varování. - title: Spravovat předlohy pro varování webhooks: add_new: Přidat koncový bod delete: Smazat diff --git a/config/locales/cy.yml b/config/locales/cy.yml index f96068f212b083..35ed5ade8aa913 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -297,6 +297,7 @@ cy: update_custom_emoji_html: Mae %{name} wedi diweddaru emoji %{target} update_domain_block_html: Mae %{name} wedi diweddaru bloc parth %{target} update_ip_block_html: Mae %{name} wedi newid rheol IP %{target} + update_report_html: Mae %{name} wedi diweddaru adroddiad %{target} update_status_html: Mae %{name} wedi diweddaru postiad gan %{target} update_user_role_html: Mae %{name} wedi newid rôl %{target} deleted_account: cyfrif wedi'i ddileu @@ -1018,7 +1019,7 @@ cy: delete: Dileu edit_preset: Golygu rhagosodiad rhybudd empty: Nid ydych wedi diffinio unrhyw ragosodiadau rhybudd eto. - title: Rheoli rhagosodiadau rhybudd + title: Rhagosodiadau rhybuddion webhooks: add_new: Ychwanegu diweddbwynt delete: Dileu diff --git a/config/locales/da.yml b/config/locales/da.yml index 252d0e2b580158..f37086264fd2d9 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -285,6 +285,7 @@ da: update_custom_emoji_html: "%{name} opdaterede emoji %{target}" update_domain_block_html: "%{name} opdaterede domæneblokeringen for %{target}" update_ip_block_html: "%{name} ændrede reglen for IP'en %{target}" + update_report_html: "%{name} opdaterede rapporten %{target}" update_status_html: "%{name} opdaterede indlægget fra %{target}" update_user_role_html: "%{name} ændrede %{target}-rolle" deleted_account: slettet konto @@ -950,7 +951,7 @@ da: delete: Slet edit_preset: Redigér advarselsforvalg empty: Ingen advarselsforvalg defineret endnu. - title: Håndtérr advarselsforvalg + title: Præindstillinger for advarsel webhooks: add_new: Tilføj endepunkt delete: Slet diff --git a/config/locales/de.yml b/config/locales/de.yml index b19315e3942d95..11460c3b401763 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -285,6 +285,7 @@ de: update_custom_emoji_html: "%{name} bearbeitete das Emoji %{target}" update_domain_block_html: "%{name} aktualisierte die Domain-Sperre für %{target}" update_ip_block_html: "%{name} änderte die Regel für die IP-Adresse %{target}" + update_report_html: "%{name} überarbeitete die Meldung %{target}" update_status_html: "%{name} überarbeitete einen Beitrag von %{target}" update_user_role_html: "%{name} änderte die Rolle von %{target}" deleted_account: gelöschtes Konto @@ -950,7 +951,7 @@ de: delete: Löschen edit_preset: Warnvorlage bearbeiten empty: Du hast noch keine Warnvorlagen hinzugefügt. - title: Warnvorlagen verwalten + title: Warnvorlagen webhooks: add_new: Endpunkt hinzufügen delete: Löschen diff --git a/config/locales/devise.ia.yml b/config/locales/devise.ia.yml index c68efddd07880f..e6ae6d4afbbff4 100644 --- a/config/locales/devise.ia.yml +++ b/config/locales/devise.ia.yml @@ -6,11 +6,11 @@ ia: send_instructions: Tu recipera un e-mail con instructiones pro confirmar tu adresse de e-mail in poc minutas. Per favor verifica tu dossier de spam si tu non lo recipe. send_paranoid_instructions: Si tu adresse de e-mail existe in nostre base de datos, tu recipera un e-mail con instructiones pro confirmar tu adresse de e-mail in poc minutas. Per favor verifica tu dossier de spam si tu non lo recipe. failure: - already_authenticated: Tu jam initiava le session. - inactive: Tu conto ancora non es activate. + already_authenticated: Tu ha jam aperite session. + inactive: Tu conto non es ancora activate. invalid: "%{authentication_keys} o contrasigno non valide." last_attempt: Tu ha solmente un altere tentativa ante que tu conto es serrate. - locked: Tu conto es blocate. + locked: Tu conto es serrate. not_found_in_database: "%{authentication_keys} o contrasigno non valide." omniauth_user_creation_failure: Error creante un conto pro iste identitate. pending: Tu conto es ancora sub revision. @@ -51,12 +51,12 @@ ia: explanation: Ora es possibile aperir session con solmente le adresse de e-mail e contrasigno. subject: 'Mastodon: Authentication bifactorial disactivate' subtitle: Le authentication bifactorial ha essite disactivate pro tu conto. - title: 2FA disactivate + title: A2F disactivate two_factor_enabled: explanation: Pro le apertura de session essera necessari un token generate per le application TOTP accopulate. subject: 'Mastodon: Authentication bifactorial activate' subtitle: Le authentication bifactorial ha essite activate pro tu conto. - title: 2FA activate + title: A2F activate two_factor_recovery_codes_changed: explanation: Le ancian codices de recuperation ha essite invalidate e nove codices ha essite generate. subject: 'Mastodon: Codices de recuperation regenerate' @@ -66,11 +66,11 @@ ia: subject: 'Mastodon: Instructiones pro disblocar' webauthn_credential: added: - explanation: Le sequente clave de securitate esseva addite a tu conto + explanation: Le sequente clave de securitate ha essite addite a tu conto subject: 'Mastodon: Nove clave de securitate' - title: Un nove clave de securitate esseva addite + title: Un nove clave de securitate ha essite addite deleted: - explanation: Le sequente clave de securitate esseva delite de tu conto + explanation: Le sequente clave de securitate ha essite delite de tu conto subject: 'Mastodon: Clave de securitate delite' title: Un de tu claves de securitate ha essite delite webauthn_disabled: @@ -81,18 +81,41 @@ ia: webauthn_enabled: explanation: Le authentication con claves de securitate ha essite activate pro tu conto. extra: Tu clave de securitate pote ora esser usate pro aperir session. + subject: 'Mastodon: authentication de clave de securitate activate' title: Claves de securitate activate + omniauth_callbacks: + failure: Impossibile authenticar te ab %{kind} perque “%{reason}”. + success: Authenticate con successo ab conto %{kind}. + passwords: + no_token: Tu non pote acceder iste pagina sin venir ab un email de redefinition de contrasigno. Si tu veni ab un email de redefinition de contrasigno, verifica que tu usava le integre URL fornite. + send_instructions: Si tu adresse de e-mail existe in nostre base de datos, tu recipera un ligamine de recuperation de contrasigno in tu adresse de e-mail in poc minutas. Per favor verifica tu dossier de spam si tu non lo recipe. + send_paranoid_instructions: Si tu adresse de e-mail existe in nostre base de datos, tu recipera un ligamine de recuperation de contrasigno in tu adresse de e-mail in poc minutas. Per favor verifica tu dossier de spam si tu non lo recipe. + updated: Tu contrasigno ha essite cambiate. Tu ha ora aperite session. + updated_not_active: Tu contrasigno ha essite cambiate. registrations: - destroyed: A revider! Tu conto esseva cancellate con successo. Nos spera vider te novemente tosto. - signed_up_but_pending: Un message con un ligamine de confirmation esseva inviate a tu conto de email. Post que tu clicca le ligamine, nos revidera tu application. Tu essera notificate si illo es approbate. + destroyed: A revider! Tu conto ha essite cancellate. Nos spera vider te de novo tosto. + signed_up: Benvenite! Tu te ha inscribite con successo. + signed_up_but_inactive: Tu te ha inscribite con successo. Nonobstante, nos non poteva aperir tu session perque tu conto non es ancora activate. + signed_up_but_locked: Tu te ha inscribite con successo. Nonobstante, nos non poteva aperir tu session perque tu conto es serrate. + signed_up_but_pending: Un message con un ligamine de confirmation ha essite inviate a tu adresse de email. Post que tu clicca sur le ligamine, nos revidera tu demanda. Tu essera notificate si illo es approbate. + signed_up_but_unconfirmed: Un message con un ligamine de confirmation ha essite inviate a tu adresse de e-mail. Per favor seque le ligamine pro activar tu conto. Verifica tu dossier de spam si tu non recipe iste e-mail. + update_needs_confirmation: Tu ha actualisate tu conto con successo, ma nos debe verificar tu nove adresse de e-mail. Accede a tu e-mail e seque le ligamine de confirmation pro confirmar tu nove adresse de e-mail. Verifica tu dossier de spam si tu non recipe iste e-mail. updated: Tu conto ha essite actualisate con successo. sessions: - signed_in: Connexe con successo. - signed_out: Disconnexe con successo. + already_signed_out: Session claudite con successo. + signed_in: Session aperite con successo. + signed_out: Session claudite con successo. unlocks: - unlocked: Tu conto ha essite disblocate con successo. Initia session a continuar. + send_instructions: Tu recipera un e-mail con instructiones explicante como disserrar tu conto in alcun minutas. Verifica tu dossier de spam si tu non recipe iste e-mail. + send_paranoid_instructions: Si tu conto existe, tu recipera un email con instructiones explicante como disserrar lo in alcun minutas. Verifica tu dossier de spam si tu non recipe iste e-mail. + unlocked: Tu conto ha essite disserrate con successo. Aperi session pro continuar. errors: messages: - already_confirmed: jam esseva confirmate, tenta initiar session + already_confirmed: jam esseva confirmate, tenta aperir session + confirmation_period_expired: debe esser confirmate in %{period}, per favor requesta un nove + expired: ha expirate, per favor requesta un nove not_found: non trovate - not_locked: non era blocate + not_locked: non esseva serrate + not_saved: + one: '1 error ha impedite a iste %{resource} de esser salvate:' + other: "%{count} errores ha impedite a iste %{resource} de esser salvate:" diff --git a/config/locales/devise.lt.yml b/config/locales/devise.lt.yml index ec5b852727c87a..e36e60a7588485 100644 --- a/config/locales/devise.lt.yml +++ b/config/locales/devise.lt.yml @@ -22,7 +22,7 @@ lt: action: Patvirtinti el. pašto adresą action_with_app: Patvirtinti ir grįžti į %{app} explanation: Šiuo el. pašto adresu sukūrei paskyrą %{host}. Iki jos aktyvavimo liko vienas paspaudimas. Jei tai buvo ne tu, ignoruok šį el. laišką. - explanation_when_pending: Šiuo el. pašto adresu pateikei paraišką pakvietimui į %{host}. Kai patvirtinsi savo el. pašto adresą, mes peržiūrėsime tavo paraišką. Gali prisijungti ir pakeisti savo duomenis arba ištrinti paskyrą, tačiau negalėsi naudotis daugeliu funkcijų, kol tavo paskyra nebus patvirtinta. Jei tavo paraiška bus atmesta, duomenys bus pašalinti, todėl jokių papildomų veiksmų iš tavęs nereikės. Jei tai buvo ne tu, ignoruok šį el. laišką. + explanation_when_pending: Šiuo el. pašto adresu pateikei paraišką pakvietimui į %{host}. Kai patvirtinsi savo el. pašto adresą, mes peržiūrėsime tavo paraišką. Gali prisijungti ir pakeisti savo duomenis arba ištrinti paskyrą, bet negalėsi naudotis daugeliu funkcijų, kol tavo paskyra nebus patvirtinta. Jei tavo paraiška bus atmesta, duomenys bus pašalinti, todėl jokių papildomų veiksmų iš tavęs nereikės. Jei tai buvo ne tu, ignoruok šį el. laišką. extra_html: Taip pat peržiūrėk serverio taisykles ir mūsų paslaugų teikimo sąlygas. subject: 'Mastodon: patvirtinimo instrukcijos %{instance}' title: Patvirtinti el. pašto adresą diff --git a/config/locales/doorkeeper.ia.yml b/config/locales/doorkeeper.ia.yml index dc965996810817..9c493e3d7f6e16 100644 --- a/config/locales/doorkeeper.ia.yml +++ b/config/locales/doorkeeper.ia.yml @@ -3,28 +3,40 @@ ia: activerecord: attributes: doorkeeper/application: - name: Nomine de application + name: Nomine del application + redirect_uri: URI de redirection scopes: Ambitos - website: Sito web de application + website: Sito web del application errors: models: doorkeeper/application: attributes: redirect_uri: + fragment_present: non pote continer un fragmento. invalid_uri: debe esser un URI valide. + relative_uri: debe esser un URI absolute. + secured_uri: debe esser un URI HTTPS/SSL. doorkeeper: applications: buttons: authorize: Autorisar cancel: Cancellar + destroy: Destruer edit: Modificar submit: Submitter confirmations: destroy: Es tu secur? edit: title: Modificar application + form: + error: Oops! Verifica tu formulario pro possibile errores + help: + native_redirect_uri: Usar %{native_redirect_uri} pro tests local + redirect_uri: Usar un linea per URI + scopes: Separa ambitos con spatios. Lassa vacue pro usar le ambitos predefinite. index: application: Application + callback_url: URL de retorno delete: Deler empty: Tu non ha applicationes. name: Nomine @@ -37,17 +49,22 @@ ia: show: actions: Actiones application_id: Clave del cliente + callback_urls: URLs de retorno scopes: Ambitos + secret: Secreto del application title: 'Application: %{name}' authorizations: buttons: authorize: Autorisar deny: Negar error: - title: Ocurreva un error + title: Un error ha occurrite new: + prompt_html: "%{client_name} vole haber le permission de acceder a tu conto. Illo es un application tertie. Si tu non confide in illo, alora tu non deberea autorisar lo." review_permissions: Revisionar le permissos title: Autorisation necessari + show: + title: Copia iste codice de autorisation e colla lo in le application. authorized_applications: buttons: revoke: Revocar @@ -55,11 +72,35 @@ ia: revoke: Es tu secur? index: authorized_at: Autorisate le %{date} + description_html: Ecce applicationes que pote acceder tu conto per le API. Si il ha applicationes que tu non recognosce ci, o un application que se comporta mal, tu pote revocar su accesso. last_used_at: Ultime uso in %{date} never_used: Nunquam usate scopes: Permissiones superapp: Interne title: Tu applicationes autorisate + errors: + messages: + access_denied: Le proprietario del ressource o servitor de autorisation ha refusate le requesta. + credential_flow_not_configured: Le processo de credentiales de contrasigno del proprietario del ressource ha fallite perque Doorkeeper.configure.resource_owner_from_credentials non es configurate. + invalid_client: Le authentication del cliente ha fallite perque le cliente es incognite, necun authentication de cliente es includite, o le methodo de authentication non es supportate. + invalid_grant: Le concession de autorisation fornite es invalide, expirate, revocate, non corresponde al URI de redirection usate in le requesta de autorisation, o ha essite emittite a un altere cliente. + invalid_redirect_uri: Le URI de redirection includite non es valide. + invalid_request: + missing_param: 'Parametro requirite mancante: %{value}.' + request_not_authorized: Le requesta debe esser autorisate. Un parametro requirite pro autorisar le requesta manca o non es valide. + unknown: Le requesta non include un parametro requirite, include un valor de parametro non supportate, o es alteremente mal formate. + invalid_resource_owner: Le credentiales del proprietario del ressource fornite non es valide, o le proprietario del ressource non pote esser trovate + invalid_scope: Le ambito requirite es invalide, incognite, o mal formate. + invalid_token: + expired: Le token de accesso ha expirate + revoked: Le token de accesso ha essite revocate + unknown: Le token de accesso non es valide + resource_owner_authenticator_not_configured: Impossibile trovar le proprietario del ressource perque Doorkeeper.configure.resource_owner_authenticator non es configurate. + server_error: Le servitor de autorisation ha incontrate un condition impreviste que lo ha impedite de complir le requesta. + temporarily_unavailable: Le servitor de autorisation actualmente non pote gerer le requesta a causa de un supercarga temporari o de mantenentia del servitor. + unauthorized_client: Le application non es autorisate a exequer iste requesta usante iste methodo. + unsupported_grant_type: Le typo de concession de autorisation non es supportate per le servitor de autorisation. + unsupported_response_type: Le servitor de autorisation non supporta iste typo de responsa. flash: applications: create: @@ -73,20 +114,22 @@ ia: notice: Application revocate. grouped_scopes: access: - read: Accesso de sol lectura + read: Accesso de lectura sol read/write: Accesso de lectura e scriptura - write: Accesso de sol scriptura + write: Accesso de scriptura sol title: accounts: Contos admin/accounts: Gestion de contos admin/all: Tote le functiones administrative admin/reports: Gestion de reportos - all: Accesso plen a tu conto de Mastodon + all: Accesso complete a tu conto de Mastodon blocks: Blocadas bookmarks: Marcapaginas conversations: Conversationes - favourites: Favoritos + crypto: Cryptation de puncta a puncta + favourites: Favorites filters: Filtros + follow: Sequites, silentiates e blocates follows: Sequites lists: Listas media: Annexos multimedial @@ -101,21 +144,41 @@ ia: nav: applications: Applicationes oauth2_provider: Fornitor OAuth2 + application: + title: Autorisation OAuth necessari scopes: admin:read: leger tote le datos in le servitor admin:read:accounts: leger information sensibile de tote le contos + admin:read:canonical_email_blocks: leger datos sensibile de tote le blocadas de email canonic + admin:read:domain_allows: leger informationes sensibile de tote le dominios permittite + admin:read:domain_blocks: leger informationes sensibile de tote le blocadas de dominio + admin:read:email_domain_blocks: leger informationes sensibile de tote le blocadas de dominio email + admin:read:ip_blocks: leger informationes sensibile de tote le blocadas de IP + admin:read:reports: leger information sensibile de tote le reportos e contos signalate admin:write: modificar tote le datos in le servitor + admin:write:accounts: exequer action de moderation sur contos + admin:write:canonical_email_blocks: exequer actiones de moderation sur blocadas de email canonic + admin:write:domain_allows: exequer actiones de moderation sur dominios permittite + admin:write:domain_blocks: exequer actiones de moderation sur blocadas de dominio + admin:write:email_domain_blocks: exequer actiones de moderation sur blocadas de dominio email + admin:write:ip_blocks: exequer actiones de moderation sur blocadas de IP + admin:write:reports: exequer action de moderation sur reportos + crypto: usar cryptation de extremo-a-extremo follow: modificar relationes del contos + push: reciper tu notificationes push read: leger tote le datos de tu conto read:accounts: vider informationes de conto + read:blocks: vider tu blocadas read:bookmarks: vider tu marcapaginas read:favourites: vider tu favoritos read:filters: vider tu filtros read:follows: vider tu sequites read:lists: vider tu listas read:me: leger solmente le information basic de tu conto + read:mutes: vider tu silentiates read:notifications: vider tu notificationes read:reports: vider tu reportos + read:search: cercar in tu nomine read:statuses: vider tote le messages write: modificar tote le datos de tu conto write:accounts: modificar tu profilo diff --git a/config/locales/el.yml b/config/locales/el.yml index 2e7ac87463679d..47b2250f0e04e3 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -903,7 +903,6 @@ el: delete: Διαγραφή edit_preset: Ενημέρωση προκαθορισμένης προειδοποίησης empty: Δεν έχετε ακόμη ορίσει κάποια προκαθορισμένη προειδοποίηση. - title: Διαχείριση προκαθορισμένων προειδοποιήσεων webhooks: add_new: Προσθήκη σημείου τερματισμού delete: Διαγραφή diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 7e31080dfa2c10..07eb84ebbef0a8 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -950,7 +950,6 @@ en-GB: delete: Delete edit_preset: Edit warning preset empty: You haven't defined any warning presets yet. - title: Manage warning presets webhooks: add_new: Add endpoint delete: Delete diff --git a/config/locales/en.yml b/config/locales/en.yml index c0b498a1a46ad7..f33e7913fd7cce 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -301,6 +301,7 @@ en: update_custom_emoji_html: "%{name} updated emoji %{target}" update_domain_block_html: "%{name} updated domain block for %{target}" update_ip_block_html: "%{name} changed rule for IP %{target}" + update_report_html: "%{name} updated report %{target}" update_status_html: "%{name} updated post by %{target}" update_user_role_html: "%{name} changed %{target} role" deleted_account: deleted account @@ -1223,7 +1224,7 @@ en: delete: Delete edit_preset: Edit warning preset empty: You haven't defined any warning presets yet. - title: Manage warning presets + title: Warning presets webhooks: add_new: Add endpoint delete: Delete diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 749f80687df6de..95e3dd5a8d9e03 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -919,7 +919,6 @@ eo: delete: Forigi edit_preset: Redakti avertan antaŭagordon empty: Vi ankoraŭ ne difinis iun ajn antaŭagordon de averto. - title: Administri avertajn antaŭagordojn webhooks: add_new: Aldoni finpunkton delete: Forigi diff --git a/config/locales/es-AR.yml b/config/locales/es-AR.yml index aa3668d92adbeb..d6bfb60a19649f 100644 --- a/config/locales/es-AR.yml +++ b/config/locales/es-AR.yml @@ -285,6 +285,7 @@ es-AR: update_custom_emoji_html: "%{name} actualizó el emoji %{target}" update_domain_block_html: "%{name} actualizó el bloqueo de dominio para %{target}" update_ip_block_html: "%{name} cambió la regla para la dirección IP %{target}" + update_report_html: "%{name} actualizó la denuncia %{target}" update_status_html: "%{name} actualizó el mensaje de %{target}" update_user_role_html: "%{name} cambió el rol %{target}" deleted_account: cuenta eliminada @@ -950,7 +951,7 @@ es-AR: delete: Eliminar edit_preset: Editar preajuste de advertencia empty: Aún no ha definido ningún preajuste de advertencia. - title: Administrar preajustes de advertencia + title: Preajustes de advertencia webhooks: add_new: Agregar punto final delete: Eliminar diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index 6a306b07b061f5..8f4aa183d833a4 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -285,6 +285,7 @@ es-MX: update_custom_emoji_html: "%{name} actualizó el emoji %{target}" update_domain_block_html: "%{name} actualizó el bloqueo de dominio para %{target}" update_ip_block_html: "%{name} cambió la regla para la IP %{target}" + update_report_html: "%{name} actualizó el informe %{target}" update_status_html: "%{name} actualizó el estado de %{target}" update_user_role_html: "%{name} cambió el rol %{target}" deleted_account: cuenta eliminada @@ -950,7 +951,7 @@ es-MX: delete: Borrar edit_preset: Editar aviso predeterminado empty: Aún no has definido ningún preajuste de advertencia. - title: Editar configuración predeterminada de avisos + title: Preajustes de advertencia webhooks: add_new: Añadir endpoint delete: Eliminar diff --git a/config/locales/es.yml b/config/locales/es.yml index e7db7c8b04d439..343f6f5a6363fb 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -285,6 +285,7 @@ es: update_custom_emoji_html: "%{name} actualizó el emoji %{target}" update_domain_block_html: "%{name} actualizó el bloqueo de dominio para %{target}" update_ip_block_html: "%{name} cambió la regla para la IP %{target}" + update_report_html: "%{name} actualizó el informe %{target}" update_status_html: "%{name} actualizó la publicación de %{target}" update_user_role_html: "%{name} cambió el rol %{target}" deleted_account: cuenta eliminada @@ -950,7 +951,7 @@ es: delete: Borrar edit_preset: Editar aviso predeterminado empty: Aún no has definido ningún preajuste de advertencia. - title: Editar configuración predeterminada de avisos + title: Preajustes de advertencia webhooks: add_new: Añadir endpoint delete: Eliminar diff --git a/config/locales/et.yml b/config/locales/et.yml index a544d8063dbb32..172aad25b93ea6 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -949,7 +949,6 @@ et: delete: Kustuta edit_preset: Hoiatuse eelseadistuse muutmine empty: Hoiatuste eelseadeid pole defineeritud. - title: Halda hoiatuste eelseadistusi webhooks: add_new: Lisa lõpp-punkt delete: Kustuta diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 22ca8135d51262..67da357e1de98d 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -952,7 +952,6 @@ eu: delete: Ezabatu edit_preset: Editatu abisu aurre-ezarpena empty: Ez duzu abisu aurrezarpenik definitu oraindik. - title: Kudeatu abisu aurre-ezarpenak webhooks: add_new: Gehitu amaiera-puntua delete: Ezabatu diff --git a/config/locales/fa.yml b/config/locales/fa.yml index d93d2e7d5f1096..509d69fcba71c8 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -808,7 +808,6 @@ fa: delete: زدودن edit_preset: ویرایش هشدار پیش‌فرض empty: هنز هیچ پیش‌تنظیم هشداری را تعریف نکرده‌اید. - title: مدیریت هشدارهای پیش‌فرض webhooks: add_new: افزودن نقطهٔ پایانی delete: حذف diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 5f96f611b403c2..3a75066d5bd39a 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -285,6 +285,7 @@ fi: update_custom_emoji_html: "%{name} päivitti emojin %{target}" update_domain_block_html: "%{name} päivitti verkkotunnuksen %{target} eston" update_ip_block_html: "%{name} muutti sääntöä IP-osoitteelle %{target}" + update_report_html: "%{name} päivitti raportin %{target}" update_status_html: "%{name} päivitti käyttäjän %{target} julkaisun" update_user_role_html: "%{name} muutti roolia %{target}" deleted_account: poisti tilin @@ -950,7 +951,6 @@ fi: delete: Poista edit_preset: Muokkaa varoituksen esiasetusta empty: Et ole vielä määrittänyt yhtäkään varoitusten esiasetusta. - title: Hallitse varoitusten esiasetuksia webhooks: add_new: Lisää päätepiste delete: Poista diff --git a/config/locales/fo.yml b/config/locales/fo.yml index f7303c512ac686..0372d3dca3e875 100644 --- a/config/locales/fo.yml +++ b/config/locales/fo.yml @@ -285,6 +285,7 @@ fo: update_custom_emoji_html: "%{name} dagførdi kensluteknið %{target}" update_domain_block_html: "%{name} dagførdi navnaøkisblokeringina hjá %{target}" update_ip_block_html: "%{name} broytti IP-reglurnar %{target}" + update_report_html: "%{name} dagførdi meldingina %{target}" update_status_html: "%{name} dagførdi postin hjá %{target}" update_user_role_html: "%{name} broyttir %{target} leiklutir" deleted_account: strikað konta @@ -950,7 +951,7 @@ fo: delete: Strika edit_preset: Rætta ávaringar-undanstilling empty: Tú hevur ikki ásett nakrar ávaringar-undanstillingar enn. - title: Stýr ávaringar-undanstillingar + title: Undanstillingar fyri ávaring webhooks: add_new: Legg endapunkt afturat delete: Strika diff --git a/config/locales/fr-CA.yml b/config/locales/fr-CA.yml index 05d6b8864d8d4a..f297e8bfdea780 100644 --- a/config/locales/fr-CA.yml +++ b/config/locales/fr-CA.yml @@ -949,7 +949,6 @@ fr-CA: delete: Supprimer edit_preset: Éditer les avertissements prédéfinis empty: Vous n'avez pas encore créé de paramètres prédéfinis pour les avertissements. - title: Gérer les avertissements prédéfinis webhooks: add_new: Ajouter un point de terminaison delete: Supprimer diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 6ab42088014fcb..33cdcd44cc5477 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -949,7 +949,6 @@ fr: delete: Supprimer edit_preset: Éditer les avertissements prédéfinis empty: Vous n'avez pas encore créé de paramètres prédéfinis pour les avertissements. - title: Gérer les avertissements prédéfinis webhooks: add_new: Ajouter un point de terminaison delete: Supprimer diff --git a/config/locales/fy.yml b/config/locales/fy.yml index 1f1a27fec4b41c..c8e287732a7c54 100644 --- a/config/locales/fy.yml +++ b/config/locales/fy.yml @@ -949,7 +949,6 @@ fy: delete: Fuortsmite edit_preset: Foarynstelling foar warskôging bewurkje empty: Jo hawwe noch gjin foarynstellingen foar warskôgingen tafoege. - title: Foarynstellingen foar warskôgingen beheare webhooks: add_new: Einpunt tafoegje delete: Fuortsmite diff --git a/config/locales/gd.yml b/config/locales/gd.yml index 70bace05cf43a2..52b25e28543dd8 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -983,7 +983,6 @@ gd: delete: Sguab às edit_preset: Deasaich rabhadh ro-shuidhichte empty: Cha do mhìnich thu ro-sheataichean rabhaidhean fhathast. - title: Stiùirich na rabhaidhean ro-shuidhichte webhooks: add_new: Cuir puing-dheiridh ris delete: Sguab às diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 57af7c82c030db..a8489e425fe39c 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -285,6 +285,7 @@ gl: update_custom_emoji_html: "%{name} actualizou o emoji %{target}" update_domain_block_html: "%{name} actualizou o bloqueo do dominio para %{target}" update_ip_block_html: "%{name} cambiou a regra para IP %{target}" + update_report_html: "%{name} actualizou a denuncia %{target}" update_status_html: "%{name} actualizou a publicación de %{target}" update_user_role_html: "%{name} cambiou o rol %{target}" deleted_account: conta eliminada @@ -950,7 +951,7 @@ gl: delete: Eliminar edit_preset: Editar aviso preestablecido empty: Non definiches os avisos prestablecidos. - title: Xestionar avisos preestablecidos + title: Preestablecidos de advertencia webhooks: add_new: Engadir punto de extremo delete: Eliminar diff --git a/config/locales/he.yml b/config/locales/he.yml index 14da27ec75e281..9088f48218c273 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -291,6 +291,7 @@ he: update_custom_emoji_html: "%{name} עדכן/ה אמוג'י %{target}" update_domain_block_html: "%{name} עדכן/ה חסימת דומיין עבור %{target}" update_ip_block_html: "%{name} שינה כלל עבור IP %{target}" + update_report_html: '%{name} עדכן/ה דו"ח %{target}' update_status_html: "%{name} עדכן/ה הודעה של %{target}" update_user_role_html: "%{name} שינה את התפקיד של %{target}" deleted_account: חשבון מחוק @@ -984,7 +985,7 @@ he: delete: למחוק edit_preset: ערוך/י טקסט מוכן מראש לאזהרה empty: לא הגדרת עדיין שום טקסט מוכן מראש לאזהרה. - title: ניהול טקסטים מוכנים מראש לאזהרות + title: תצורת אזהרות webhooks: add_new: הוספת נקודת קצה delete: מחיקה diff --git a/config/locales/hu.yml b/config/locales/hu.yml index c48d527cafa74f..d79bca7ff75793 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -285,6 +285,7 @@ hu: update_custom_emoji_html: "%{name} frissítette az emodzsit: %{target}" update_domain_block_html: "%{name} frissítette a %{target} domain tiltását" update_ip_block_html: "%{name} módosította a(z) %{target} IP-címre vonatkozó szabályt" + update_report_html: "%{name} frissítette a %{target} bejelentést" update_status_html: "%{name} frissítette %{target} felhasználó bejegyzését" update_user_role_html: "%{name} módosította a(z) %{target} szerepkört" deleted_account: törölt fiók @@ -950,7 +951,7 @@ hu: delete: Törlés edit_preset: Figyelmeztetés szerkesztése empty: Nem definiáltál még egyetlen figyelmeztetést sem. - title: Figyelmeztetések + title: Figyelmeztető szövegek webhooks: add_new: Végpont hozzáadása delete: Törlés diff --git a/config/locales/ia.yml b/config/locales/ia.yml index 68676a09f73957..f8834136b9ca27 100644 --- a/config/locales/ia.yml +++ b/config/locales/ia.yml @@ -285,6 +285,7 @@ ia: update_custom_emoji_html: "%{name} actualisava le emoticone %{target}" update_domain_block_html: "%{name} actualisava le blocada de dominio pro %{target}" update_ip_block_html: "%{name} cambiava le regula pro IP %{target}" + update_report_html: "%{name} actualisava le reporto %{target}" update_status_html: "%{name} actualisava le message per %{target}" update_user_role_html: "%{name} cambiava le rolo de %{target}" deleted_account: conto delite @@ -950,7 +951,7 @@ ia: delete: Deler edit_preset: Rediger aviso predefinite empty: Tu non ha ancora definite alcun avisos predefinite. - title: Gerer avisos predefinite + title: Predefinitiones de avisos webhooks: add_new: Adder terminal delete: Deler @@ -973,6 +974,7 @@ ia: webhook: Crocs web admin_mailer: auto_close_registrations: + body: Per un carentia recente de activate de moderator, le registrationes sur %{instance} ha essite automaticamente mutate a besoniante revision manual, pro impedir %{instance} de esser usate como un platteforma pro potential mal actores. Tu pote mutar lo retro pro sempre aperir le registrationes. subject: Le registrationes pro %{instance} ha essite automaticamente mutate a besoniante de approbation new_appeal: actions: @@ -1054,19 +1056,27 @@ ia: clicking_this_link: cliccante iste ligamine login_link: acceder proceed_to_login_html: Ora tu pote continuar a %{login_link}. + redirect_to_app_html: Tu deberea haber essite re-dirigite al app %{app_name}. Si isto non eveni, tenta %{clicking_this_link} o manualmente retorna al app. + registration_complete: Tu registration sur %{domain} es ora complete! welcome_title: Benvenite, %{name}! + wrong_email_hint: Si ille adresse email non es correcte, tu pote cambiar lo in parametros de conto. delete_account: Deler le conto + delete_account_html: Si tu vole a dele tu conto, tu pote continuar ci. Te sera demandate confirmation. description: + prefix_invited_by_user: "@%{name} te invita a junger te a iste servitor de Mastodon!" prefix_sign_up: Inscribe te sur Mastodon hodie! + suffix: Con un conto, tu potera sequer personas, messages de actualisation e excambios de messages con usatores de ulle servitor de Mastodon e plus! didnt_get_confirmation: Non recipeva tu un ligamine de confirmation? dont_have_your_security_key: Non ha tu le clave de securitate? forgot_password: Contrasigno oblidate? invalid_reset_password_token: Pete un nove. + link_to_otp: Insere un codice a duo factores o un codice de recuperation ab tu telephono link_to_webauth: Usa tu apparato clave de securitate log_in_with: Accede con login: Accede logout: Clauder le session migrate_account: Move a un conto differente + migrate_account_html: Si tu vole re-adressar iste conto a un altere, tu pote configurar lo ci. or_log_in_with: O accede con privacy_policy_agreement_html: Io ha legite e acceptar le politica de confidentialitate progress: @@ -1192,6 +1202,7 @@ ia: invalid_domain: non es un nomine de dominio valide edit_profile: basic_information: Information basic + hint_html: "Personalisa lo que le personas vide sur tu profilo public e presso tu messages. Il es plus probabile que altere personas te seque e interage con te quando tu ha un profilo compilate e un photo de profilo." other: Alteres errors: '400': Le requesta que tu inviava era non valide o mal formate. @@ -1230,6 +1241,7 @@ ia: add_new: Adder nove errors: limit: Tu ha jam consiliate le maxime numero de hashtags + hint_html: "Consilia tu plus importante hashtags sur tu profilo. Un grande instrumento pro tener tracia de tu labores creative e projectos de longe-tempore, le hashtags consiliate es monstrate prominentemente sur tu profilo e permitte accesso rapide a tu proprie messages." filters: contexts: account: Profilos @@ -1241,8 +1253,10 @@ ia: add_keyword: Adder parola clave keywords: Parolas clave statuses: Messages individual + statuses_hint_html: Iste filtro se applica a seliger messages singule sin reguardo si illes concorda le parolas clave infra. Revide o remove le messages ab le filtro. title: Modificar filtro errors: + deprecated_api_multiple_keywords: Iste parametros non pote esser cambiate ab iste application perque illos se applica a plus que un sol parola clave del filtro. Usa un application plus recente o le interfacie web. invalid_context: Nulle o non valide contexto supplite index: contexts: Filtros in %{contexts} @@ -1272,6 +1286,12 @@ ia: title: Messages filtrate generic: all: Toto + all_items_on_page_selected_html: + one: "%{count} elemento sur iste pagina es seligite." + other: Tote le %{count} elementos sur iste pagina es seligite. + all_matching_items_selected_html: + one: "%{count} elemento concordante que tu cerca es seligite." + other: Tote le %{count} elementos concordante que tu cerca es seligite. cancel: Cancellar changes_saved_msg: Cambios salveguardate con successo! confirm: Confirmar @@ -1299,13 +1319,24 @@ ia: imported: Importate mismatched_types_warning: Il appare que tu pote haber seligite le typo errate pro iste importation, controla duo vices. modes: + merge: Funder + merge_long: Mantene le registrationes existente e adde illos nove + overwrite: Superscriber overwrite_long: Reimplaciar registros actual con le noves overwrite_preambles: blocking_html: Tu es sur le puncto de reimplaciar tu lista de blocadas per usque a %{total_items} contos proveniente de %{filename}. + bookmarks_html: Tu va reimplaciar tu lista de blocadas per usque a %{total_items} contos proveniente de %{filename}. domain_blocking_html: Tu es sur le puncto de reimplaciar tu lista de blocadas de dominio per usque a %{total_items} dominios proveniente de %{filename}. + following_html: Tu va sequer usque %{total_items} contos de %{filename} e cessar de sequer ulle altere. + lists_html: Tu va reimplaciar tu lista con contentos de %{filename}. Usque %{total_items} contos sera addite a nove listas. + muting_html: Tu va reimplaciar tu lista de contos silentiate con usque %{total_items} contos ab %{filename}. preambles: blocking_html: Tu es sur le puncto de blocar usque a %{total_items} contos a partir de %{filename}. + bookmarks_html: Tu va adder usque %{total_items} messages de %{filename} a tu marcapaginas. domain_blocking_html: Tu es sur le puncto de blocar usque a %{total_items} dominios a partir de %{filename}. + following_html: Tu va blocar usque a %{total_items} dominios ab %{filename}. + lists_html: Tu va adder usque %{total_items} contos ab %{filename} a tu lista. Nove listas sera create si il non ha lista a adder. + muting_html: Tu va silentiar usque %{total_items} contos ab %{filename}. preface: Tu pote importar datos que tu ha exportate de un altere servitor, como un lista de personas que tu seque o bloca. recent_imports: Importationes recente states: @@ -1348,16 +1379,30 @@ ia: expires_in_prompt: Nunquam generate: Generar ligamine de invitation invalid: Iste invitation non es valide + invited_by: 'Tu ha essite invitate per:' max_uses: one: un uso other: "%{count} usos" + max_uses_prompt: Nulle limite + prompt: Genera e comparti ligamines con alteres pro conceder accesso a iste servitor table: expires_at: Expira + uses: Usos title: Invitar personas + lists: + errors: + limit: Tu ha attingite le maxime numero de listas login_activities: authentication_methods: + otp: app pro authentication a duo factores password: contrasigno + sign_in_token: codice de securitate de e-mail webauthn: claves de securitate + description_html: Si tu vide activitate que tu non recognosce, considera de cambiar tu contrasigno e activar le authentication a duo factores. + empty: Nulle chronologia de authentication disponibile + failed_sign_in_html: Tentativa de authentication fallite con %{method} ab %{ip} (%{browser}) + successful_sign_in_html: Apertura de session con successo con %{method} ab %{ip} (%{browser}) + title: Chronologia de authentication mail_subscriptions: unsubscribe: action: Si, desubscriber @@ -1373,32 +1418,110 @@ ia: resubscribe_html: Si tu ha cancellate le subscription in error, tu pote resubscriber te a partir del parametros de notification in e-mail. success_html: Tu non recipera plus %{type} pro Mastodon sur %{domain} a tu adresse de e-mail %{email}. title: Desubcriber + media_attachments: + validations: + images_and_video: Impossibile annexar un video a un message que jam contine imagines + not_ready: Impossibile annexar un video a un message que jam contine imagines. Retenta post un momento! + too_many: Impossibile annexar plus que 4 files migrations: + acct: Movite a + cancel: Cancellar redirection + cancel_explanation: Cancellar le redirection reactivara tu conto actual, ma non reportara sequaces que ha essite movite in ille conto. + cancelled_msg: Redirection cancellate con successo. errors: + already_moved: is the same account you have already moved to + missing_also_known_as: non es un alias de iste conto move_to_self: non pote esser le conto actual not_found: non poterea esser trovate + on_cooldown: Tu es in pausa + followers_count: Sequaces a tempore de mover + incoming_migrations: Movente ab un conto differente + incoming_migrations_html: Pro mover ab un altere conto a isto, primo tu debe crear un alias de conto. + moved_msg: Tu conto ora es redirigite a %{acct} e tu sequaces es movite super. + not_redirecting: Tu conto actualmente non es redirigite a ulle altere conto. + on_cooldown: Tu recentemente ha migrate tu conto. Iste function de novo sera disponibile in %{count} dies. + past_migrations: Migrationes passate + proceed_with_move: Mover sequaces + redirected_msg: Tu conto es ora redirigite a %{acct}. + redirecting_to: Tu conto es redirigite a %{acct}. + set_redirect: Predefinir redirection + warning: + backreference_required: Le nove conto debe primo esser configurate pro referer se a isto + before: 'Ante de continuar, lege iste notas accuratemente:' + cooldown: Post le movimento il ha un periodo de pausa durante le qual tu non potera mover te ancora + disabled_account: Tu conto actual non sera plenmente usabile postea. Comocunque, tu habera accesso a exportation de datos e re-activation. + followers: Iste action movera tote le sequaces ab le conto actual al nove conto + only_redirect_html: In alternativa, tu pote solo superponer un redirection sur tu profilo. + other_data: Nulle altere datos sera movite automaticamente + redirect: Le profilo de tu conto actual sera actualisate con un aviso de redirection e sera excludite de recercas moderation: title: Moderation move_handler: carry_blocks_over_text: Iste usator ha cambiate de conto desde %{acct}, que tu habeva blocate. + carry_mutes_over_text: Iste usator moveva ab %{acct}, que tu habeva silentiate. + copy_account_note_text: 'Iste usator moveva ab %{acct}, ci era tu previe notas re ille:' + navigation: + toggle_menu: Mutar menu notification_mailer: admin: + report: + subject: "%{name} inviava un reporto" sign_up: subject: "%{name} se ha inscribite" + favourite: + body: 'Tu message era favorite per %{name}:' + subject: "%{name} favoriva tu message" + title: Nove preferito follow: + body: "%{name} ora te seque!" + subject: "%{name} ora te seque" title: Nove sequitor follow_request: + action: Gere requestas de sequer + body: "%{name} ha demandate de sequer te" + subject: 'Sequace pendente: %{name}' title: Nove requesta de sequimento mention: action: Responder + body: 'Tu era mentionate per %{name} in:' + subject: Tu ha essite mentionate per %{name} title: Nove mention poll: subject: Un inquesta de %{name} ha finite + reblog: + body: 'Tu message ha essite impulsate per %{name}:' + subject: "%{name} ha impulsate tu message" + title: Nove impulso + status: + subject: "%{name} justo ha publicate" + update: + subject: "%{name} ha modificate un message" + notifications: + administration_emails: Avisos de email per administrator + email_events: Eventos pro avisos de email + email_events_hint: 'Selige eventos pro que tu vole reciper avisos:' + number: + human: + decimal_units: + format: "%n%u" + units: + billion: B + million: M + quadrillion: Q + thousand: K + trillion: T otp_authentication: + code_hint: Insere le codice generate per tu app de authentication pro confirmar + description_html: Si tu activa le authentication a duo factores per un app de authentication, le authentication requirera que tu es in possession de tu telephono, que generara testimonios pro facer te entrar. enable: Activar + instructions_html: "Scande iste codice QR in Google Authenticator o un simile app TOTP sur tu telephono. Desde ora in avante, ille app generara testimonios que tu debera inserer quando tu te authenticara." + manual_instructions: 'Si tu non pote scander le codice QR e besonia de inserer lo manualmente, ecce le texto-simple secrete:' setup: Configurar + wrong_code: Le codice inserite non era valide! Es tempore de servitor e tempore de apparato correcte? pagination: + newer: Plus recente next: Sequente + older: Plus vetere prev: Previe truncate: "…" polls: @@ -1418,9 +1541,13 @@ ia: posting_defaults: Publicationes predefinite public_timelines: Chronologias public privacy: + hint_html: "Personalisa como tu vole que tu profilo e tu messages a es trovate. Un varietate de functiones in Mastodon pote adjutar te attinger un plus large auditorio si activate. Prende un momento pro revider iste parametros pro assecurar te que illos se adapta a tu caso de uso." privacy: Confidentialitate + privacy_hint_html: Controla quanto tu vole divulgar pro le beneficio de alteres. Le gente discoperi profilos e applicationes interessante percurrente le profilos sequite per altere personas e vidente a partir de qual applicationes illos publica lor messages, ma tu pote preferer de mantener tal information private. reach: Portata + reach_hint_html: Controla si tu vole esser discoperite e sequite per nove personas. Vole tu que tu messages appare sur le schermo Explorar? Vole tu que altere personas te vide in lor recommendationes de sequimento? Vole tu acceptar automaticamente tote le nove sequitores o prefere tu haber le controlo granular super cata un? search: Cercar + search_hint_html: Controla como tu vole esser trovate. Vole tu que le gente te trova per medio del contento de tu messages public? Vole tu que personas foras de Mastodon trova tu profilo quando illes cerca in le web? Nota ben que non es possibile garantir le exclusion total de tu information public del motores de recerca. title: Confidentialitate e portata privacy_policy: title: Politica de confidentialitate @@ -1521,35 +1648,96 @@ ia: aliases: Aliases de conto appearance: Apparentia authorized_apps: Apps autorisate + back: Tornar a Mastodon delete: Deletion de conto development: Disveloppamento edit_profile: Modificar profilo + export: Exportation de datos featured_tags: Hashtags eminente import: Importar + import_and_export: Importar e exportar migrate: Migration de conto notifications: Notificationes de e-mail preferences: Preferentias profile: Profilo public relationships: Sequites e sequitores + severed_relationships: Relationes rupte + statuses_cleanup: Deletion de message automatic strikes: Admonitiones de moderation + two_factor_authentication: Authentication a duo factores + webauthn_authentication: Claves de securitate severed_relationships: download: Discargar (%{count}) event_type: account_suspension: Suspension del conto (%{target_name}) domain_block: Suspension del servitor (%{target_name}) user_domain_block: Tu ha blocate %{target_name} + lost_followers: Sequitores perdite + lost_follows: Sequites perdite preamble: Tu pote perder sequites e sequitores quando tu bloca un dominio o quando tu moderatores decide suspender un servitor remote. Quando isto occurre, tu potera discargar listas de relationes rumpite, a inspectar e eventualmente importar in un altere servitor. + purged: Le information re iste servitor ha essite purgate per le administratores de tu servitor. type: Evento statuses: + attached: + audio: + one: "%{count} audio" + other: "%{count} audio" + description: 'Attachate: %{attached}' + image: + one: "%{count} imagine" + other: "%{count} imagines" + video: + one: "%{count} video" + other: "%{count} videos" + boosted_from_html: Impulsate desde %{acct_link} + content_warning: 'Advertimento de contento: %{warning}' + default_language: Mesme como lingua de interfacie + disallowed_hashtags: + one: 'contineva un hashtag non autorisate: %{tags}' + other: 'contineva le hashtags non autorisate: %{tags}' + edited_at_html: Modificate le %{date} + errors: + in_reply_not_found: Le message a que tu tenta responder non pare exister. open_in_web: Aperir in le web + over_character_limit: limite de characteres de %{max} excedite + pin_errors: + direct: Messages que es solo visibile a usatores mentionate non pote esser appunctate + limit: Tu ha jam appunctate le maxime numero de messages + ownership: Le message de alcuno altere non pote esser appunctate + reblog: Un impulso non pote esser affixate poll: + total_people: + one: "%{count} persona" + other: "%{count} personas" + total_votes: + one: "%{count} voto" + other: "%{count} votos" vote: Votar show_more: Monstrar plus + show_thread: Monstrar argumento + title: '%{name}: "%{quote}"' visibilities: direct: Directe + private: Solo-sequaces private_long: Solmente monstrar a sequitores public: Public + public_long: Omnes pote vider + unlisted: Non listate + unlisted_long: Omnes pote vider, ma non es listate in le chronologias public statuses_cleanup: + enabled: Deler automaticamente le messages ancian + enabled_hint: Dele automaticamente tu messages un vice que illos attinge un limine de etate specificate, salvo que illes concorda un del exceptiones infra + exceptions: Exceptiones + explanation: Pois que deler messages es un operation costose, isto es facite lentemente in le tempore quando le servitor non es alteremente occupate. Pro iste ration, tu messages pote esser delite un poco post que illos attinge le limine de etate. + ignore_favs: Ignorar favoritos + ignore_reblogs: Ignorar impulsos + interaction_exceptions: Exceptiones basate super interactiones + interaction_exceptions_explanation: Nota que il non ha garantia que le messages essera delite si illos va sub le limine de favorites o impulsos post haber lo superate un vice. + keep_direct: Mantener le messages directe + keep_direct_hint: Non dele alcuno de tu messages directe + keep_media: Mantener messages con annexos de medios + keep_media_hint: Non dele alcuno de tu messages que ha annexos de medios + keep_pinned: Mantener messages appunctate keep_pinned_hint: Non dele alcuno de tu messages appunctate keep_polls: Mantener sondages keep_polls_hint: Non dele ulle de tu sondages @@ -1567,32 +1755,94 @@ ia: '63113904': 2 annos '7889238': 3 menses min_age_label: Limine de etate + min_favs: Mantener messages favorite al minus + min_favs_hint: Non deler alcuno de tu messages que ha recipite al minus iste numero de favoritos. Lassar blanc pro deler messages sin reguardo de lor numero de favoritos + min_reblogs: Mantener messages impulsate al minus + min_reblogs_hint: Non dele alcun de tu messages que ha essite impulsate al minus iste numero de vices. Lassar vacue pro deler messages independentemente de lor numero de impulsos stream_entries: sensitive_content: Contento sensibile strikes: errors: too_late: Es troppo tarde pro facer appello contra iste admonition + tags: + does_not_match_previous_name: non concorda le nomine previe themes: contrast: Mastodon (Alte contrasto) default: Mastodon (Obscur) mastodon-light: Mastodon (Clar) system: Automatic (usar thema del systema) + time: + formats: + default: "%d %b %Y, %H:%M" + month: "%b %Y" + time: "%H:%M" + with_time_zone: "%b %d, %Y, %H:%M %Z" + translation: + errors: + quota_exceeded: Le quota de utilisation del servitor pro le servicio de traduction ha essite excedite. + too_many_requests: Il ha habite troppe requestas al servicio de traduction recentemente. two_factor_authentication: add: Adder disable: Disactivar 2FA + disabled_success: Authentication a duo factores disactivate con successo edit: Modificar + enabled: Le authentication a duo factores es activate + enabled_success: Authentication a duo factores activate con successo generate_recovery_codes: Generar codices de recuperation + lost_recovery_codes: Le codices de recuperation te permitte de reganiar accesso a tu conto si tu perde tu telephono. Si tu ha perdite tu codices de recuperation, tu pote regenerar los ci. Tu vetere codices de recuperation sera invalidate. + methods: Methodos a duo factores + otp: App de authenticator + recovery_codes: Salveguardar codices de recuperation + recovery_codes_regenerated: Codices de recuperation regenerate con successo + recovery_instructions_html: Si tu perde le accesso a tu telephono, tu pote usar un del codices de recuperation hic infra pro reganiar le accesso a tu conto. Mantene le codices de recuperation secur. Per exemplo, tu pote imprimer los e guardar los con altere documentos importante. + webauthn: Claves de securitate user_mailer: appeal_approved: action: Parametros de conto explanation: Le appello contra le admonition contra tu conto del %{strike_date}, que tu ha submittite le %{appeal_date}, ha essite approbate. Tu conto ha de novo un bon reputation. + subject: Tu appello ab %{date} ha essite approbate + subtitle: Tu conto es ancora un vice in regula. + title: Appello approbate appeal_rejected: explanation: Le appello contra le admonition contra tu conto del %{strike_date}, que tu ha submittite le %{appeal_date}, ha essite rejectate. + subject: Tu appello ab %{date} ha essite rejectate + subtitle: Tu appello ha essite rejectate. + title: Appello rejectate + backup_ready: + explanation: Tu ha requestate un copia de securitate complete de tu conto de Mastodon. + extra: Isto es preste pro discargar! + subject: Tu archivo es preste pro discargar + title: Discargar archivo + failed_2fa: + details: 'Hic es le detalios del tentativa de initio de session:' + explanation: Alcuno ha tentate aperir session a tu conto ma ha fornite un secunde factor de authentication non valide. + further_actions_html: Si non se tractava de te, nos recommenda %{action} immediatemente perque illo pote esser compromittite. + subject: Fallimento del authentication de duo factores + title: Falleva le authentication de duo factores + suspicious_sign_in: + change_password: cambiar tu contrasigno + details: 'Hic es le detalios del initio de session:' + explanation: Nos ha detegite un initio de session a tu conto ab un nove adresse IP. + further_actions_html: Si non se tractava de te, nos recommenda %{action} immediatemente e activar le authentication bifactorial pro mantener tu conto secur. + subject: Alcuno ha accedite a tu conto desde un nove adresse IP + title: Un nove initio de session warning: appeal: Submitter un appello + appeal_description: Si tu crede que se tracta de un error, tu pote presentar un appello al personal de %{instance}. categories: spam: Spam + violation: Le contento viola le sequente regulas del communitate + explanation: + delete_statuses: Alcunes de tu messages ha essite judicate contrari a un o plus directivas communitari e ha dunque essite removite per le moderatores de %{instance}. + disable: Tu non pote plus usar tu conto, ma tu profilo e altere datos remane intacte. Tu pote requestar un copia de reserva de tu datos, cambiar le parametros del conto o deler le conto. + mark_statuses_as_sensitive: Alcunes de tu messages ha essite marcate como sensibile per le moderatores de %{instance}. Isto vole dicer que le gente debe toccar le objectos multimedial in le messages ante que un previsualisation appare. Tu pote marcar objectos multimedial como sensibile tu mesme quando tu publica messages in futuro. + sensitive: A partir de iste momento, tote le files multimedial que tu incarga essera marcate como sensibile e le gente debera cliccar sur un advertimento ante de poter vider los. + silence: Tu pote ancora usar tu conto ma solmente le personas qui ja te seque videra tu messages sur iste servitor, e tu pote esser excludite de varie functiones de discoperta. Nonobstante, altere personas pote ancora sequer te manualmente. + suspend: Tu non pote plus usar tu conto, e tu profilo e altere datos non es plus accessibile. Tu pote ancora aperir session pro requestar un copia de reserva de tu datos usque lor elimination in circa 30 dies. Nos retenera certe datos de base pro impedir que tu evade le suspension. + reason: 'Ration:' + statuses: 'Message citate:' subject: + delete_statuses: Tu messages sur %{acct} esseva removite disable: Tu conto %{acct} ha essite gelate mark_statuses_as_sensitive: Tu messages sur %{acct} ha essite marcate como sensibile none: Advertimento pro %{acct} @@ -1612,20 +1862,71 @@ ia: apps_ios_action: Discargar sur le App Store apps_step: Discarga nostre applicationes official. apps_title: Applicationes de Mastodon + checklist_subtitle: 'Comencia tu aventura sur le web social:' + checklist_title: Prime passos edit_profile_action: Personalisar edit_profile_step: Impulsa tu interactiones con un profilo comprehensive. edit_profile_title: Personalisar tu profilo explanation: Ecce alcun consilios pro initiar feature_action: Apprender plus + feature_audience: Mastodon te presenta le possibilitate unic de gerer tu audientia sin intermediarios. Mastodon, installate sur tu proprie infrastructura, te permitte sequer, e esser sequite per, personas sur qualcunque altere servitor Mastodon in linea, e necuno lo controla salvo tu. feature_audience_title: Crea tu auditorio in fiducia + feature_control: Tu sape melio lo que tu vole vider sur tu fluxo de initio. Nulle algorithmos o annuncios dissipa tu tempore. Seque quicinque sur qualcunque servitor Mastodon desde un sol conto, recipe lor messages in ordine chronologic, e face te un angulo del internet ubi tu te senti a casa. + feature_control_title: Mantene le controlo de tu proprie chronologia + feature_creativity: Mastodon supporta messages con audio, video e imagines, descriptiones de accessibilitate, sondages, advertimentos de contento, avatares con animation, emojis personalisate, controlo de retalio de miniaturas, e plus, pro adjutar te a exprimer te in linea. Que tu publica tu arte, tu musica o tu podcast, Mastodon existe pro te. + feature_creativity_title: Creativitate sin parallel + feature_moderation: Mastodon remitte le controlo in tu manos. Cata servitor crea su proprie regulas e directivas, applicate localmente e non de maniera vertical como le medios social corporative, rendente lo flexibile in responder al necessitates de differente gruppos de personas. Adhere a un servitor con regulas que te place, o alberga le tue. feature_moderation_title: Moderation como deberea esser follow_action: Sequer + follow_step: Sequer personas interessante es le ration de esser de Mastodon. + follow_title: Personalisa tu fluxo de initio + follows_subtitle: Seque contos popular + follows_title: Qui sequer + follows_view_more: Vider plus de personas a sequer + hashtags_recent_count: + one: "%{people} persona in le passate duo dies" + other: "%{people} personas in le passate duo diea" + hashtags_subtitle: Explora le tendentias del passate 2 dies + hashtags_title: Hashtags in tendentia + hashtags_view_more: Vider plus de hashtags in tendentia + post_action: Scriber + post_step: Saluta le mundo con texto, photos, videos o sondages. post_title: Face tu prime message share_action: Compartir + share_step: Face saper a tu amicos como trovar te sur Mastodon. share_title: Compartir tu profilo de Mastodon + sign_in_action: Initiar session subject: Benvenite in Mastodon + title: Benvenite a bordo, %{name}! + users: + follow_limit_reached: Tu non pote sequer plus de %{limit} personas + go_to_sso_account_settings: Vader al parametros de conto de tu fornitor de identitate + invalid_otp_token: Codice de duo factores non valide + otp_lost_help_html: Si tu ha perdite le accesso a ambes, tu pote contactar %{email} + rate_limited: Troppo de tentativas de authentication. Per favor reessaya plus tarde. + seamless_external_login: Tu ha aperite session per medio de un servicio externe. Le parametros de contrasigno e de e-mail es dunque indisponibile. + signed_in_as: 'Session aperite como:' verification: + extra_instructions_html: Consilio: Le ligamine sur tu sito web pote esser invisibile. Le parte importante es rel="me" que impedi le usurpation de identitate sur sitos web con contento generate per usatores. Tu pote mesmo usar un etiquetta link in le capite del pagina in vice de a, ma le codice HTML debe esser accessibile sin executar JavaScript. + here_is_how: Ecce como + hint_html: "Omnes pote verificar lor identitate sur Mastodon. Isto es basate sur standards web aperte e es gratuite, ora e pro sempre. Tote lo que es necessari es un sito web personal que le gente recognosce como le tue. Quando tu liga a iste sito web desde tu profilo, le systema verificara que le sito web liga retro a tu profilo e monstrara un indicator visual de iste facto." + instructions_html: Copia e colla le codice hic infra in le HTML de tu sito web. Alora adde le adresse de tu sito web in un del campos supplementari sur tu profilo desde le scheda “Modificar profilo” e salva le cambiamentos. + verification: Verification verified_links: Tu ligamines verificate webauthn_credentials: add: Adder un nove clave de securitate + create: + error: Il habeva un problema in adder tu clave de securitate. Tenta novemente. + success: Tu clave de securitate ha essite addite con successo. delete: Deler + delete_confirmation: Es tu secur que tu vole deler iste clave de securitate? + description_html: Si tu activa le authentication per clave de securitate, le apertura de session requirera que tu usa un de tu claves de securitate. + destroy: + error: Il habeva un problema in deler tu clave de securitate. Tenta novemente. + success: Tu clave de securitate ha essite delite con successo. + invalid_credential: Clave de securitate non valide + nickname_hint: Insere le pseudonymo de tu nove clave de securitate + not_enabled: Tu ancora non ha activate WebAuthn + not_supported: Iste navigator non supporta claves de securitate + otp_required: Pro usar le claves de securitate activa prime le authentication de duo factores. + registered_on: Registrate le %{date} diff --git a/config/locales/id.yml b/config/locales/id.yml index bee282fa833259..aae790f4814164 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -831,7 +831,6 @@ id: delete: Hapus edit_preset: Sunting preset peringatan empty: Anda belum mendefinisikan peringatan apapun. - title: Kelola preset peringatan webhooks: add_new: Tambah titik akhir delete: Hapus diff --git a/config/locales/ie.yml b/config/locales/ie.yml index 473d7b750f6741..432e7d031b0331 100644 --- a/config/locales/ie.yml +++ b/config/locales/ie.yml @@ -950,7 +950,6 @@ ie: delete: Deleter edit_preset: Modificar prefiguration de avise empty: Vu ancor ha definit null prefigurationes de avise. - title: Modificar prefigurationes de avise webhooks: add_new: Adjunter punctu terminal delete: Deleter diff --git a/config/locales/io.yml b/config/locales/io.yml index ed0d0d6345e040..bccdcb3cc5c33b 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -928,7 +928,6 @@ io: delete: Efacez edit_preset: Modifikez avertfixito empty: Vu ne fixis irga avertfixito til nun. - title: Jerez avertfixiti webhooks: add_new: Insertez finpunto delete: Efacez diff --git a/config/locales/is.yml b/config/locales/is.yml index 2eeba976bcc30a..75950e572dccbc 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -285,6 +285,7 @@ is: update_custom_emoji_html: "%{name} uppfærði tjáningartáknið %{target}" update_domain_block_html: "%{name} uppfærði útilokun lénsins %{target}" update_ip_block_html: "%{name} breytti reglu fyrir IP-vistfangið %{target}" + update_report_html: "%{name} uppfærði kæru %{target}" update_status_html: "%{name} uppfærði færslu frá %{target}" update_user_role_html: "%{name} breytti hlutverki %{target}" deleted_account: eyddur notandaaðgangur @@ -952,7 +953,7 @@ is: delete: Eyða edit_preset: Breyta forstilltri aðvörun empty: Þú hefur ekki enn skilgreint neinar aðvaranaforstillingar. - title: Sýsla með forstilltar aðvaranir + title: Forstilltar aðvaranir webhooks: add_new: Bæta við endapunkti delete: Eyða diff --git a/config/locales/it.yml b/config/locales/it.yml index bda681ac084583..c3389f59c6bf6c 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -285,6 +285,7 @@ it: update_custom_emoji_html: "%{name} ha aggiornato emoji %{target}" update_domain_block_html: "%{name} ha aggiornato il blocco dominio per %{target}" update_ip_block_html: "%{name} ha cambiato la regola per l'IP %{target}" + update_report_html: "%{name} ha aggiornato la segnalazione %{target}" update_status_html: "%{name} ha aggiornato lo status di %{target}" update_user_role_html: "%{name} ha modificato il ruolo %{target}" deleted_account: account eliminato @@ -950,7 +951,7 @@ it: delete: Cancella edit_preset: Modifica avviso predefinito empty: Non hai ancora definito alcun avviso preimpostato. - title: Gestisci avvisi predefiniti + title: Preimpostazioni di avviso webhooks: add_new: Aggiungi endpoint delete: Elimina diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 4ed85212209f32..10727cdc9c155d 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1204,7 +1204,6 @@ ja: delete: 削除 edit_preset: プリセット警告文を編集 empty: まだプリセット警告文が作成されていません。 - title: プリセット警告文を管理 webhooks: add_new: エンドポイントを追加 delete: 削除 diff --git a/config/locales/kk.yml b/config/locales/kk.yml index f08d8ead1aa8b0..2695127f0a782f 100644 --- a/config/locales/kk.yml +++ b/config/locales/kk.yml @@ -299,7 +299,6 @@ kk: add_new: Add nеw delete: Deletе edit_preset: Edit warning prеset - title: Manage warning presеts admin_mailer: new_pending_account: body: Жаңа есептік жазба туралы мәліметтер төменде берілген. Бұл қолданбаны мақұлдауыңызға немесе қабылдамауыңызға болады. diff --git a/config/locales/ko.yml b/config/locales/ko.yml index f3f3e3a8fba7c9..9de2f6ca53cd41 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -282,6 +282,7 @@ ko: update_custom_emoji_html: "%{name} 님이 에모지 %{target}를 업데이트 했습니다" update_domain_block_html: "%{name} 님이 %{target}에 대한 도메인 차단을 갱신했습니다" update_ip_block_html: "%{name} 님이 IP 규칙 %{target}을 수정했습니다" + update_report_html: "%{name} 님이 신고 %{target}를 업데이트 했습니다" update_status_html: "%{name} 님이 %{target}의 게시물을 업데이트했습니다" update_user_role_html: "%{name} 님이 %{target} 역할을 수정했습니다" deleted_account: 계정을 삭제했습니다 @@ -935,7 +936,7 @@ ko: delete: 삭제 edit_preset: 경고 프리셋 편집 empty: 아직 어떤 경고 틀도 정의되지 않았습니다. - title: 경고 틀 관리 + title: 경고 프리셋 webhooks: add_new: 엔드포인트 추가 delete: 삭제 diff --git a/config/locales/ku.yml b/config/locales/ku.yml index 74dcd6f8f38a01..c24337dd7c05ef 100644 --- a/config/locales/ku.yml +++ b/config/locales/ku.yml @@ -849,7 +849,6 @@ ku: delete: Jê bibe edit_preset: Hişyariyên pêşsazkirî serrast bike empty: Te hin tu hişyariyên pêşsazkirî destnîşan nekirine. - title: Hişyariyên pêşsazkirî bi rêve bibe webhooks: add_new: Xala dawîbûnê tevlî bike delete: Jê bibe diff --git a/config/locales/lad.yml b/config/locales/lad.yml index e9f18d4bede648..d0657e73f99efd 100644 --- a/config/locales/lad.yml +++ b/config/locales/lad.yml @@ -285,6 +285,7 @@ lad: update_custom_emoji_html: "%{name} aktualizo el emoji %{target}" update_domain_block_html: "%{name} aktualizo el bloko de domeno para %{target}" update_ip_block_html: "\"%{name} troko la regla de IP %{target}" + update_report_html: "%{name} aktualizo el raporto %{target}" update_status_html: "%{name} aktualizo la publikasyon de %{target}" update_user_role_html: "%{name} troko el rolo %{target}" deleted_account: kuento supremido @@ -949,7 +950,6 @@ lad: delete: Efasa edit_preset: Edita avizo predeterminado empty: Ainda no tienes definido ningun avizo predeterminado. - title: Edita konfigurasyon predeterminada de avizos webhooks: add_new: Adjusta endpoint delete: Efasa diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 552afa83014561..8e32ed07bde719 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -451,7 +451,7 @@ lt: filter: all: Visi available: Pasiekiamas - expired: Pasibaigęs + expired: Nebegaliojantis title: Filtras title: Kvietimai relays: @@ -505,9 +505,15 @@ lt: unresolved: Neišspręsti updated_at: Atnaujinti roles: + categories: + invites: Kvietimai everyone: Numatytieji leidimai everyone_full_description_html: Tai – bazinis vaidmuo, turintis įtakos visiems naudotojams, net ir tiems, kurie neturi priskirto vaidmens. Visi kiti vaidmenys iš jo paveldi teises. privileges: + invite_users: Kviesti naudotojus + invite_users_description: Leidžia naudotojams pakviesti naujus žmones į serverį. + manage_invites: Tvarkyti kvietimus + manage_invites_description: Leidžia naudotojams naršyti ir deaktyvuoti kvietimų nuorodas. manage_taxonomies_description: Leidžia naudotojams peržiūrėti tendencingą turinį ir atnaujinti saitažodžių nustatymus settings: captcha_enabled: @@ -522,12 +528,34 @@ lt: registrations: moderation_recommandation: Prieš atidarant registraciją visiems, įsitikink, kad turi tinkamą ir reaguojančią prižiūrėjimo komandą! software_updates: - description: Rekomenduojama nuolat atnaujinti Mastodon diegyklę, kad galėtum naudotis naujausiais pataisymais ir funkcijomis. Be to, kartais labai svarbu laiku naujinti Mastodon, kad būtų išvengta saugumo problemų. Dėl šių priežasčių Mastodon kas 30 minučių tikrina, ar yra atnaujinimų, ir praneša tau apie tai pagal tavo el. pašto pranešimų parinktis. + description: Rekomenduojama nuolat atnaujinti Mastodon diegyklę, kad galėtum naudotis naujausiais pataisymais ir funkcijomis. Be to, kartais labai svarbu laiku atnaujinti Mastodon, kad būtų išvengta saugumo problemų. Dėl šių priežasčių Mastodon kas 30 minučių tikrina, ar yra naujinimų, ir praneša tau apie tai pagal tavo el. pašto pranešimų parinktis. + documentation_link: Sužinoti daugiau + release_notes: Leidimo informacija + title: Galimi naujinimai + type: Tipas + types: + major: Pagrindinis leidimas + minor: Nedidelis leidimas + patch: Pataiso leidimas – riktų taisymai ir lengvai pritaikomi pakeitimai + version: Versija statuses: + account: Autorius (-ė) + application: Programa back_to_account: Grįžti į paskyros puslapį + back_to_report: Grįžti į ataskaitos puslapį + batch: + remove_from_report: Pašalinti iš ataskaitos + deleted: Ištrinta + favourites: Mėgstami + history: Versijų istorija + in_reply_to: Atsakydant į + language: Kalba media: title: Medija - no_status_selected: Jokie statusai nebuvo pakeisti, nes niekas nepasirinkta + metadata: Metaduomenys + no_status_selected: Jokie įrašai nebuvo pakeisti, nes nė vienas buvo pasirinktas + open: Atidaryti įrašą + original_status: Originalus įrašas title: Paskyros statusai trending: Tendencinga with_media: Su medija @@ -537,6 +565,7 @@ lt: elasticsearch_preset: message_html: Tavo Elasticsearch klasteris turi daugiau nei vieną mazgą, bet Mastodon nėra sukonfigūruotas juos naudoti. elasticsearch_preset_single_node: + action: Žiūrėti dokumentaciją message_html: Tavo Elasticsearch klasteris turi tik vieną mazgą, ES_PRESET turėtų būti nustatyta į single_node_cluster. title: Administracija trends: @@ -571,8 +600,20 @@ lt: disallow_account: Neleisti autorių (-ę) no_status_selected: Jokie tendencingi įrašai nebuvo pakeisti, nes nė vienas iš jų nebuvo pasirinktas not_discoverable: Autorius (-ė) nesutiko, kad būtų galima juos atrasti + shared_by: + few: Bendrinta arba pamėgta %{friendly_count} kartus + many: Bendrinta arba pamėgta %{friendly_count} karto + one: Bendrinta arba pamėgta vieną kartą + other: Bendrinta arba pamėgta %{friendly_count} kartų title: Tendencingi įrašai tags: + dashboard: + tag_accounts_measure: unikalūs naudojimai + tag_languages_dimension: Populiariausios kalbos + tag_servers_dimension: Populiariausi serveriai + tag_servers_measure: skirtingi serveriai + tag_uses_measure: bendri naudojimai + listable: Gali būti siūloma not_trendable: Nepasirodys tendencijose title: Tendencingos saitažodžiai trendable: Gali pasirodyti tendencijose @@ -583,7 +624,6 @@ lt: add_new: Pridėti naują delete: Ištrinti edit_preset: Keisti įspėjimo nustatymus - title: Valdyti įspėjimo nustatymus webhooks: description_html: "Webhook leidžia Mastodon siųsti realaus laiko pranešimus apie pasirinktus įvykius į tavo programą, kad programa galėtų automatiškai paleisti reakcijas." events: Įvykiai @@ -618,7 +658,7 @@ lt: settings: 'Keisti el. pašto nuostatas: %{link}' view: 'Peržiūra:' view_profile: Peržiurėti profilį - view_status: Peržiūrėti statusą + view_status: Peržiūrėti įrašą applications: created: Aplikacija sėkmingai sukurta destroyed: Aplikacija sėkmingai ištrinta @@ -627,21 +667,32 @@ lt: warning: Būkite atsargūs su šia informacija. Niekada jos nesidalinkite! your_token: Tavo prieigos raktas auth: + confirmations: + welcome_title: Sveiki, %{name}! delete_account: Ištrinti paskyrą delete_account_html: Jeigu norite ištrinti savo paskyrą, galite eiti čia. Jūsų prašys patvirtinti pasirinkimą. + description: + prefix_invited_by_user: "@%{name} kviečia prisijungti prie šio Mastodon serverio!" + prefix_sign_up: Užsiregistruok Mastodon šiandien! + didnt_get_confirmation: Negavai patvirtinimo nuorodos? dont_have_your_security_key: Neturi saugumo rakto? - forgot_password: Pamiršote slaptažodį? - invalid_reset_password_token: Slaptažodžio atkūrimo žetonas netinkamas arba jo galiojimo laikas pasibaigęs. Prašykite naujo žetono. + forgot_password: Pamiršai slaptažodį? + invalid_reset_password_token: Slaptažodžio atkūrimo raktas yra netinkamas arba nebegaliojantis. Paprašyk naujo. + log_in_with: Prisijungti su login: Prisijungti logout: Atsijungti migrate_account: Prisijungti prie kitos paskyros migrate_account_html: Jeigu norite nukreipti šią paskyrą į kita, galite tai konfiguruoti čia. or_log_in_with: Arba prisijungti su + providers: + cas: CAS + saml: SAML register: Užsiregistruoti reset_password: Atstatyti slaptažodį rules: invited_by: 'Gali prisijungti prie %{domain} pagal kvietimą, kurį gavai iš:' preamble_invited: Prieš tęsiant, atsižvelk į pagrindines taisykles, kurias nustatė %{domain} prižiūrėtojai. + title_invited: Esi pakviestas. security: Apsauga set_new_password: Nustatyti naują slaptažodį status: @@ -673,6 +724,9 @@ lt: success_msg: Tavo paskyra buvo sėkmingai ištrinta disputes: strikes: + created_at: Data + title_actions: + none: Įspėjimas your_appeal_approved: Tavo apeliacija buvo patvirtinta your_appeal_pending: Pateikei apeliaciją your_appeal_rejected: Tavo apeliacija buvo atmesta @@ -699,6 +753,8 @@ lt: request: Prašyti savo archyvo size: Dydis blocks: Jūs blokuojate + bookmarks: Žymės + csv: CSV domain_blocks: Domeno blokai lists: Sąrašai mutes: Jūs tildote @@ -708,11 +764,14 @@ lt: hint_html: "Savo profilyje parodyk svarbiausius saitažodžius. Tai puikus įrankis kūrybiniams darbams ir ilgalaikiams projektams sekti, todėl svarbiausios saitažodžiai rodomi matomoje vietoje profilyje ir leidžia greitai pasiekti tavo paties įrašus." filters: contexts: - home: Namų laiko juosta - notifications: Priminimai + account: Profiliai + home: Pagrindinis ir sąrašai + notifications: Pranešimai public: Viešieji laiko skalės thread: Pokalbiai edit: + add_keyword: Pridėti raktažodį + keywords: Raktažodžiai title: Keisti filtrą errors: invalid_context: Jokio arba netinkamas pateiktas kontekstas @@ -726,9 +785,14 @@ lt: all: Visi changes_saved_msg: Pakeitimai sėkmingai išsaugoti! copy: Kopijuoti + delete: Ištrinti + deselect: Panaikinti visus žymėjimus order_by: Tvarkyti pagal save_changes: Išsaugoti pakeitimus + today: šiandien imports: + errors: + too_large: Failas per didelis. modes: merge: Sulieti merge_long: Išsaugoti esančius įrašus ir pridėti naujus @@ -744,7 +808,7 @@ lt: upload: Įkelti invites: delete: Deaktyvuoti - expired: Pasibaigė + expired: Nebegaliojantis expires_in: '1800': 30 minučių '21600': 6 valandų @@ -753,32 +817,33 @@ lt: '604800': 1 savaitės '86400': 1 dienos expires_in_prompt: Niekada - generate: Generuoti + generate: Generuoti kvietimo nuorodą invalid: Šis kvietimas negalioja. - invited_by: 'Jus pakvietė:' + invited_by: 'Tave pakvietė:' max_uses: few: "%{count} naudojimai" many: "%{count} naudojimo" one: 1 naudojimas other: "%{count} naudojimų" - max_uses_prompt: Nėra limito + max_uses_prompt: Nėra ribojimo prompt: Generuok ir bendrink nuorodas su kitais, kad suteiktum prieigą prie šio serverio table: expires_at: Baigsis uses: Naudojimai - title: Pakviesti žmones + title: Kviesti žmones media_attachments: validations: images_and_video: Negalima pridėti video prie statuso, kuris jau turi nuotrauką too_many: Negalima pridėti daugiau nei 4 failų migrations: - acct: slapyvardis@domenas naujam vartotojui + acct: Perkelta į + cancel: Atšaukti nukreipimą moderation: - title: Moderacija + title: Prižiūrėjimas notification_mailer: favourite: - body: 'Jūsų statusą pamėgo %{name}:' - subject: "%{name} pamėgo Jūsų statusą" + body: 'Tavo įrašą pamėgo %{name}:' + subject: "%{name} pamėgo tavo įrašą" title: Naujas mėgstamas follow: body: "%{name} pradėjo jus sekti!" @@ -801,11 +866,19 @@ lt: notifications: email_events: Įvykiai, skirti el. laiško pranešimams email_events_hint: 'Pasirink įvykius, apie kuriuos nori gauti pranešimus:' + number: + human: + decimal_units: + units: + billion: mlrd. + million: mln. + thousand: tūkst. pagination: newer: Naujesnis next: Kitas older: Senesnis prev: Ankstesnis + truncate: "…" preferences: other: Kita posting_defaults: Skelbimo numatytosios nuostatos @@ -829,6 +902,7 @@ lt: dormant: Neaktyvus followers: Sekėjai following: Sekama + invited: Pakviestas last_active: Paskutinį kartą aktyvus most_recent: Naujausias moved: Perkelta @@ -851,24 +925,35 @@ lt: date: Data description: "%{browser} ant %{platform}" explanation: Čia rodomos web naršyklės prijungtos prie Jūsų Mastodon paskyros. + ip: IP platforms: + adobe_air: Adobe Air android: Android + blackberry: BlackBerry + chrome_os: ChromeOS + firefox_os: Firefox OS ios: iOS kai_os: KaiOS + linux: Linux mac: macOS + unknown_platform: Nežinoma platforma windows: Windows windows_mobile: Windows Mobile windows_phone: Windows Phone - revoke: Atšaukti + revoke: Naikinti revoke_success: Seansas sėkmingai panaikintas. title: Seansai settings: - authorized_apps: Autorizuotos aplikacijos + account: Paskyra + account_settings: Paskyros nustatymai + aliases: Paskyros pseudonimai + appearance: Išvaizda + authorized_apps: Leidžiamos programėlės back: Grįžti į Mastodon delete: Paskyros trynimas - development: Plėtojimas - edit_profile: Keisti profilį - export: Informacijos eksportas + development: Kūrimas + edit_profile: Redaguoti profilį + export: Duomenų eksportas featured_tags: Rodomi saitažodžiai import: Importuoti migrate: Paskyros migracija @@ -879,10 +964,22 @@ lt: severed_relationships: Nutrūkę sąryšiai two_factor_authentication: Dviejų veiksnių autentikacija severed_relationships: + download: Atsisiųsti (%{count}) preamble: Užblokavus domeną arba prižiūrėtojams nusprendus pristabdyti nuotolinio serverio veiklą, gali prarasti sekimus ir sekėjus. Kai taip atsitiks, galėsi atsisiųsti nutrauktų sąryšių sąrašus, kad juos patikrinti ir galbūt importuoti į kitą serverį. + type: Įvykis statuses: attached: + audio: + few: "%{count} garso įrašai" + many: "%{count} garso įrašo" + one: "%{count} garso įrašas" + other: "%{count} garso įrašų" description: 'Pridėta: %{attached}' + image: + few: "%{count} vaizdai" + many: "%{count} vaizdo" + one: "%{count} vaizdas" + other: "%{count} vaizdų" boosted_from_html: Pakelta iš %{acct_link} content_warning: 'Turinio įspėjimas: %{warning}' open_in_web: Atidaryti naudojan Web @@ -891,11 +988,14 @@ lt: limit: Jūs jau prisegėte maksimalų toot'ų skaičų ownership: Kitų vartotojų toot'ai negali būti prisegti reblog: Pakeltos žinutės negali būti prisegtos - show_more: Daugiau + poll: + vote: Balsuoti + show_more: Rodyti daugiau + show_thread: Rodyti giją visibilities: private: Tik sekėjams private_long: rodyti tik sekėjams - public: Viešas + public: Vieša public_long: visi gali matyti unlisted: Neįtrauktas į sąrašus unlisted_long: matyti gali visi, bet nėra išvardyti į viešąsias laiko skales @@ -904,6 +1004,7 @@ lt: keep_polls_hint: Neištrina jokių tavo apklausų keep_self_bookmark: Laikyti įrašus, kuriuos pažymėjai keep_self_bookmark_hint: Neištrina tavo pačių įrašų, jei esi juos pažymėjęs (-usi) + keep_self_fav_hint: Neištrina tavo pačių įrašų, jei esi juos pamėgęs (-usi) stream_entries: sensitive_content: Jautrus turinys themes: @@ -912,7 +1013,8 @@ lt: mastodon-light: Mastodon (šviesi) system: Automatinis (naudoti sistemos temą) two_factor_authentication: - disable: Išjungti + add: Pridėti + disable: Išjungti 2FA enabled: Dviejų veiksnių autentikacija įjungta enabled_success: Dviejų veiksnių autentikacija sėkmingai įjungta generate_recovery_codes: Sugeneruoti atkūrimo kodus diff --git a/config/locales/lv.yml b/config/locales/lv.yml index f4f0aa9db27742..5a071eba863e84 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -961,7 +961,6 @@ lv: delete: Dzēst edit_preset: Labot iepriekš iestatītus brīdinājumus empty: Tu vēl neesi definējis iepriekš iestatītos brīdinājumus. - title: Pārvaldīt brīdinājuma iestatījumus webhooks: add_new: Pievienot galapunktu delete: Dzēst diff --git a/config/locales/ms.yml b/config/locales/ms.yml index f39c26a5c10baa..a778d0c28f1491 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -924,7 +924,6 @@ ms: delete: Padam edit_preset: Edit pratetap amaran empty: Anda belum menentukan sebarang pratetap amaran lagi. - title: Urus pratetap amaran webhooks: add_new: Tambah titik akhir delete: Padam diff --git a/config/locales/my.yml b/config/locales/my.yml index 4ac9ecdd45ba9d..f28458360b5b3b 100644 --- a/config/locales/my.yml +++ b/config/locales/my.yml @@ -909,7 +909,6 @@ my: delete: ဖျက်ပါ edit_preset: ကြိုသတိပေးချက်ကို ပြင်ဆင်ပါ empty: ကြိုသတိပေးချက်များကို မသတ်မှတ်ရသေးပါ။ - title: ကြိုသတိပေးချက်များကို စီမံပါ webhooks: add_new: ဆုံးမှတ် ထည့်ပါ delete: ဖျက်ပါ diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 74dea29b0e3558..a527fdb5a7009a 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -285,6 +285,7 @@ nl: update_custom_emoji_html: Emoji %{target} is door %{name} bijgewerkt update_domain_block_html: "%{name} heeft de domeinblokkade bijgewerkt voor %{target}" update_ip_block_html: "%{name} wijzigde de IP-regel voor %{target}" + update_report_html: Rapportage %{target} is door %{name} bijgewerkt update_status_html: "%{name} heeft de berichten van %{target} bijgewerkt" update_user_role_html: "%{name} wijzigde de rol %{target}" deleted_account: verwijderd account @@ -950,7 +951,7 @@ nl: delete: Verwijderen edit_preset: Preset voor waarschuwing bewerken empty: Je hebt nog geen presets voor waarschuwingen toegevoegd. - title: Presets voor waarschuwingen beheren + title: Presets voor waarschuwingen webhooks: add_new: Eindpunt toevoegen delete: Verwijderen diff --git a/config/locales/nn.yml b/config/locales/nn.yml index 013674ca514133..9291ba2c2c9477 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -950,7 +950,6 @@ nn: delete: Slett edit_preset: Endr åtvaringsoppsett empty: Du har ikke definert noen forhåndsinnstillinger for advarsler enda. - title: Handsam åtvaringsoppsett webhooks: add_new: Legg til endepunkt delete: Slett diff --git a/config/locales/no.yml b/config/locales/no.yml index c71dffc6361e99..537552ea98662d 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -944,7 +944,6 @@ delete: Slett edit_preset: Rediger advarsel forhåndsinnstilling empty: Du har ikke definert noen forhåndsinnstillinger for varsler enda. - title: Endre forhåndsinnstillinger for advarsler webhooks: add_new: Legg til endepunkt delete: Slett diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 0a653ea46c2732..d2bea55bd37c7b 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -430,7 +430,6 @@ oc: add_new: N’ajustar un nòu delete: Escafar edit_preset: Modificar lo tèxt predefinit d’avertiment - title: Gerir los tèxtes predefinits webhooks: delete: Suprimir disable: Desactivar diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 7c037d7d002bf3..4c7af82b94f63a 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -291,6 +291,7 @@ pl: update_custom_emoji_html: Zaktualizowane emoji %{target} przez %{name} update_domain_block_html: Zaktualizowano blokadę domeny dla %{target} przez %{name} update_ip_block_html: "%{name} stworzył(a) regułę dla IP %{target}" + update_report_html: "%{target} zaktualizowany przez %{name}" update_status_html: "%{name} zaktualizował(a) wpis użytkownika %{target}" update_user_role_html: "%{name} zmienił rolę %{target}" deleted_account: usunięte konto @@ -984,7 +985,7 @@ pl: delete: Usuń edit_preset: Edytuj szablon ostrzeżenia empty: Nie zdefiniowano jeszcze żadnych szablonów ostrzegawczych. - title: Zarządzaj szablonami ostrzeżeń + title: Zapisane ostrzeżenia webhooks: add_new: Dodaj punkt końcowy delete: Usuń diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 60730d53e977a7..6b80edb24e60f3 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -950,7 +950,6 @@ pt-BR: delete: Excluir edit_preset: Editar o aviso pré-definido empty: Você ainda não definiu nenhuma predefinição de alerta. - title: Gerenciar os avisos pré-definidos webhooks: add_new: Adicionar endpoint delete: Excluir diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml index 0c2e6cfd6d782d..49522b7414306d 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -285,6 +285,7 @@ pt-PT: update_custom_emoji_html: "%{name} atualizou o emoji %{target}" update_domain_block_html: "%{name} atualizou o bloqueio de domínio para %{target}" update_ip_block_html: "%{name} alterou regra para IP %{target}" + update_report_html: "%{name} atualizou a denúncia %{target}" update_status_html: "%{name} atualizou o estado de %{target}" update_user_role_html: "%{name} alterou a função %{target}" deleted_account: conta apagada @@ -950,7 +951,7 @@ pt-PT: delete: Eliminar edit_preset: Editar o aviso predefinido empty: Ainda não definiu nenhum aviso predefinido. - title: Gerir os avisos predefinidos + title: Predefinições de aviso webhooks: add_new: Adicionar endpoint delete: Eliminar diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 85d8a7a54046c3..d6b8726ba4fc32 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -978,7 +978,6 @@ ru: delete: Удалить edit_preset: Удалить шаблон предупреждения empty: Вы еще не определили пресеты предупреждений. - title: Управление шаблонами предупреждений webhooks: add_new: Добавить конечную точку delete: Удалить diff --git a/config/locales/sc.yml b/config/locales/sc.yml index 01c355794d3a75..449d8d9c7f3296 100644 --- a/config/locales/sc.yml +++ b/config/locales/sc.yml @@ -535,7 +535,6 @@ sc: delete: Cantzella edit_preset: Modìfica s'avisu predefinidu empty: No as cunfiguradu ancora perunu avisu predefinidu. - title: Gesti is cunfiguratziones predefinidas de is avisos webhooks: delete: Cantzella disable: Disativa diff --git a/config/locales/sco.yml b/config/locales/sco.yml index 2a7b1e3e701aed..7c733b71b50d89 100644 --- a/config/locales/sco.yml +++ b/config/locales/sco.yml @@ -842,7 +842,6 @@ sco: delete: Delete edit_preset: Edit warnin preset empty: Ye huvnae definit onie warnin presets yit. - title: Manage warnin presets webhooks: add_new: Add enpynt delete: Delete diff --git a/config/locales/si.yml b/config/locales/si.yml index f5e65fda8d8107..0f714ee146bbfe 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -726,7 +726,6 @@ si: delete: මකන්න edit_preset: අනතුරු ඇඟවීමේ පෙර සැකසුම සංස්කරණය කරන්න empty: ඔබ තවම කිසිදු අනතුරු ඇඟවීමේ පෙරසිටුවක් නිර්වචනය කර නැත. - title: අනතුරු ඇඟවීමේ පෙරසිටුවීම් කළමනාකරණය කරන්න webhooks: add_new: අන්ත ලක්ෂ්‍යය එක් කරන්න delete: මකන්න diff --git a/config/locales/simple_form.fi.yml b/config/locales/simple_form.fi.yml index 4971e250222077..9ac36447de307e 100644 --- a/config/locales/simple_form.fi.yml +++ b/config/locales/simple_form.fi.yml @@ -78,12 +78,14 @@ fi: form_admin_settings: activity_api_enabled: Paikallisesti julkaistujen julkaisujen, aktiivisten käyttäjien ja rekisteröitymisten viikoittainen määrä app_icon: WEBP, PNG, GIF tai JPG. Korvaa oletusarvoisen mobiililaitteiden sovelluskuvakkeen omalla kuvakkeella. - backups_retention_period: Käyttäjillä on mahdollisuus arkistoida julkaisujaan myöhemmin ladattaviksi. Kun tämä on asetettu positiiviseksi arvoksi, nämä arkistot poistetaan automaattisesti asetetun päivien määrän jälkeen. + backups_retention_period: Käyttäjillä on mahdollisuus arkistoida julkaisujaan myöhemmin ladattaviksi. Kun arvo on positiivinen, nämä arkistot poistuvat automaattisesti, kun määritetty määrä päiviä on kulunut. bootstrap_timeline_accounts: Nämä tilit kiinnitetään uusien käyttäjien seuraamissuosituslistojen alkuun. closed_registrations_message: Näkyy, kun rekisteröityminen on suljettu + content_cache_retention_period: Kaikki muiden palvelinten julkaisut (mukaan lukien tehostukset ja vastaukset) poistuvat, kun määritetty määrä päiviä on kulunut, ottamatta huomioon paikallisen käyttäjän vuorovaikutusta näiden julkaisujen kanssa. Sisältää julkaisut, jotka paikallinen käyttäjä on merkinnyt kirjanmerkiksi tai suosikiksi. Myös yksityiset maininnat eri palvelinten käyttäjien välillä menetetään, eikä niitä voi palauttaa. Tämä asetus on tarkoitettu käytettäväksi erityistapauksissa ja rikkoo monia käyttäjien odotuksia, kun sitä käytetään yleistarkoituksiin. custom_css: Voit käyttää mukautettuja tyylejä Mastodonin verkkoversiossa. favicon: WEBP, PNG, GIF tai JPG. Korvaa oletusarvoisen Mastodonin suosikkikuvakkeen omalla kuvakkeella. mascot: Ohittaa kuvituksen edistyneessä selainkäyttöliittymässä. + media_cache_retention_period: Käyttäjien tekemien julkaisujen mediatiedostot ovat välimuistissa palvelimellasi. Kun arvo on positiivinen, media poistuu, kun määritetty määrä päiviä on kulunut. Jos mediaa pyydetään sen poistamisen jälkeen, se ladataan uudelleen, jos lähdesisältö on vielä saatavilla. Koska linkkien esikatselun kyselyitä kolmansien osapuolien sivustoille on rajoitettu, on suositeltavaa asettaa tämä arvo vähintään 14 päivään, tai linkkien kortteja ei päivitetä pyynnöstä ennen tätä ajankohtaa. peers_api_enabled: Luettelo verkkotunnuksista, jotka tämä palvelin on kohdannut fediversumissa. Se ei kerro, oletko liitossa tietyn palvelimen kanssa, vaan että palvelimesi on ylipäätään tietoinen siitä. Tätä tietoa käytetään palveluissa, jotka keräävät tilastoja federoinnista yleisellä tasolla. profile_directory: Profiilihakemisto lueteloi kaikki käyttäjät, jotka ovat ilmoittaneet olevansa löydettävissä. require_invite_text: Kun rekisteröityminen vaatii manuaalisen hyväksynnän, tee ”Miksi haluat liittyä?” -tekstikentästä pakollinen vapaaehtoisen sijaan diff --git a/config/locales/simple_form.lt.yml b/config/locales/simple_form.lt.yml index 1c73ce0a842a56..789121be42e769 100644 --- a/config/locales/simple_form.lt.yml +++ b/config/locales/simple_form.lt.yml @@ -79,6 +79,7 @@ lt: mascot: Pakeičia išplėstinės žiniatinklio sąsajos iliustraciją. media_cache_retention_period: Nuotolinių naudotojų įrašytų įrašų medijos failai talpinami tavo serveryje. Nustačius teigiamą reikšmę, medijos bus ištrinamos po nurodyto dienų skaičiaus. Jei medijos duomenų bus paprašyta po to, kai jie bus ištrinti, jie bus atsiųsti iš naujo, jei šaltinio turinys vis dar prieinamas. Dėl apribojimų, susijusių su nuorodų peržiūros kortelių apklausos dažnumu trečiųjų šalių svetainėse, rekomenduojama nustatyti šią reikšmę ne trumpesnę kaip 14 dienų, kitaip nuorodų peržiūros kortelės nebus atnaujinamos pagal pareikalavimą iki to laiko. peers_api_enabled: Domenų pavadinimų sąrašas, su kuriais šis serveris susidūrė fediverse. Čia nėra duomenų apie tai, ar tu bendrauji su tam tikru serveriu, tik apie tai, kad tavo serveris apie jį žino. Tai naudojama tarnybose, kurios renka federacijos statistiką bendrąja prasme. + require_invite_text: Kai registraciją reikia patvirtinti rankiniu būdu, teksto įvesties laukelį „Kodėl nori prisijungti?“ padaryk privalomą, o ne pasirenkamą site_contact_email: Kaip žmonės gali su tavimi susisiekti teisiniais ar pagalbos užklausimais. site_contact_username: Kaip žmonės gali tave pasiekti Mastodon. site_extended_description: Bet kokia papildoma informacija, kuri gali būti naudinga lankytojams ir naudotojams. Gali būti struktūrizuota naudojant Markdown sintaksę. @@ -86,6 +87,8 @@ lt: timeline_preview: Atsijungę lankytojai galės naršyti naujausius viešus įrašus, esančius serveryje. trends: Trendai rodo, kurios įrašai, saitažodžiai ir naujienų istorijos tavo serveryje sulaukia didžiausio susidomėjimo. trends_as_landing_page: Rodyti tendencingą turinį atsijungusiems naudotojams ir lankytojams vietoj šio serverio aprašymo. Reikia, kad tendencijos būtų įjungtos. + invite_request: + text: Tai padės mums peržiūrėti tavo paraišką rule: hint: Pasirinktinai. Pateik daugiau informacijos apie taisyklę. sessions: @@ -108,6 +111,7 @@ lt: admin_account_action: include_statuses: Įtraukti praneštus įrašus į el. laišką defaults: + autofollow: Kviesti sekti tavo paskyrą avatar: Profilio nuotrauka bot: Tai automatinė paskyra chosen_languages: Filtruoti kalbas @@ -163,6 +167,7 @@ lt: custom_css: Pasirinktinis CSS mascot: Pasirinktinis talismanas (pasenęs) registrations_mode: Kas gali užsiregistruoti + require_invite_text: Reikalauti priežasties prisijungti show_domain_blocks_rationale: Rodyti, kodėl domenai buvo užblokuoti site_extended_description: Išplėstas aprašymas site_short_description: Serverio aprašymas @@ -173,6 +178,8 @@ lt: trendable_by_default: Leisti tendencijas be išankstinės peržiūros trends: Įjungti tendencijas trends_as_landing_page: Naudoti tendencijas kaip nukreipimo puslapį + invite: + comment: Komentuoti invite_request: text: Kodėl nori prisijungti? notification_emails: diff --git a/config/locales/simple_form.nl.yml b/config/locales/simple_form.nl.yml index 8bc717fe1fa172..2271d7037efa45 100644 --- a/config/locales/simple_form.nl.yml +++ b/config/locales/simple_form.nl.yml @@ -28,7 +28,7 @@ nl: sensitive: Forceer dat alle mediabijlagen van deze gebruiker als gevoelig worden gemarkeerd. silence: Voorkom dat de gebruiker berichten kan plaatsen met openbare zichtbaarheid, verberg diens berichten en meldingen van mensen die de gebruiker niet volgen. Sluit alle rapportages tegen dit account af. suspend: Voorkom interactie van of naar dit account en verwijder de inhoud. Dit is omkeerbaar binnen 30 dagen. Dit sluit alle rapporten tegen dit account af. - warning_preset_id: Optioneel. Je kunt nog steeds handmatig tekst toevoegen aan het eind van de voorinstelling + warning_preset_id: Optioneel. Je kunt nog steeds handmatig tekst toevoegen aan het eind van de preset announcement: all_day: Wanneer dit is aangevinkt worden alleen de datums binnen het tijdvak getoond ends_at: Optioneel. De publicatie van de mededeling wordt op dit tijdstip automatisch beëindigd @@ -168,7 +168,7 @@ nl: sensitive: Gevoelig silence: Beperken suspend: Opschorten en onomkeerbaar accountgegevens verwijderen - warning_preset_id: Gebruik een voorinstelling van een waarschuwing + warning_preset_id: Een preset voor een waarschuwing gebruiken announcement: all_day: Gedurende de hele dag ends_at: Eindigt diff --git a/config/locales/simple_form.sl.yml b/config/locales/simple_form.sl.yml index a4abb737c0ecc5..96b36307a5795d 100644 --- a/config/locales/simple_form.sl.yml +++ b/config/locales/simple_form.sl.yml @@ -77,10 +77,15 @@ sl: warn: Skrij filtrirano vsebino za opozorilom, ki pomenja naslov filtra form_admin_settings: activity_api_enabled: Številke krajevno objavljenih objav, dejavnih uporabnikov in novih registracij na tedenskih seznamih + app_icon: WEBP, PNG, GIF ali JPG. Zamenja privzeto ikono programa na mobilnih napravah z ikono po meri. + backups_retention_period: Uporabniki lahko ustvarijo arhive svojih objav za kasnejši prenos k sebi. Ko je nastavljeno na pozitivno vrednost, bodo ti arhivi po nastavljenem številu dni samodejno izbrisani. bootstrap_timeline_accounts: Ti računi bodo pripeti na vrh priporočenih sledenj za nove uporabnike. closed_registrations_message: Prikazano, ko so registracije zaprte + content_cache_retention_period: Vse objave z drugih strežnikov (vključno z izpostavitvami in odgovori) bodo izbrisani po nastavljenem številu dni, ne glede na krajevne interakcije s temi objavami. To vključuje objave, ki jih je krajevni uporabnik dodal med zaznamke ali priljubljene. Zasebne omembe med uporabniki na različnih strežnikih bodo prav tako izgubljene in jih ne bo moč obnoviti. Uporaba te nastavitve je namenjena strežnikom s posebnim namenom in nasprotuje mnogim pričakovanjem uporabnikov na strežnikih za splošni namen. custom_css: Spletni različici Mastodona lahko uveljavite sloge po meri. + favicon: WEBP, PNG, GIF ali JPG. Zamenja privzeto ikono spletne strani Mastodon z ikono po meri. mascot: Preglasi ilustracijo v naprednem spletnem vmesniku. + media_cache_retention_period: Predstavnostne datoteke iz objav uporabnikov na ostalih strežnikih se začasno hranijo na tem strežniku. Ko je nastavljeno na pozitivno vrednost, bodo predstavnostne datoteke izbrisane po nastavljenem številu dni. Če bo predstavnostna datoteka zahtevana po izbrisu, bo ponovno prenešena, če bo vir še vedno na voljo. Zaradi omejitev pogostosti prejemanja predogledov povezav z drugih strani je priporočljivo to vrednost nastaviti na vsaj 14 dni. V nasprotnem predogledi povezav pred tem časom ne bodo osveženi na zahtevo. peers_api_enabled: Seznam imen domen, na katere je ta strežnik naletel v fediverzumu. Sem niso vključeni podatki o tem, ali ste v federaciji z danim strežnikom, zgolj to, ali vaš strežnik ve zanj. To uporabljajo storitve, ki zbirajo statistične podatke o federaciji v splošnem smislu. profile_directory: Imenik profilov izpiše vse uporabnike, ki so dovolili, da so v njem navedeni. require_invite_text: Če registracije zahtevajo ročno potrditev, nastavite vnos besedila pod »Zakaj se želite pridružiti?« za obveznega. @@ -240,6 +245,7 @@ sl: backups_retention_period: Obdobje hrambe arhivov uporabnikov bootstrap_timeline_accounts: Vedno priporočaj te račune novim uporabnikom closed_registrations_message: Sporočilo po meri, ko registracije niso na voljo + content_cache_retention_period: Obdobje hranjenja vsebine z ostalih strežnikov custom_css: CSS po meri mascot: Maskota po meri (opuščeno) media_cache_retention_period: Obdobje hrambe predpomnilnika predstavnosti diff --git a/config/locales/simple_form.sr-Latn.yml b/config/locales/simple_form.sr-Latn.yml index 8dd19865636755..710f81e84fd1bd 100644 --- a/config/locales/simple_form.sr-Latn.yml +++ b/config/locales/simple_form.sr-Latn.yml @@ -20,7 +20,7 @@ sr-Latn: admin_account_action: include_statuses: Korisnik će videti koje su objave prouzrokovale moderacijsku radnju ili upozorenje send_email_notification: Korisnik će dobiti objašnjenje toga šta mu se desilo sa nalogom - text_html: Opcionalno. Možete koristiti sintaksu objava. Možete dodati unapred određene postavke upozorenja za uštedu vremena + text_html: Opciono. Možete koristiti sintaksu objava. Možete dodati predefinisana upozorenja za uštedu vremena type_html: Izaberite šta da radite sa %{acct} types: disable: Sprečava korisnika da koristi svoj nalog, ali ne briše niti sakriva njegove sadržaje. @@ -28,7 +28,7 @@ sr-Latn: sensitive: Učini da svi medijski prilozi ovog korisnika prisilno budu označeni kao osetljivi. silence: Sprečava korisnika da pravi javne objave, sakriva njegove objave i obaveštenja od ljudi koji ga ne prate. Zatvara sve prijave podnete protiv ovog naloga. suspend: Sprečava svu interakciju od ovog naloga i ka ovom nalogu i briše njegov sadržaj. Opozivo u roku od 30 dana. Zatvara sve prijave podnete protiv ovog naloga. - warning_preset_id: Opcionalno. Možete i dalje dodati prilagođeni tekst na kraj preseta + warning_preset_id: Opciono. Možete i dalje dodati prilagođeni tekst na kraj predefinisane vrednosti announcement: all_day: Kada je ova opcija označena, samo datumi iz vremenskog opsega će biti prikazani ends_at: Opciono. Objava će biti automatski opozvana u ovom trenutku @@ -118,7 +118,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 + hint: Opciono. 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:' @@ -155,7 +155,7 @@ sr-Latn: account_migration: acct: Ručica (@) novog naloga account_warning_preset: - text: Tekst preseta + text: Tekst predefinisane vrednosti title: Naslov admin_account_action: include_statuses: Uključi prijavljene objave u e-poštu @@ -168,7 +168,7 @@ sr-Latn: sensitive: Osetljivo silence: Utišaj suspend: Obustavite i nepovratno izbrišite podatke o nalogu - warning_preset_id: Koristi upozoravajući preset + warning_preset_id: Koristi predefinisano upozorenje announcement: all_day: Celodnevni događaj ends_at: Kraj događaja diff --git a/config/locales/simple_form.sr.yml b/config/locales/simple_form.sr.yml index e88a99df13af7d..c5fbc9185a517e 100644 --- a/config/locales/simple_form.sr.yml +++ b/config/locales/simple_form.sr.yml @@ -20,7 +20,7 @@ sr: admin_account_action: include_statuses: Корисник ће видети које су објаве проузроковале модерацијску радњу или упозорење send_email_notification: Корисник ће добити објашњење тога шта му се десило са налогом - text_html: Опционално. Можете користити синтаксу објава. Можете додати унапред одређене поставке упозорења за уштеду времена + text_html: Опционо. Можете користити синтаксу објава. Можете додати предефинисана упозорења за уштеду времена type_html: Изаберите шта да радите са %{acct} types: disable: Спречава корисника да користи свој налог, али не брише нити сакрива његове садржаје. @@ -28,7 +28,7 @@ sr: sensitive: Учини да сви медијски прилози овог корисника присилно буду означени као осетљиви. silence: Спречава корисника да прави јавне објаве, сакрива његове објаве и обавештења од људи који га не прате. Затвара све пријаве поднете против овог налога. suspend: Спречава сву интеракцију од овог налога и ка овом налогу и брише његов садржај. Опозиво у року од 30 дана. Затвара све пријаве поднете против овог налога. - warning_preset_id: Опционално. Можете и даље додати прилагођени текст на крај пресета + warning_preset_id: Опционо. Можете и даље додати прилагођени текст на крај предефинисане вредности announcement: all_day: Када је ова опција означена, само датуми из временског опсега ће бити приказани ends_at: Опционо. Објава ће бити аутоматски опозвана у овом тренутку @@ -88,7 +88,7 @@ sr: media_cache_retention_period: Медијске датотеке из објава удаљених корисника се кеширају на вашем серверу. Када се подеси на позитивну вредност, медији ће бити избрисани након наведеног броја дана. Ако се медијски подаци захтевају након брисања, биће поново преузети, ако је изворни садржај и даље доступан. Због ограничења колико често картице за преглед веза анкетирају сајтове трећих страна, препоручује се да ову вредност поставите на најмање 14 дана, иначе картице за преглед веза неће бити ажуриране на захтев пре тог времена. peers_api_enabled: Листа домена са којима се овај сервер сусрео у федиверзуму. Овде нису садржани подаци о томе да ли се Ваш сервер федерише са другим серверима, већ само да Ваш сервер зна за њих. Ове информације користе сервиси који прикупљају податке и воде статистику о федерацији у ширем смислу. profile_directory: Директоријум профила наводи све кориснике који су се определили да буду видљиви. - require_invite_text: Када регистрације захтевају ручно одобрење, поставите да одговор на „Зашто желите да се придружите?“ буде обавезан, а не опционалан + require_invite_text: Када регистрације захтевају ручно одобрење, постави да унос текста „Зашто желиш да се придружиш?“ буде обавезан, а не опциони site_contact_email: Како корисници могу да контактирају са Вама за правна питања или питања у вези подршке. site_contact_username: Како корисници могу да контактирају са вама на Mastodon-у. site_extended_description: Било какве додатне информације које могу бити корисне посетиоцима и Вашим корисницима. Могу се структурирати помоћу Markdown синтаксе. @@ -118,7 +118,7 @@ sr: sign_up_requires_approval: Нове регистрације ће захтевати Ваше одобрење severity: Изаберите шта ће се десити са захтевима са ове IP адресе rule: - hint: Опционално. Пружите више детаља о правилу + hint: Опционо. Пружите више детаља о правилу text: Опишите правило или услов за кориснике на овом серверу. Потрудите се да опис буде кратак и једноставан sessions: otp: 'Унесите двофакторски код са Вашег телефона или користите један од кодова за опоравак:' @@ -155,7 +155,7 @@ sr: account_migration: acct: Ручица (@) новог налога account_warning_preset: - text: Текст пресета + text: Текст предефинисане вредности title: Наслов admin_account_action: include_statuses: Укључи пријављене објаве у е-пошту @@ -168,7 +168,7 @@ sr: sensitive: Осетљиво silence: Утишај suspend: Обуставите и неповратно избришите податке о налогу - warning_preset_id: Користи упозоравајући пресет + warning_preset_id: Користи предефинисано упозорење announcement: all_day: Целодневни догађај ends_at: Крај догађаја diff --git a/config/locales/sk.yml b/config/locales/sk.yml index f05887dc33cc0c..f10815129dd286 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -763,7 +763,6 @@ sk: add_new: Pridaj nové delete: Vymaž edit_preset: Uprav varovnú predlohu - title: Spravuj varovné predlohy webhooks: delete: Vymaž disable: Vypni diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 6c26511ad6968a..1e4e254cf18eaa 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -291,6 +291,7 @@ sl: update_custom_emoji_html: "%{name} je posodobil/a emotikone %{target}" update_domain_block_html: "%{name} je posodobil/a domenski blok za %{target}" update_ip_block_html: "%{name} je spremenil/a pravilo za IP %{target}" + update_report_html: "%{name} je posodobil poročilo %{target}" update_status_html: "%{name} je posodobil/a objavo uporabnika %{target}" update_user_role_html: "%{name} je spremenil/a vlogo %{target}" deleted_account: izbrisan račun @@ -984,7 +985,7 @@ sl: delete: Izbriši edit_preset: Uredi prednastavitev opozoril empty: Zaenkrat še niste določili nobenih opozorilnih prednastavitev. - title: Upravljaj prednastavitev opozoril + title: Pred-nastavitve opozoril webhooks: add_new: Dodaj končno točko delete: Izbriši diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 8319cfcaecac48..5439f08a04a8b2 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -285,6 +285,7 @@ sq: update_custom_emoji_html: "%{name} përditësoi emoxhin %{target}" update_domain_block_html: "%{name} përditësoi bllokim përkatësish për %{target}" update_ip_block_html: "%{name} ndryshoi rregull për IP-në %{target}" + update_report_html: "%{name} përditësoi raportimin %{target}" update_status_html: "%{name} përditësoi gjendjen me %{target}" update_user_role_html: "%{name} ndryshoi rolin për %{target}" deleted_account: fshiu llogarinë @@ -946,7 +947,7 @@ sq: delete: Fshije edit_preset: Përpunoni sinjalizim të paracaktuar empty: S’keni përcaktuar ende sinjalizime të gatshme. - title: Administroni sinjalizime të paracaktuara + title: Paracaktime sinjalizimesh webhooks: add_new: Shtoni pikëmbarim delete: Fshije diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index b4976f8985da90..718d1c0f84f336 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -288,6 +288,7 @@ sr-Latn: update_custom_emoji_html: "%{name} je ažurirao/-la emodži %{target}" update_domain_block_html: "%{name} je ažurirao/-la blok domena %{target}" update_ip_block_html: "%{name} je promenio/-la IP uslov za %{target}" + update_report_html: "%{name} je ažurirao izveštaj %{target}" update_status_html: "%{name} je ažurirao/-la objavu korisnika %{target}" update_user_role_html: "%{name} je promenio/-la poziciju %{target}" deleted_account: obrisan nalog @@ -868,7 +869,7 @@ sr-Latn: action: Pogledaj dokumentaciju message_html: Vaš Elasticsearch klaster ima samo jedan čvor, ES_PRESETtreba postaviti nasingle_node_cluster. elasticsearch_reset_chewy: - message_html: Vaš Elasticsearch klaster ima samo jedan čvor, ES_PRESETtreba postaviti nasingle_node_cluster. + message_html: Indeks Elasticsearch sistema je zastareo zbog promene podešavanja. Pokrenite tootctl search deploy --reset-chewyda biste ga ažurirali. elasticsearch_running_check: message_html: Povezivanje na Elasticsearch nije bilo moguće. Molimo Vas proverite da li je pokrenut, ili onemogućite pretragu celog teksta elasticsearch_version_check: @@ -965,9 +966,9 @@ sr-Latn: warning_presets: add_new: Dodaj novi delete: Izbriši - edit_preset: Uredi preset upozorenja - empty: Još uvek niste definisali nijedan šablon upozorenja. - title: Upravljaj presetima upozorenja + edit_preset: Uredi predefinisana upozorenja + empty: Još uvek niste definisali nijedno upozorenje. + title: Predefinisana upozorenja webhooks: add_new: Dodaj krajnju tačku delete: Izbriši diff --git a/config/locales/sr.yml b/config/locales/sr.yml index aec6d399d58639..c9a67b1936656a 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -288,6 +288,7 @@ sr: update_custom_emoji_html: "%{name} је ажурирао/-ла емоџи %{target}" update_domain_block_html: "%{name} је ажурирао/-ла блок домена %{target}" update_ip_block_html: "%{name} је променио/-ла IP услов за %{target}" + update_report_html: "%{name} је ажурирао извештај %{target}" update_status_html: "%{name} је ажурирао/-ла објаву корисника %{target}" update_user_role_html: "%{name} је променио/-ла позицију %{target}" deleted_account: обрисан налог @@ -868,7 +869,7 @@ sr: action: Погледај документацију message_html: Ваш Elasticsearch кластер има само један чвор, ES_PRESETтреба поставити наsingle_node_cluster. elasticsearch_reset_chewy: - message_html: Ваш Elasticsearch кластер има само један чвор, ES_PRESETтреба поставити наsingle_node_cluster. + message_html: Индекс Elasticsearch система је застарео због промене подешавања. Покрените tootctl search deploy --reset-chewyда бисте га ажурирали. elasticsearch_running_check: message_html: Повезивање на Elasticsearch није било могуће. Молимо Вас проверите да ли је покренут, или онемогућите претрагу целог текста elasticsearch_version_check: @@ -965,9 +966,9 @@ sr: warning_presets: add_new: Додај нови delete: Избриши - edit_preset: Уреди пресет упозорења - empty: Још увек нисте дефинисали ниједан шаблон упозорења. - title: Управљај пресетима упозорења + edit_preset: Уреди предефинисана упозорења + empty: Још увек нисте дефинисали ниједно упозорење. + title: Предефинисна упозорења webhooks: add_new: Додај крајњу тачку delete: Избриши diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 11e1fce3fe6739..cf68cdd5637509 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -285,6 +285,7 @@ sv: update_custom_emoji_html: "%{name} uppdaterade emoji %{target}" update_domain_block_html: "%{name} uppdaterade domän-block för %{target}" update_ip_block_html: "%{name} ändrade regel för IP %{target}" + update_report_html: "%{name} uppdaterade rapporten %{target}" update_status_html: "%{name} uppdaterade inlägget av %{target}" update_user_role_html: "%{name} ändrade rollen %{target}" deleted_account: raderat konto @@ -950,7 +951,6 @@ sv: delete: Radera edit_preset: Redigera varningsförval empty: Du har inte definierat några varningsförval ännu. - title: Hantera varningsförval webhooks: add_new: Lägg till slutpunkt delete: Ta bort diff --git a/config/locales/th.yml b/config/locales/th.yml index 56b7bea69a8ad8..3ca4f097338e55 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -282,6 +282,7 @@ th: update_custom_emoji_html: "%{name} ได้อัปเดตอีโมจิ %{target}" update_domain_block_html: "%{name} ได้อัปเดตการปิดกั้นโดเมนสำหรับ %{target}" update_ip_block_html: "%{name} ได้เปลี่ยนกฎสำหรับ IP %{target}" + update_report_html: "%{name} ได้อัปเดตรายงาน %{target}" update_status_html: "%{name} ได้อัปเดตโพสต์โดย %{target}" update_user_role_html: "%{name} ได้เปลี่ยนบทบาท %{target}" deleted_account: บัญชีที่ลบแล้ว @@ -933,7 +934,6 @@ th: delete: ลบ edit_preset: แก้ไขคำเตือนที่ตั้งไว้ล่วงหน้า empty: คุณยังไม่ได้กำหนดคำเตือนที่ตั้งไว้ล่วงหน้าใด ๆ - title: จัดการคำเตือนที่ตั้งไว้ล่วงหน้า webhooks: add_new: เพิ่มปลายทาง delete: ลบ @@ -1838,6 +1838,7 @@ th: feature_action: เรียนรู้เพิ่มเติม feature_audience: Mastodon มีความพิเศษที่ให้คุณจัดการผู้รับสารของคุณได้โดยไม่มีตัวกลาง นอกจากนี้ การติดตั้ง Mastodon บนโครงสร้างพื้นฐานของคุณจะทำให้คุณสามารถติดตาม (และติดตามโดย) เซิร์ฟเวอร์ Mastodon แห่งไหนก็ได้ที่ทำงานอยู่ โดยไม่มีใครสามารถควบคุมได้นอกจากคุณ feature_audience_title: สร้างผู้ชมของคุณด้วยความมั่นใจ + feature_control: คุณทราบดีที่สุดถึงสิ่งที่คุณต้องการเห็นในฟีดหน้าแรกของคุณ ไม่มีอัลกอริทึมหรือโฆษณาให้เสียเวลาของคุณ ติดตามใครก็ตามทั่วทั้งเซิร์ฟเวอร์ Mastodon ใด ๆ จากบัญชีเดียวและรับโพสต์ของเขาตามลำดับเวลา และทำให้มุมอินเทอร์เน็ตของคุณเป็นเหมือนคุณมากขึ้นอีกนิด feature_control_title: การควบคุมเส้นเวลาของคุณเอง feature_creativity_title: ความคิดสร้างสรรค์ที่ไม่มีใครเทียบได้ feature_moderation_title: การกลั่นกรองในแบบที่ควรจะเป็น diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 7b9cf50aaf86ea..3ce12fec87c678 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -285,6 +285,7 @@ tr: update_custom_emoji_html: "%{name}, %{target} emojisini güncelledi" update_domain_block_html: "%{name}, %{target} alan adının engelini güncelledi" update_ip_block_html: "%{name}, %{target} IP adresi için kuralı güncelledi" + update_report_html: "%{name}, %{target} raporunu güncelledi" update_status_html: "%{name}, %{target} kullanıcısının gönderisini güncelledi" update_user_role_html: "%{name}, %{target} rolünü değiştirdi" deleted_account: hesap silindi @@ -950,7 +951,7 @@ tr: delete: Sil edit_preset: Uyarı ön-ayarını düzenle empty: Henüz önceden ayarlanmış bir uyarı tanımlanmadı. - title: Uyarı ön-ayarlarını yönet + title: Uyarı Önayarları webhooks: add_new: Uç nokta ekle delete: Sil diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 71e84a1d54daf3..5baaa93870317d 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -984,7 +984,6 @@ uk: delete: Видалити edit_preset: Редагувати шаблон попередження empty: Ви ще не визначили жодних попереджень. - title: Керування шаблонами попереджень webhooks: add_new: Додати кінцеву точку delete: Видалити diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 5d9e881ea43a2d..4265c1a33a153f 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -282,6 +282,7 @@ vi: update_custom_emoji_html: "%{name} đã cập nhật emoji %{target}" update_domain_block_html: "%{name} cập nhật chặn máy chủ %{target}" update_ip_block_html: "%{name} cập nhật chặn IP %{target}" + update_report_html: "%{name} cập nhật báo cáo %{target}" update_status_html: "%{name} cập nhật tút của %{target}" update_user_role_html: "%{name} đã thay đổi vai trò %{target}" deleted_account: tài khoản đã xóa @@ -933,7 +934,6 @@ vi: delete: Xóa bỏ edit_preset: Sửa mẫu có sẵn empty: Bạn chưa thêm mẫu cảnh cáo nào cả. - title: Quản lý mẫu cảnh cáo webhooks: add_new: Thêm endpoint delete: Xóa bỏ diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 3140ebdd309aee..b668c23d29be89 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -282,6 +282,7 @@ zh-CN: update_custom_emoji_html: "%{name} 更新了自定义表情 %{target}" update_domain_block_html: "%{name} 更新了对 %{target} 的域名屏蔽" update_ip_block_html: "%{name} 修改了对 IP %{target} 的规则" + update_report_html: "%{name} 更新了举报 %{target}" update_status_html: "%{name} 刷新了 %{target} 的嘟文" update_user_role_html: "%{name} 更改了 %{target} 角色" deleted_account: 账号已注销 @@ -933,7 +934,7 @@ zh-CN: delete: 删除 edit_preset: 编辑预置警告 empty: 你尚未定义任何警告预设。 - title: 管理预设警告 + title: 预设警告 webhooks: add_new: 新增对端 delete: 删除 diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index 1bfbe38bb52e72..ddc6571e6da9a5 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -933,7 +933,6 @@ zh-HK: delete: 刪除 edit_preset: 設定警告預設 empty: 您尚未定義任何預設警告 - title: 管理警告預設 webhooks: add_new: 新增端點 delete: 刪除 diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index cdedd759eae866..14f54f9a12219c 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -282,6 +282,7 @@ zh-TW: update_custom_emoji_html: "%{name} 已更新自訂 emoji 表情符號 %{target}" update_domain_block_html: "%{name} 已更新 %{target} 之網域封鎖" update_ip_block_html: "%{name} 已變更 IP %{target} 之規則" + update_report_html: "%{name} 已更新 %{target} 的檢舉" update_status_html: "%{name} 已更新 %{target} 的嘟文" update_user_role_html: "%{name} 已變更 %{target} 角色" deleted_account: 已刪除帳號 @@ -935,7 +936,7 @@ zh-TW: delete: 刪除 edit_preset: 編輯預設警告 empty: 您尚未定義任何預設警告。 - title: 管理預設警告 + title: 預設警告內容 webhooks: add_new: 新增端點 delete: 刪除 diff --git a/config/navigation.rb b/config/navigation.rb index a64b3544d6529f..f50900deb75b82 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -72,6 +72,7 @@ s.item :dashboard, safe_join([fa_icon('tachometer fw'), t('admin.dashboard.title')]), admin_dashboard_path, if: -> { current_user.can?(:view_dashboard) } s.item :settings, safe_join([fa_icon('cogs fw'), t('admin.settings.title')]), admin_settings_path, if: -> { current_user.can?(:manage_settings) }, highlights_on: %r{/admin/settings} s.item :rules, safe_join([fa_icon('gavel fw'), t('admin.rules.title')]), admin_rules_path, highlights_on: %r{/admin/rules}, if: -> { current_user.can?(:manage_rules) } + s.item :warning_presets, safe_join([fa_icon('warning fw'), t('admin.warning_presets.title')]), admin_warning_presets_path, highlights_on: %r{/admin/warning_presets}, if: -> { current_user.can?(:manage_settings) } s.item :roles, safe_join([fa_icon('vcard fw'), t('admin.roles.title')]), admin_roles_path, highlights_on: %r{/admin/roles}, if: -> { current_user.can?(:manage_roles) } s.item :announcements, safe_join([fa_icon('bullhorn fw'), t('admin.announcements.title')]), admin_announcements_path, highlights_on: %r{/admin/announcements}, if: -> { current_user.can?(:manage_announcements) } s.item :custom_emojis, safe_join([fa_icon('smile-o fw'), t('admin.custom_emojis.title')]), admin_custom_emojis_path, highlights_on: %r{/admin/custom_emojis}, if: -> { current_user.can?(:manage_custom_emojis) } diff --git a/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb b/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb index 3666abf1cc2ae9..534df25eed1a20 100644 --- a/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb +++ b/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb @@ -3,7 +3,11 @@ class AddAttachmentAvatarToAccounts < ActiveRecord::Migration[4.2] def self.up change_table :accounts do |t| - t.attachment :avatar + # The following corresponds to `t.attachment :avatar` in an older version of Paperclip + t.string :avatar_file_name + t.string :avatar_content_type + t.integer :avatar_file_size + t.datetime :avatar_updated_at end end diff --git a/db/migrate/20160312193225_add_attachment_header_to_accounts.rb b/db/migrate/20160312193225_add_attachment_header_to_accounts.rb index 37108fc1894d22..b481fc52906ea9 100644 --- a/db/migrate/20160312193225_add_attachment_header_to_accounts.rb +++ b/db/migrate/20160312193225_add_attachment_header_to_accounts.rb @@ -3,7 +3,11 @@ class AddAttachmentHeaderToAccounts < ActiveRecord::Migration[4.2] def self.up change_table :accounts do |t| - t.attachment :header + # The following corresponds to `t.attachment :header` in an older version of Paperclip + t.string :header_file_name + t.string :header_content_type + t.integer :header_file_size + t.datetime :header_updated_at end end diff --git a/db/migrate/20160905150353_create_media_attachments.rb b/db/migrate/20160905150353_create_media_attachments.rb index 3903a7b9a145f9..92680db9f3d552 100644 --- a/db/migrate/20160905150353_create_media_attachments.rb +++ b/db/migrate/20160905150353_create_media_attachments.rb @@ -4,7 +4,13 @@ class CreateMediaAttachments < ActiveRecord::Migration[5.0] def change create_table :media_attachments do |t| t.integer :status_id, null: true, default: nil - t.attachment :file + + # The following corresponds to `t.attachment :file` in an older version of Paperclip + t.string :file_file_name + t.string :file_content_type + t.integer :file_file_size + t.datetime :file_updated_at + t.string :remote_url, null: false, default: '' t.integer :account_id diff --git a/db/migrate/20170330164118_add_attachment_data_to_imports.rb b/db/migrate/20170330164118_add_attachment_data_to_imports.rb index 908d4da96a0d9f..0daaa9d02e72e6 100644 --- a/db/migrate/20170330164118_add_attachment_data_to_imports.rb +++ b/db/migrate/20170330164118_add_attachment_data_to_imports.rb @@ -3,7 +3,11 @@ class AddAttachmentDataToImports < ActiveRecord::Migration[4.2] def self.up change_table :imports do |t| - t.attachment :data + # The following corresponds to `t.attachment :data` in an older version of Paperclip + t.string :data_file_name + t.string :data_content_type + t.integer :data_file_size + t.datetime :data_updated_at end end diff --git a/db/migrate/20170901141119_truncate_preview_cards.rb b/db/migrate/20170901141119_truncate_preview_cards.rb index b4ba8c45ea633d..f251841f2e6d59 100644 --- a/db/migrate/20170901141119_truncate_preview_cards.rb +++ b/db/migrate/20170901141119_truncate_preview_cards.rb @@ -8,7 +8,13 @@ def up t.string :url, default: '', null: false, index: { unique: true } t.string :title, default: '', null: false t.string :description, default: '', null: false - t.attachment :image + + # The following corresponds to `t.attachment :image` in an older version of Paperclip + t.string :image_file_name + t.string :image_content_type + t.integer :image_file_size + t.datetime :image_updated_at + t.integer :type, default: 0, null: false t.text :html, default: '', null: false t.string :author_name, default: '', null: false diff --git a/db/migrate/20170913000752_create_site_uploads.rb b/db/migrate/20170913000752_create_site_uploads.rb index 43a793806f3348..16a95ea0134fad 100644 --- a/db/migrate/20170913000752_create_site_uploads.rb +++ b/db/migrate/20170913000752_create_site_uploads.rb @@ -4,7 +4,13 @@ class CreateSiteUploads < ActiveRecord::Migration[5.1] def change create_table :site_uploads do |t| t.string :var, default: '', null: false, index: { unique: true } - t.attachment :file + + # The following corresponds to `t.attachment :file` in an older version of Paperclip + t.string :file_file_name + t.string :file_content_type + t.integer :file_file_size + t.datetime :file_updated_at + t.json :meta t.timestamps end diff --git a/db/migrate/20170917153509_create_custom_emojis.rb b/db/migrate/20170917153509_create_custom_emojis.rb index 984fcd2181b63b..dedc8cde80bf56 100644 --- a/db/migrate/20170917153509_create_custom_emojis.rb +++ b/db/migrate/20170917153509_create_custom_emojis.rb @@ -5,7 +5,12 @@ def change create_table :custom_emojis do |t| t.string :shortcode, null: false, default: '' t.string :domain - t.attachment :image + + # The following corresponds to `t.attachment :image` in an older version of Paperclip + t.string :image_file_name + t.string :image_content_type + t.integer :image_file_size + t.datetime :image_updated_at t.timestamps end diff --git a/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb b/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb index a3c6b55fd22f0e..c11a24e8b53cd5 100644 --- a/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb +++ b/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb @@ -2,7 +2,12 @@ class AddThumbnailColumnsToMediaAttachments < ActiveRecord::Migration[5.2] def up - add_attachment :media_attachments, :thumbnail + # The following corresponds to `add_attachment :media_attachments, :thumbnail` in an older version of Paperclip + add_column :media_attachments, :thumbnail_file_name, :string + add_column :media_attachments, :thumbnail_content_type, :string + add_column :media_attachments, :thumbnail_file_size, :integer + add_column :media_attachments, :thumbnail_updated_at, :datetime + add_column :media_attachments, :thumbnail_remote_url, :string end diff --git a/db/post_migrate/20240307180905_migrate_devise_two_factor_secrets.rb b/db/post_migrate/20240307180905_migrate_devise_two_factor_secrets.rb index 360e4806da21f7..6194cf9ee342bf 100644 --- a/db/post_migrate/20240307180905_migrate_devise_two_factor_secrets.rb +++ b/db/post_migrate/20240307180905_migrate_devise_two_factor_secrets.rb @@ -18,7 +18,13 @@ def up users_with_otp_enabled.find_each do |user| # Gets the new value on already-updated users # Falls back to legacy value on not-yet-migrated users - otp_secret = user.otp_secret + otp_secret = begin + user.otp_secret + rescue OpenSSL::OpenSSLError + next if ENV['MIGRATION_IGNORE_INVALID_OTP_SECRET'] == 'true' + + abort_with_decryption_error(user) + end Rails.logger.debug { "Processing #{user.email}" } @@ -36,4 +42,22 @@ def down def users_with_otp_enabled MigrationUser.where(otp_required_for_login: true, otp_secret: nil) end + + def abort_with_decryption_error(user) + abort <<~MESSAGE + + ERROR: Unable to decrypt OTP secret for user #{user.id}. + + This is most likely because you have changed the value of `OTP_SECRET` at some point in + time after the user configured 2FA. + + In this case, their OTP secret had already been lost with the change to `OTP_SECRET`, and + proceeding with this migration will not make the situation worse. + + Please double-check that you have not accidentally changed `OTP_SECRET` just for this + migration, and re-run the migration with `MIGRATION_IGNORE_INVALID_OTP_SECRET=true`. + + Migration aborted. + MESSAGE + end end diff --git a/lib/mastodon/cli/preview_cards.rb b/lib/mastodon/cli/preview_cards.rb index 9b20a0cbb8662d..c0e207ad5969b0 100644 --- a/lib/mastodon/cli/preview_cards.rb +++ b/lib/mastodon/cli/preview_cards.rb @@ -29,7 +29,7 @@ def remove link = options[:link] ? 'link-type ' : '' scope = PreviewCard.cached scope = scope.where(type: :link) if options[:link] - scope = scope.where('updated_at < ?', time_ago) + scope = scope.where(updated_at: ...time_ago) processed, aggregate = parallelize_with_progress(scope) do |preview_card| next if preview_card.image.blank? diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index d6377c9c82c347..d8bc927bc495ba 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -8,7 +8,7 @@ namespace :db do desc 'Generate a set of keys for configuring Active Record encryption in a given environment' task :init do # rubocop:disable Rails/RakeEnvironment puts <<~MSG - Add these environment variables to your Mastodon environment:#{' '} + Add these secret environment variables to your Mastodon environment (e.g. .env.production):#{' '} ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=#{SecureRandom.alphanumeric(32)} ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=#{SecureRandom.alphanumeric(32)} diff --git a/package.json b/package.json index 6216d6bc4725e2..9776a76ea42c83 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@gamestdio/websocket": "^0.3.2", "@github/webauthn-json": "^2.1.1", "@hello-pangea/dnd": "^16.3.0", - "@rails/ujs": "7.1.3-2", + "@rails/ujs": "7.1.3", "@reduxjs/toolkit": "^2.0.1", "@svgr/webpack": "^5.5.0", "arrow-key-navigation": "^1.2.0", diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index b90bb414b06a84..f241d261b1b18d 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -53,11 +53,32 @@ describe 'GET #show' do let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } - let(:account) { Fabricate(:account) } - it 'returns http success' do - get :show, params: { id: account.id } - expect(response).to have_http_status(200) + context 'with a remote account' do + let(:account) { Fabricate(:account, domain: 'example.com') } + + it 'returns http success' do + get :show, params: { id: account.id } + expect(response).to have_http_status(200) + end + end + + context 'with a local account' do + let(:account) { Fabricate(:account, domain: nil) } + + it 'returns http success' do + get :show, params: { id: account.id } + expect(response).to have_http_status(200) + end + end + + context 'with a local deleted account' do + let(:account) { Fabricate(:account, domain: nil, user: nil) } + + it 'returns http success' do + get :show, params: { id: account.id } + expect(response).to have_http_status(200) + end end end diff --git a/spec/fabricators/canonical_email_block_fabricator.rb b/spec/fabricators/canonical_email_block_fabricator.rb index 2f979df794ef21..1ef53ff4a47d8f 100644 --- a/spec/fabricators/canonical_email_block_fabricator.rb +++ b/spec/fabricators/canonical_email_block_fabricator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true Fabricator(:canonical_email_block) do - email { |attrs| attrs[:reference_account] ? attrs[:reference_account].user_email : sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } } + email { sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } } reference_account { Fabricate.build(:account) } end diff --git a/spec/helpers/self_destruct_helper_spec.rb b/spec/helpers/self_destruct_helper_spec.rb new file mode 100644 index 00000000000000..09d7347eee7ab7 --- /dev/null +++ b/spec/helpers/self_destruct_helper_spec.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe SelfDestructHelper do + describe 'self_destruct?' do + context 'when SELF_DESTRUCT is unset' do + it 'returns false' do + expect(helper.self_destruct?).to be false + end + end + + context 'when SELF_DESTRUCT is set to an invalid value' do + around do |example| + ClimateControl.modify SELF_DESTRUCT: 'true' do + example.run + end + end + + it 'returns false' do + expect(helper.self_destruct?).to be false + end + end + + context 'when SELF_DESTRUCT is set to value signed for the wrong purpose' do + around do |example| + ClimateControl.modify( + SELF_DESTRUCT: Rails.application.message_verifier('foo').generate('example.com'), + LOCAL_DOMAIN: 'example.com' + ) do + example.run + end + end + + it 'returns false' do + expect(helper.self_destruct?).to be false + end + end + + context 'when SELF_DESTRUCT is set to value signed for the wrong domain' do + around do |example| + ClimateControl.modify( + SELF_DESTRUCT: Rails.application.message_verifier('self-destruct').generate('foo.com'), + LOCAL_DOMAIN: 'example.com' + ) do + example.run + end + end + + it 'returns false' do + expect(helper.self_destruct?).to be false + end + end + + context 'when SELF_DESTRUCT is set to a correctly-signed value' do + around do |example| + ClimateControl.modify( + SELF_DESTRUCT: Rails.application.message_verifier('self-destruct').generate('example.com'), + LOCAL_DOMAIN: 'example.com' + ) do + example.run + end + end + + it 'returns true' do + expect(helper.self_destruct?).to be true + end + end + end +end diff --git a/spec/lib/activitypub/parser/status_parser_spec.rb b/spec/lib/activitypub/parser/status_parser_spec.rb new file mode 100644 index 00000000000000..5d9f008db158d5 --- /dev/null +++ b/spec/lib/activitypub/parser/status_parser_spec.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe ActivityPub::Parser::StatusParser do + subject { described_class.new(json) } + + let(:sender) { Fabricate(:account, followers_url: 'http://example.com/followers', domain: 'example.com', uri: 'https://example.com/actor') } + let(:follower) { Fabricate(:account, username: 'bob') } + + let(:json) do + { + '@context': 'https://www.w3.org/ns/activitystreams', + id: [ActivityPub::TagManager.instance.uri_for(sender), '#foo'].join, + type: 'Create', + actor: ActivityPub::TagManager.instance.uri_for(sender), + object: object_json, + }.with_indifferent_access + end + + let(:object_json) do + { + id: [ActivityPub::TagManager.instance.uri_for(sender), 'post1'].join('/'), + type: 'Note', + to: [ + 'https://www.w3.org/ns/activitystreams#Public', + ActivityPub::TagManager.instance.uri_for(follower), + ], + content: '@bob lorem ipsum', + contentMap: { + EN: '@bob lorem ipsum', + }, + published: 1.hour.ago.utc.iso8601, + updated: 1.hour.ago.utc.iso8601, + tag: { + type: 'Mention', + href: ActivityPub::TagManager.instance.uri_for(follower), + }, + } + end + + it 'correctly parses status' do + expect(subject).to have_attributes( + text: '@bob lorem ipsum', + uri: [ActivityPub::TagManager.instance.uri_for(sender), 'post1'].join('/'), + reply: false, + language: :en + ) + end +end diff --git a/spec/mailers/admin_mailer_spec.rb b/spec/mailers/admin_mailer_spec.rb index 624628f1c261b0..846147902ded8e 100644 --- a/spec/mailers/admin_mailer_spec.rb +++ b/spec/mailers/admin_mailer_spec.rb @@ -145,4 +145,22 @@ .and(have_header('X-Priority', '1')) end end + + describe '.auto_close_registrations' do + let(:recipient) { Fabricate(:account, username: 'Bob') } + let(:mail) { described_class.with(recipient: recipient).auto_close_registrations } + + before do + recipient.user.update(locale: :en) + end + + it 'renders the email' do + expect(mail) + .to be_present + .and(deliver_to(recipient.user_email)) + .and(deliver_from('notifications@localhost')) + .and(have_subject('Registrations for cb6e6126.ngrok.io have been automatically switched to requiring approval')) + .and(have_body_text('have been automatically switched')) + end + end end diff --git a/spec/mailers/previews/admin_mailer_preview.rb b/spec/mailers/previews/admin_mailer_preview.rb index 0b92ff423aa563..7bf9bb99bb5237 100644 --- a/spec/mailers/previews/admin_mailer_preview.rb +++ b/spec/mailers/previews/admin_mailer_preview.rb @@ -37,4 +37,9 @@ def new_software_updates def new_critical_software_updates AdminMailer.with(recipient: Account.first).new_critical_software_updates end + + # Preview this email at http://localhost:3000/rails/mailers/admin_mailer/auto_close_registrations + def auto_close_registrations + AdminMailer.with(recipient: Account.first).auto_close_registrations + end end diff --git a/spec/requests/api/v1/apps/credentials_spec.rb b/spec/requests/api/v1/apps/credentials_spec.rb index e1455fe799a068..6e6970ce53f03d 100644 --- a/spec/requests/api/v1/apps/credentials_spec.rb +++ b/spec/requests/api/v1/apps/credentials_spec.rb @@ -20,14 +20,26 @@ expect(body_as_json).to match( a_hash_including( + id: token.application.id.to_s, name: token.application.name, website: token.application.website, - vapid_key: Rails.configuration.x.vapid_public_key, scopes: token.application.scopes.map(&:to_s), - client_id: token.application.uid + redirect_uris: token.application.redirect_uris, + # Deprecated properties as of 4.3: + redirect_uri: token.application.redirect_uri.split.first, + vapid_key: Rails.configuration.x.vapid_public_key ) ) end + + it 'does not expose the client_id or client_secret' do + subject + + expect(response).to have_http_status(200) + + expect(body_as_json[:client_id]).to_not be_present + expect(body_as_json[:client_secret]).to_not be_present + end end context 'with a non-read scoped oauth token' do @@ -46,11 +58,14 @@ expect(body_as_json).to match( a_hash_including( + id: token.application.id.to_s, name: token.application.name, website: token.application.website, - vapid_key: Rails.configuration.x.vapid_public_key, scopes: token.application.scopes.map(&:to_s), - client_id: token.application.uid + redirect_uris: token.application.redirect_uris, + # Deprecated properties as of 4.3: + redirect_uri: token.application.redirect_uri.split.first, + vapid_key: Rails.configuration.x.vapid_public_key ) ) end diff --git a/spec/requests/api/v1/apps_spec.rb b/spec/requests/api/v1/apps_spec.rb index acabbc93f0bbd3..1f01bddf3caed2 100644 --- a/spec/requests/api/v1/apps_spec.rb +++ b/spec/requests/api/v1/apps_spec.rb @@ -9,8 +9,9 @@ end let(:client_name) { 'Test app' } - let(:scopes) { nil } - let(:redirect_uris) { 'urn:ietf:wg:oauth:2.0:oob' } + let(:scopes) { 'read write' } + let(:redirect_uri) { 'urn:ietf:wg:oauth:2.0:oob' } + let(:redirect_uris) { [redirect_uri] } let(:website) { nil } let(:params) do @@ -26,13 +27,63 @@ it 'creates an OAuth app', :aggregate_failures do subject + expect(response).to have_http_status(200) + + app = Doorkeeper::Application.find_by(name: client_name) + + expect(app).to be_present + expect(app.scopes.to_s).to eq scopes + expect(app.redirect_uris).to eq redirect_uris + + expect(body_as_json).to match( + a_hash_including( + id: app.id.to_s, + client_id: app.uid, + client_secret: app.secret, + name: client_name, + website: website, + scopes: ['read', 'write'], + redirect_uris: redirect_uris, + # Deprecated properties as of 4.3: + redirect_uri: redirect_uri, + vapid_key: Rails.configuration.x.vapid_public_key + ) + ) + end + end + + context 'without scopes being supplied' do + let(:scopes) { nil } + + it 'creates an OAuth App with the default scope' do + subject + expect(response).to have_http_status(200) expect(Doorkeeper::Application.find_by(name: client_name)).to be_present body = body_as_json - expect(body[:client_id]).to be_present - expect(body[:client_secret]).to be_present + expect(body[:scopes]).to eq Doorkeeper.config.default_scopes.to_a + end + end + + # FIXME: This is a bug: https://github.com/mastodon/mastodon/issues/30152 + context 'with scopes as an array' do + let(:scopes) { %w(read write follow) } + + it 'creates an OAuth App with the default scope' do + subject + + expect(response).to have_http_status(200) + + app = Doorkeeper::Application.find_by(name: client_name) + + expect(app).to be_present + expect(app.scopes.to_s).to eq 'read' + + body = body_as_json + + expect(body[:scopes]).to eq ['read'] end end @@ -77,8 +128,8 @@ end end - context 'with a too-long redirect_uris' do - let(:redirect_uris) { "https://foo.bar/#{'hoge' * 2_000}" } + context 'with a too-long redirect_uri' do + let(:redirect_uris) { "https://app.example/#{'hoge' * 2_000}" } it 'returns http unprocessable entity' do subject @@ -87,8 +138,80 @@ end end - context 'without required params' do - let(:client_name) { '' } + # NOTE: This spec currently tests the same as the "with a too-long redirect_uri test case" + context 'with too many redirect_uris' do + let(:redirect_uris) { (0...500).map { |i| "https://app.example/#{i}/callback" } } + + it 'returns http unprocessable entity' do + subject + + expect(response).to have_http_status(422) + end + end + + context 'with multiple redirect_uris as a string' do + let(:redirect_uris) { "https://redirect1.example/\napp://redirect2.example/" } + + it 'creates an OAuth application with multiple redirect URIs' do + subject + + expect(response).to have_http_status(200) + + app = Doorkeeper::Application.find_by(name: client_name) + + expect(app).to be_present + expect(app.redirect_uri).to eq redirect_uris + expect(app.redirect_uris).to eq redirect_uris.split + + body = body_as_json + + expect(body[:redirect_uri]).to eq redirect_uris + expect(body[:redirect_uris]).to eq redirect_uris.split + end + end + + context 'with multiple redirect_uris as an array' do + let(:redirect_uris) { ['https://redirect1.example/', 'app://redirect2.example/'] } + + it 'creates an OAuth application with multiple redirect URIs' do + subject + + expect(response).to have_http_status(200) + + app = Doorkeeper::Application.find_by(name: client_name) + + expect(app).to be_present + expect(app.redirect_uri).to eq redirect_uris.join "\n" + expect(app.redirect_uris).to eq redirect_uris + + body = body_as_json + + expect(body[:redirect_uri]).to eq redirect_uris.join "\n" + expect(body[:redirect_uris]).to eq redirect_uris + end + end + + context 'with an empty redirect_uris array' do + let(:redirect_uris) { [] } + + it 'returns http unprocessable entity' do + subject + + expect(response).to have_http_status(422) + end + end + + context 'with just a newline as the redirect_uris string' do + let(:redirect_uris) { "\n" } + + it 'returns http unprocessable entity' do + subject + + expect(response).to have_http_status(422) + end + end + + context 'with an empty redirect_uris string' do let(:redirect_uris) { '' } it 'returns http unprocessable entity' do @@ -97,5 +220,30 @@ expect(response).to have_http_status(422) end end + + context 'without a required param' do + let(:client_name) { '' } + + it 'returns http unprocessable entity' do + subject + + expect(response).to have_http_status(422) + end + end + + context 'with a website' do + let(:website) { 'https://app.example/' } + + it 'creates an OAuth application with the website specified' do + subject + + expect(response).to have_http_status(200) + + app = Doorkeeper::Application.find_by(name: client_name) + + expect(app).to be_present + expect(app.website).to eq website + end + end end end diff --git a/spec/requests/api/v2/admin/accounts_spec.rb b/spec/requests/api/v2/admin/accounts_spec.rb index fb04850bb7d2cb..f5db93233c2012 100644 --- a/spec/requests/api/v2/admin/accounts_spec.rb +++ b/spec/requests/api/v2/admin/accounts_spec.rb @@ -8,7 +8,6 @@ let(:scopes) { 'admin:read admin:write' } let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } - let(:account) { Fabricate(:account) } describe 'GET #index' do let!(:remote_account) { Fabricate(:account, domain: 'example.org') } diff --git a/spec/requests/self_destruct_spec.rb b/spec/requests/self_destruct_spec.rb new file mode 100644 index 00000000000000..f71a2325e2a897 --- /dev/null +++ b/spec/requests/self_destruct_spec.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Self-destruct mode' do + before do + allow(SelfDestructHelper).to receive(:self_destruct?).and_return(true) + end + + shared_examples 'generic logged out request' do |path| + it 'returns 410 gone and mentions self-destruct' do + get path, headers: { 'Accept' => 'text/html' } + + expect(response).to have_http_status(410) + expect(response.body).to include(I18n.t('self_destruct.title')) + end + end + + shared_examples 'accessible logged-in endpoint' do |path| + it 'returns 200 ok' do + get path + + expect(response).to have_http_status(200) + end + end + + shared_examples 'ActivityPub request' do |path| + context 'without signature' do + it 'returns 410 gone' do + get path, headers: { + 'Accept' => 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"', + } + + expect(response).to have_http_status(410) + end + end + + context 'with invalid signature' do + it 'returns 410 gone' do + get path, headers: { + 'Accept' => 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"', + 'Signature' => 'keyId="https://remote.domain/users/bob#main-key",algorithm="rsa-sha256",headers="date host (request-target)",signature="bar"', + } + + expect(response).to have_http_status(410) + end + end + end + + context 'when requesting various unavailable endpoints' do + it_behaves_like 'generic logged out request', '/' + it_behaves_like 'generic logged out request', '/about' + it_behaves_like 'generic logged out request', '/public' + end + + context 'when requesting a suspended account' do + let(:suspended) { Fabricate(:account, username: 'suspended') } + + before do + suspended.suspend! + end + + it_behaves_like 'generic logged out request', '/@suspended' + it_behaves_like 'ActivityPub request', '/users/suspended' + it_behaves_like 'ActivityPub request', '/users/suspended/followers' + it_behaves_like 'ActivityPub request', '/users/suspended/outbox' + end + + context 'when requesting a non-suspended account' do + before do + Fabricate(:account, username: 'bob') + end + + it_behaves_like 'generic logged out request', '/@bob' + it_behaves_like 'ActivityPub request', '/users/bob' + it_behaves_like 'ActivityPub request', '/users/bob/followers' + it_behaves_like 'ActivityPub request', '/users/bob/outbox' + end + + context 'when accessing still-enabled endpoints when logged in' do + let(:user) { Fabricate(:user) } + + before do + sign_in(user) + end + + it_behaves_like 'accessible logged-in endpoint', '/auth/edit' + it_behaves_like 'accessible logged-in endpoint', '/settings/export' + it_behaves_like 'accessible logged-in endpoint', '/settings/login_activities' + it_behaves_like 'accessible logged-in endpoint', '/settings/exports/follows.csv' + end +end diff --git a/spec/system/filters_spec.rb b/spec/system/filters_spec.rb new file mode 100644 index 00000000000000..9d18e904608698 --- /dev/null +++ b/spec/system/filters_spec.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Filters' do + let(:user) { Fabricate(:user) } + let(:filter_title) { 'Filter of fun and games' } + + before { sign_in(user) } + + describe 'Creating a filter' do + it 'Populates a new filter from form' do + navigate_to_filters + + click_on I18n.t('filters.new.title') + fill_in_filter_form + expect(page).to have_content(filter_title) + end + end + + describe 'Editing an existing filter' do + let(:new_title) { 'Change title value' } + + before { Fabricate :custom_filter, account: user.account, title: filter_title } + + it 'Updates the saved filter' do + navigate_to_filters + + click_on filter_title + + fill_in filter_title_field, with: new_title + click_on I18n.t('generic.save_changes') + + expect(page).to have_content(new_title) + end + end + + describe 'Destroying an existing filter' do + before { Fabricate :custom_filter, account: user.account, title: filter_title } + + it 'Deletes the filter' do + navigate_to_filters + + expect(page).to have_content filter_title + expect do + click_on I18n.t('filters.index.delete') + end.to change(CustomFilter, :count).by(-1) + + expect(page).to_not have_content(filter_title) + end + end + + def navigate_to_filters + visit settings_path + + click_on I18n.t('filters.index.title') + expect(page).to have_content I18n.t('filters.index.title') + end + + def fill_in_filter_form + fill_in filter_title_field, with: filter_title + check I18n.t('filters.contexts.home') + within('.custom_filter_keywords_keyword') do + fill_in with: 'Keyword' + end + click_on I18n.t('filters.new.save') + end + + def filter_title_field + I18n.t('simple_form.labels.defaults.title') + end +end diff --git a/spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb b/spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb index 4d9185093a2d3b..08ebf82785f6d9 100644 --- a/spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb +++ b/spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb @@ -163,7 +163,7 @@ def cleanable_statuses_count Status .where(account_id: [account_alice, account_chris, account_erin]) # Accounts with enabled policies - .where('created_at < ?', 2.weeks.ago) # Policy defaults is 2.weeks + .where(created_at: ...2.weeks.ago) # Policy defaults is 2.weeks .count end end diff --git a/yarn.lock b/yarn.lock index 193ee8cf0596f7..bce81e89726aa5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2215,13 +2215,13 @@ __metadata: linkType: hard "@formatjs/cli@npm:^6.1.1": - version: 6.2.10 - resolution: "@formatjs/cli@npm:6.2.10" + version: 6.2.12 + resolution: "@formatjs/cli@npm:6.2.12" peerDependencies: "@glimmer/env": ^0.1.7 - "@glimmer/reference": ^0.91.1 - "@glimmer/syntax": ^0.91.1 - "@glimmer/validator": ^0.91.1 + "@glimmer/reference": ^0.91.1 || ^0.92.0 + "@glimmer/syntax": ^0.92.0 + "@glimmer/validator": ^0.92.0 "@vue/compiler-core": ^3.4.0 content-tag: ^2.0.1 ember-template-recast: ^6.1.4 @@ -2245,7 +2245,7 @@ __metadata: optional: true bin: formatjs: bin/formatjs - checksum: 10c0/34b1b0b3be25d945111c1f57913f50da7308ecd05501a27eaca210a774eb50c616b5706ba796d37ffa223ac4c5cddd5f36fe0ca8d31ad8c8ade79cdd497ccfb9 + checksum: 10c0/3bd05a9fad6c837e22988e6638f426c128efa46ab80ff88cf2ad81fb3bc10cf4f228907577fc01e24c2d7d505cfabfaa69f0496d2ec8f0ab2d6b5eaccb5e475c languageName: node linkType: hard @@ -2259,6 +2259,16 @@ __metadata: languageName: node linkType: hard +"@formatjs/ecma402-abstract@npm:2.0.0": + version: 2.0.0 + resolution: "@formatjs/ecma402-abstract@npm:2.0.0" + dependencies: + "@formatjs/intl-localematcher": "npm:0.5.4" + tslib: "npm:^2.4.0" + checksum: 10c0/94cba291aeadffa3ca416087c2c2352c8a741bb4dcb7f47f15c247b1f043ffcef1af5b20a1b7578fbba9e704fc5f1c079923f3537a273d50162be62f8037625c + languageName: node + linkType: hard + "@formatjs/fast-memoize@npm:2.2.0": version: 2.2.0 resolution: "@formatjs/fast-memoize@npm:2.2.0" @@ -2279,6 +2289,17 @@ __metadata: languageName: node linkType: hard +"@formatjs/icu-messageformat-parser@npm:2.7.8": + version: 2.7.8 + resolution: "@formatjs/icu-messageformat-parser@npm:2.7.8" + dependencies: + "@formatjs/ecma402-abstract": "npm:2.0.0" + "@formatjs/icu-skeleton-parser": "npm:1.8.2" + tslib: "npm:^2.4.0" + checksum: 10c0/a3b759a825fb22ffd7b906f6a07b1a079bbc34f72c745de2c2514e439c4bb75bc1a9442eba1bac7ff3ea3010e12076374cd755ad12116b1d066cc90da5fbcbc9 + languageName: node + linkType: hard + "@formatjs/icu-skeleton-parser@npm:1.8.0": version: 1.8.0 resolution: "@formatjs/icu-skeleton-parser@npm:1.8.0" @@ -2289,25 +2310,35 @@ __metadata: languageName: node linkType: hard -"@formatjs/intl-displaynames@npm:6.6.6": - version: 6.6.6 - resolution: "@formatjs/intl-displaynames@npm:6.6.6" +"@formatjs/icu-skeleton-parser@npm:1.8.2": + version: 1.8.2 + resolution: "@formatjs/icu-skeleton-parser@npm:1.8.2" + dependencies: + "@formatjs/ecma402-abstract": "npm:2.0.0" + tslib: "npm:^2.4.0" + checksum: 10c0/9b15013acc47b8d560b52942e3dab2abaaa9c5a4410bbd1d490a4b22bf5ca36fdd88b71f241d05479bddf856d0d1d57b7ecc9e79738497ac518616aa6d4d0015 + languageName: node + linkType: hard + +"@formatjs/intl-displaynames@npm:6.6.8": + version: 6.6.8 + resolution: "@formatjs/intl-displaynames@npm:6.6.8" dependencies: - "@formatjs/ecma402-abstract": "npm:1.18.2" + "@formatjs/ecma402-abstract": "npm:2.0.0" "@formatjs/intl-localematcher": "npm:0.5.4" tslib: "npm:^2.4.0" - checksum: 10c0/4ba40057cfafaabf04485137bc96705d5ed7ac48f17ed7dfe8dbd7f71119667b6c0b7fa75469e32b70c9bada2c5d03af37a5261d655a37b81c63ba907edbb2e8 + checksum: 10c0/1a03e7644022741c1bcf10fcd07da88c434416a13603ace693a038114010463307b4130d3a3f53ad5665bd27fca9a6b19ac8e5bf58e17598b1ea84db173fdfbb languageName: node linkType: hard -"@formatjs/intl-listformat@npm:7.5.5": - version: 7.5.5 - resolution: "@formatjs/intl-listformat@npm:7.5.5" +"@formatjs/intl-listformat@npm:7.5.7": + version: 7.5.7 + resolution: "@formatjs/intl-listformat@npm:7.5.7" dependencies: - "@formatjs/ecma402-abstract": "npm:1.18.2" + "@formatjs/ecma402-abstract": "npm:2.0.0" "@formatjs/intl-localematcher": "npm:0.5.4" tslib: "npm:^2.4.0" - checksum: 10c0/bc9d8cbe42bd9513db0b2b221c0b1a752892005a90fa629b4cf7df1cbd3b96997cddbf420e562ebdfdc691a28d9b759ccae9633d5987aa0bceed5aef77a07ca4 + checksum: 10c0/5d0478752d669d87c82aa80880df464d64a1c8974fcb6136bc854567f570a1696e5468005ffa266cfcb623adb7c7299b839c06ea33897f55d35dab6a7575cc84 languageName: node linkType: hard @@ -2321,33 +2352,33 @@ __metadata: linkType: hard "@formatjs/intl-pluralrules@npm:^5.2.2": - version: 5.2.12 - resolution: "@formatjs/intl-pluralrules@npm:5.2.12" + version: 5.2.14 + resolution: "@formatjs/intl-pluralrules@npm:5.2.14" dependencies: - "@formatjs/ecma402-abstract": "npm:1.18.2" + "@formatjs/ecma402-abstract": "npm:2.0.0" "@formatjs/intl-localematcher": "npm:0.5.4" tslib: "npm:^2.4.0" - checksum: 10c0/0f4d9f4f272dd962b2f742519045ad43a1b6358755787d3394efcc5884b02184cc8d76fb13d98b1f30c41a813b81f82dd2342e1fb0fbd7b7efa69f5d0d59c4d0 + checksum: 10c0/3c00109c8d4c8b221c2b9af38a38d31cd6293a0a412a1f2cdae2b8ef81bd71626c9ff4a647389682cb27ae5c223bd6f64ef54d03e3f6f19c372e0c6194b76b38 languageName: node linkType: hard -"@formatjs/intl@npm:2.10.2": - version: 2.10.2 - resolution: "@formatjs/intl@npm:2.10.2" +"@formatjs/intl@npm:2.10.4": + version: 2.10.4 + resolution: "@formatjs/intl@npm:2.10.4" dependencies: - "@formatjs/ecma402-abstract": "npm:1.18.2" + "@formatjs/ecma402-abstract": "npm:2.0.0" "@formatjs/fast-memoize": "npm:2.2.0" - "@formatjs/icu-messageformat-parser": "npm:2.7.6" - "@formatjs/intl-displaynames": "npm:6.6.6" - "@formatjs/intl-listformat": "npm:7.5.5" - intl-messageformat: "npm:10.5.12" + "@formatjs/icu-messageformat-parser": "npm:2.7.8" + "@formatjs/intl-displaynames": "npm:6.6.8" + "@formatjs/intl-listformat": "npm:7.5.7" + intl-messageformat: "npm:10.5.14" tslib: "npm:^2.4.0" peerDependencies: typescript: ^4.7 || 5 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/20df407e141055e8c7b2605c06e952b643be7ea01d992862e13fc623ca2db034069744eae2be16655bf7888b3add1bfc2653fd0a08bcfdb67fb9b72a306f7718 + checksum: 10c0/ca7877e962f73f1fe0e358f12d73bdc3ec4006c14ee801e06d9f7aef06bcdcc12355a8f53f32b0e890f829949ded35e825c914ca5f4709eb1e08c2a18c1368c2 languageName: node linkType: hard @@ -2371,6 +2402,26 @@ __metadata: languageName: node linkType: hard +"@formatjs/ts-transformer@npm:3.13.14": + version: 3.13.14 + resolution: "@formatjs/ts-transformer@npm:3.13.14" + dependencies: + "@formatjs/icu-messageformat-parser": "npm:2.7.8" + "@types/json-stable-stringify": "npm:^1.0.32" + "@types/node": "npm:14 || 16 || 17" + chalk: "npm:^4.0.0" + json-stable-stringify: "npm:^1.0.1" + tslib: "npm:^2.4.0" + typescript: "npm:5" + peerDependencies: + ts-jest: ">=27" + peerDependenciesMeta: + ts-jest: + optional: true + checksum: 10c0/38450cfce3ec5132f3548c1e9ab098909ca8d2db2b8b6b4b5bb87aa59a4ca1a19bbf6d339ace39bcc931fa80d9946b4c7cf039c9574069b317ae015cd6963bd3 + languageName: node + linkType: hard + "@gamestdio/websocket@npm:^0.3.2": version: 0.3.2 resolution: "@gamestdio/websocket@npm:0.3.2" @@ -2777,7 +2828,7 @@ __metadata: "@gamestdio/websocket": "npm:^0.3.2" "@github/webauthn-json": "npm:^2.1.1" "@hello-pangea/dnd": "npm:^16.3.0" - "@rails/ujs": "npm:7.1.3-2" + "@rails/ujs": "npm:7.1.3" "@reduxjs/toolkit": "npm:^2.0.1" "@svgr/webpack": "npm:^5.5.0" "@testing-library/jest-dom": "npm:^6.0.0" @@ -3061,10 +3112,10 @@ __metadata: languageName: node linkType: hard -"@rails/ujs@npm:7.1.3-2": - version: 7.1.3-2 - resolution: "@rails/ujs@npm:7.1.3-2" - checksum: 10c0/8bd5b3a409c62f53790ed7e914f1f48235f461a472da7b4ce1d9ad57356fcdeaa7891c946298f7f620ff0ff7c6d5b995bf44057929c4fce796867a8cf4f27c99 +"@rails/ujs@npm:7.1.3": + version: 7.1.3 + resolution: "@rails/ujs@npm:7.1.3" + checksum: 10c0/68112d9add9dbc59b40c2ec1bc095a67445c57d20d0ab7d817ce3de0cd90374e2690af8ad54ce6ecc2d1c748b34c0c44d0fbd2f515ce2c443d7c5d23d00b9ce5 languageName: node linkType: hard @@ -3724,9 +3775,9 @@ __metadata: linkType: hard "@types/lodash@npm:^4.14.195": - version: 4.17.1 - resolution: "@types/lodash@npm:4.17.1" - checksum: 10c0/af2ad8a3c8d7deb170a7ec6e18afc5ae8980576e5f7fe798d8a95a1df7222c15bdf967a25a35879f575a3b64743de00145710ee461a0051e055e94e4fe253f45 + version: 4.17.4 + resolution: "@types/lodash@npm:4.17.4" + checksum: 10c0/0124c64cb9fe7a0f78b6777955abd05ef0d97844d49118652eae45f8fa57bfb7f5a7a9bccc0b5a84c0a6dc09631042e4590cb665acb9d58dfd5e6543c75341ec languageName: node linkType: hard @@ -5164,13 +5215,13 @@ __metadata: linkType: hard "axios@npm:^1.4.0": - version: 1.6.8 - resolution: "axios@npm:1.6.8" + version: 1.7.2 + resolution: "axios@npm:1.7.2" dependencies: follow-redirects: "npm:^1.15.6" form-data: "npm:^4.0.0" proxy-from-env: "npm:^1.1.0" - checksum: 10c0/0f22da6f490335479a89878bc7d5a1419484fbb437b564a80c34888fc36759ae4f56ea28d55a191695e5ed327f0bad56e7ff60fb6770c14d1be6501505d47ab9 + checksum: 10c0/cbd47ce380fe045313364e740bb03b936420b8b5558c7ea36a4563db1258c658f05e40feb5ddd41f6633fdd96d37ac2a76f884dad599c5b0224b4c451b3fa7ae languageName: node linkType: hard @@ -5216,21 +5267,21 @@ __metadata: linkType: hard "babel-plugin-formatjs@npm:^10.5.1": - version: 10.5.14 - resolution: "babel-plugin-formatjs@npm:10.5.14" + version: 10.5.16 + resolution: "babel-plugin-formatjs@npm:10.5.16" dependencies: "@babel/core": "npm:^7.10.4" "@babel/helper-plugin-utils": "npm:^7.10.4" "@babel/plugin-syntax-jsx": "npm:7" "@babel/traverse": "npm:7" "@babel/types": "npm:^7.12.11" - "@formatjs/icu-messageformat-parser": "npm:2.7.6" - "@formatjs/ts-transformer": "npm:3.13.12" + "@formatjs/icu-messageformat-parser": "npm:2.7.8" + "@formatjs/ts-transformer": "npm:3.13.14" "@types/babel__core": "npm:^7.1.7" "@types/babel__helper-plugin-utils": "npm:^7.10.0" "@types/babel__traverse": "npm:^7.1.7" tslib: "npm:^2.4.0" - checksum: 10c0/78d33f0304c7b6e36334b2f32bacd144cbbe08cb22318ff994e7adc7705b7f8208354c9af9f87b4390d11aee1ea81cfee9f224a57fe5265173b92ee7de921359 + checksum: 10c0/03d9d2b0b9cdc05c011bfb417a43e5c0f557868ed84d83acbc3cb9072b7fa98f5219473d0bd61f02741c151d6f2162da363bd337522c80af14721ae37f6da86b languageName: node linkType: hard @@ -8913,17 +8964,17 @@ __metadata: linkType: hard "glob@npm:^10.2.2, glob@npm:^10.2.6, glob@npm:^10.3.10, glob@npm:^10.3.7": - version: 10.3.15 - resolution: "glob@npm:10.3.15" + version: 10.3.16 + resolution: "glob@npm:10.3.16" dependencies: foreground-child: "npm:^3.1.0" - jackspeak: "npm:^2.3.6" + jackspeak: "npm:^3.1.2" minimatch: "npm:^9.0.1" minipass: "npm:^7.0.4" path-scurry: "npm:^1.11.0" bin: glob: dist/esm/bin.mjs - checksum: 10c0/cda748ddc181b31b3df9548c0991800406d5cc3b3f8110e37a8751ec1e39f37cdae7d7782d5422d7df92775121cdf00599992dff22f7ff1260344843af227c2b + checksum: 10c0/f7eb4c3e66f221f0be3967c02527047167967549bdf8ed1bd5f6277d43a35191af4e2bb8c89f07a79664958bae088fd06659e69a0f1de462972f1eab52a715e8 languageName: node linkType: hard @@ -9671,15 +9722,15 @@ __metadata: languageName: node linkType: hard -"intl-messageformat@npm:10.5.12, intl-messageformat@npm:^10.3.5": - version: 10.5.12 - resolution: "intl-messageformat@npm:10.5.12" +"intl-messageformat@npm:10.5.14, intl-messageformat@npm:^10.3.5": + version: 10.5.14 + resolution: "intl-messageformat@npm:10.5.14" dependencies: - "@formatjs/ecma402-abstract": "npm:1.18.2" + "@formatjs/ecma402-abstract": "npm:2.0.0" "@formatjs/fast-memoize": "npm:2.2.0" - "@formatjs/icu-messageformat-parser": "npm:2.7.6" + "@formatjs/icu-messageformat-parser": "npm:2.7.8" tslib: "npm:^2.4.0" - checksum: 10c0/f95734e98a05ef7f51de0c27904d3a994528e3a174963bd1b3a6db9416b5fd84bbd8f7d26d84fc547d51af69ccf46dd3f73a3f4f20a2ccef5c9cd90e946ad82c + checksum: 10c0/8ec0a60539f67039356e211bcc8d81cf1bd9d62190a72ab0e94504da92f0242fe2f94ffb512b97cc6f63782b7891874d4038536ce04631e59d762c3441c60b4b languageName: node linkType: hard @@ -10384,16 +10435,16 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^2.3.6": - version: 2.3.6 - resolution: "jackspeak@npm:2.3.6" +"jackspeak@npm:^3.1.2": + version: 3.1.2 + resolution: "jackspeak@npm:3.1.2" dependencies: "@isaacs/cliui": "npm:^8.0.2" "@pkgjs/parseargs": "npm:^0.11.0" dependenciesMeta: "@pkgjs/parseargs": optional: true - checksum: 10c0/f01d8f972d894cd7638bc338e9ef5ddb86f7b208ce177a36d718eac96ec86638a6efa17d0221b10073e64b45edc2ce15340db9380b1f5d5c5d000cbc517dc111 + checksum: 10c0/5f1922a1ca0f19869e23f0dc4374c60d36e922f7926c76fecf8080cc6f7f798d6a9caac1b9428327d14c67731fd551bb3454cb270a5e13a0718f3b3660ec3d5d languageName: node linkType: hard @@ -14304,14 +14355,14 @@ __metadata: linkType: hard "react-dom@npm:^18.2.0": - version: 18.2.0 - resolution: "react-dom@npm:18.2.0" + version: 18.3.1 + resolution: "react-dom@npm:18.3.1" dependencies: loose-envify: "npm:^1.1.0" - scheduler: "npm:^0.23.0" + scheduler: "npm:^0.23.2" peerDependencies: - react: ^18.2.0 - checksum: 10c0/66dfc5f93e13d0674e78ef41f92ed21dfb80f9c4ac4ac25a4b51046d41d4d2186abc915b897f69d3d0ebbffe6184e7c5876f2af26bfa956f179225d921be713a + react: ^18.3.1 + checksum: 10c0/a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85 languageName: node linkType: hard @@ -14388,18 +14439,18 @@ __metadata: linkType: hard "react-intl@npm:^6.4.2": - version: 6.6.6 - resolution: "react-intl@npm:6.6.6" - dependencies: - "@formatjs/ecma402-abstract": "npm:1.18.2" - "@formatjs/icu-messageformat-parser": "npm:2.7.6" - "@formatjs/intl": "npm:2.10.2" - "@formatjs/intl-displaynames": "npm:6.6.6" - "@formatjs/intl-listformat": "npm:7.5.5" + version: 6.6.8 + resolution: "react-intl@npm:6.6.8" + dependencies: + "@formatjs/ecma402-abstract": "npm:2.0.0" + "@formatjs/icu-messageformat-parser": "npm:2.7.8" + "@formatjs/intl": "npm:2.10.4" + "@formatjs/intl-displaynames": "npm:6.6.8" + "@formatjs/intl-listformat": "npm:7.5.7" "@types/hoist-non-react-statics": "npm:^3.3.1" "@types/react": "npm:16 || 17 || 18" hoist-non-react-statics: "npm:^3.3.2" - intl-messageformat: "npm:10.5.12" + intl-messageformat: "npm:10.5.14" tslib: "npm:^2.4.0" peerDependencies: react: ^16.6.0 || 17 || 18 @@ -14407,7 +14458,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/04c1d1ca783f2a5e605544290c93e57629500be6811d7c2c3342903bf9f9a720d2e4c9cf3924133bf84e510ee879bf3d870a3ff269f5b197f894a49047bd089d + checksum: 10c0/7673507eb73ad4edd1593da7173cec68f316cf77037e0959900babd32d5984a39ba7fa10aaa0a23bcddb7b98daf7dd007cb73ddfc39127ede87c18ec780a519c languageName: node linkType: hard @@ -14746,11 +14797,11 @@ __metadata: linkType: hard "react@npm:^18.2.0": - version: 18.2.0 - resolution: "react@npm:18.2.0" + version: 18.3.1 + resolution: "react@npm:18.3.1" dependencies: loose-envify: "npm:^1.1.0" - checksum: 10c0/b562d9b569b0cb315e44b48099f7712283d93df36b19a39a67c254c6686479d3980b7f013dc931f4a5a3ae7645eae6386b4aa5eea933baa54ecd0f9acb0902b8 + checksum: 10c0/283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3 languageName: node linkType: hard @@ -15383,15 +15434,15 @@ __metadata: linkType: hard "sass@npm:^1.62.1": - version: 1.77.1 - resolution: "sass@npm:1.77.1" + version: 1.77.2 + resolution: "sass@npm:1.77.2" dependencies: chokidar: "npm:>=3.0.0 <4.0.0" immutable: "npm:^4.0.0" source-map-js: "npm:>=0.6.2 <2.0.0" bin: sass: sass.js - checksum: 10c0/edcfc7d038234b1198c3ddcac5963fcd1e17a9c1ee0f9bd09784ab5353b60ff50b189b4c9154b34f5da9ca0eaab8b189fd3e83a4b43a494151ad4735f8e5f364 + checksum: 10c0/0d292339064de3c902e209d41de9c4eb2038cff326476aeebbb5be3eee1d23400d975face2b8e124ae617b10af3e93bec01580f61912f34e4c517fe137a118b6 languageName: node linkType: hard @@ -15411,7 +15462,7 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.23.0, scheduler@npm:^0.23.2": +"scheduler@npm:^0.23.2": version: 0.23.2 resolution: "scheduler@npm:0.23.2" dependencies: