diff --git a/.eslintrc.js b/.eslintrc.js index cd1eb4c660..1360fb87f0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -236,7 +236,7 @@ module.exports = { }, // Common React utilities { - pattern: '{classnames,react-helmet,react-router-dom}', + pattern: '{classnames,react-helmet,react-router,react-router-dom}', group: 'external', position: 'before', }, diff --git a/.github/actions/setup-javascript/action.yml b/.github/actions/setup-javascript/action.yml new file mode 100644 index 0000000000..c0f2957fb1 --- /dev/null +++ b/.github/actions/setup-javascript/action.yml @@ -0,0 +1,19 @@ +name: 'Setup Javascript' +description: 'Setup a Javascript environment ready to run the Mastodon code' +inputs: + onlyProduction: + description: Only install production dependencies + default: 'false' + +runs: + using: 'composite' + steps: + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version-file: '.nvmrc' + + - name: Install all yarn packages + shell: bash + run: yarn --frozen-lockfile ${{ inputs.onlyProduction != 'false' && '--production' || '' }} diff --git a/.github/actions/setup-ruby/action.yml b/.github/actions/setup-ruby/action.yml new file mode 100644 index 0000000000..3a6fba9402 --- /dev/null +++ b/.github/actions/setup-ruby/action.yml @@ -0,0 +1,23 @@ +name: 'Setup RUby' +description: 'Setup a Ruby environment ready to run the Mastodon code' +inputs: + ruby-version: + description: The Ruby version to install + default: '.ruby-version' + additional-system-dependencies: + description: 'Additional packages to install' + +runs: + using: 'composite' + steps: + - name: Install system dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y libicu-dev libidn11-dev ${{ inputs.additional-system-dependencies }} + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ inputs.ruby-version }} + bundler-cache: true diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 879a564e1c..e3744ee6dc 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,7 +3,6 @@ extends: [ 'config:recommended', ':labels(dependencies)', - ':maintainLockFilesMonthly', // update non-direct dependencies monthly ':prConcurrentLimitNone', // Remove limit for open PRs at any time. ':prHourlyLimit2', // Rate limit PR creation to a maximum of two per hour. ], diff --git a/.github/workflows/bundler-audit.yml b/.github/workflows/bundler-audit.yml index bfb93a36cd..bbc31598c7 100644 --- a/.github/workflows/bundler-audit.yml +++ b/.github/workflows/bundler-audit.yml @@ -27,14 +27,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Install native Ruby dependencies - run: sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - name: Run bundler-audit run: bundle exec bundler-audit diff --git a/.github/workflows/check-i18n.yml b/.github/workflows/check-i18n.yml index 39cf32ddc4..ceb385933b 100644 --- a/.github/workflows/check-i18n.yml +++ b/.github/workflows/check-i18n.yml @@ -19,25 +19,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Check for missing strings in English JSON run: | diff --git a/.github/workflows/crowdin-download.yml b/.github/workflows/crowdin-download.yml index ef85a31ed2..99271b127b 100644 --- a/.github/workflows/crowdin-download.yml +++ b/.github/workflows/crowdin-download.yml @@ -45,14 +45,8 @@ jobs: run: sudo chown -R runner:docker . # This is needed to run the normalize step - - name: Install native Ruby dependencies - run: sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - name: Run i18n normalize task run: bundle exec i18n-tasks normalize diff --git a/.github/workflows/lint-css.yml b/.github/workflows/lint-css.yml index bd775dba20..7229bec582 100644 --- a/.github/workflows/lint-css.yml +++ b/.github/workflows/lint-css.yml @@ -35,14 +35,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - uses: xt0rted/stylelint-problem-matcher@v1 diff --git a/.github/workflows/lint-haml.yml b/.github/workflows/lint-haml.yml index ca9bd66a4a..8dcab845ee 100644 --- a/.github/workflows/lint-haml.yml +++ b/.github/workflows/lint-haml.yml @@ -30,16 +30,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Install native Ruby dependencies - run: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - name: Run haml-lint run: | diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml index 67d28589cb..1c1ecc2b22 100644 --- a/.github/workflows/lint-js.yml +++ b/.github/workflows/lint-js.yml @@ -39,14 +39,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: ESLint run: yarn lint:js --max-warnings 0 diff --git a/.github/workflows/lint-json.yml b/.github/workflows/lint-json.yml index 1d98c52673..7796bf92c4 100644 --- a/.github/workflows/lint-json.yml +++ b/.github/workflows/lint-json.yml @@ -31,14 +31,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Prettier run: yarn lint:json diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml index 1b3f92c972..51c59937a3 100644 --- a/.github/workflows/lint-md.yml +++ b/.github/workflows/lint-md.yml @@ -31,14 +31,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Prettier run: yarn lint:md diff --git a/.github/workflows/lint-ruby.yml b/.github/workflows/lint-ruby.yml index 92882a084d..411b323486 100644 --- a/.github/workflows/lint-ruby.yml +++ b/.github/workflows/lint-ruby.yml @@ -31,14 +31,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Install native Ruby dependencies - run: sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - name: Set-up RuboCop Problem Matcher uses: r7kamura/rubocop-problem-matchers-action@v1 diff --git a/.github/workflows/lint-yml.yml b/.github/workflows/lint-yml.yml index e77cc98891..908bdef5cc 100644 --- a/.github/workflows/lint-yml.yml +++ b/.github/workflows/lint-yml.yml @@ -33,14 +33,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Prettier run: yarn lint:yml diff --git a/.github/workflows/test-js.yml b/.github/workflows/test-js.yml index 0ef1d9b7c8..79622b6c1f 100644 --- a/.github/workflows/test-js.yml +++ b/.github/workflows/test-js.yml @@ -35,14 +35,8 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install all yarn packages - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Jest testing run: yarn jest --reporters github-actions summary diff --git a/.github/workflows/test-migrations-one-step.yml b/.github/workflows/test-migrations-one-step.yml index 59287e88cf..5dca8e376d 100644 --- a/.github/workflows/test-migrations-one-step.yml +++ b/.github/workflows/test-migrations-one-step.yml @@ -72,16 +72,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install native Ruby dependencies - run: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - name: Create database run: './bin/rails db:create' diff --git a/.github/workflows/test-migrations-two-step.yml b/.github/workflows/test-migrations-two-step.yml index 8f3c84d8f3..59485d285d 100644 --- a/.github/workflows/test-migrations-two-step.yml +++ b/.github/workflows/test-migrations-two-step.yml @@ -71,16 +71,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install native Ruby dependencies - run: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby - name: Create database run: './bin/rails db:create' diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml index f2d2d02fc0..117e751454 100644 --- a/.github/workflows/test-ruby.yml +++ b/.github/workflows/test-ruby.yml @@ -34,24 +34,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v3 + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby + + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript with: - cache: yarn - node-version-file: '.nvmrc' + onlyProduction: 'true' - - name: Install native Ruby dependencies - run: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev - - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - run: yarn --frozen-lockfile --production - name: Precompile assets # Previously had set this, but it's not supported # export NODE_OPTIONS=--openssl-legacy-provider @@ -135,20 +125,11 @@ jobs: path: './public' name: ${{ github.sha }} - - name: Update package index - run: sudo apt-get update - - - name: Install native Ruby dependencies - run: sudo apt-get install -y libicu-dev libidn11-dev - - - name: Install additional system dependencies - run: sudo apt-get install -y ffmpeg imagemagick libpam-dev - - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby with: ruby-version: ${{ matrix.ruby-version}} - bundler-cache: true + additional-system-dependencies: ffmpeg imagemagick libpam-dev - name: Load database schema run: './bin/rails db:create db:schema:load db:seed' @@ -210,28 +191,14 @@ jobs: path: './public' name: ${{ github.sha }} - - name: Update package index - run: sudo apt-get update - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install native Ruby dependencies - run: sudo apt-get install -y libicu-dev libidn11-dev - - - name: Install additional system dependencies - run: sudo apt-get install -y ffmpeg imagemagick - - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby with: ruby-version: ${{ matrix.ruby-version}} - bundler-cache: true + additional-system-dependencies: ffmpeg imagemagick - - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Load database schema run: './bin/rails db:create db:schema:load db:seed' @@ -328,28 +295,14 @@ jobs: path: './public' name: ${{ github.sha }} - - name: Update package index - run: sudo apt-get update - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version-file: '.nvmrc' - - - name: Install native Ruby dependencies - run: sudo apt-get install -y libicu-dev libidn11-dev - - - name: Install additional system dependencies - run: sudo apt-get install -y ffmpeg imagemagick - - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 + - name: Set up Ruby environment + uses: ./.github/actions/setup-ruby with: ruby-version: ${{ matrix.ruby-version}} - bundler-cache: true + additional-system-dependencies: ffmpeg imagemagick - - run: yarn --frozen-lockfile + - name: Set up Javascript environment + uses: ./.github/actions/setup-javascript - name: Load database schema run: './bin/rails db:create db:schema:load db:seed' diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 8a4dbaeff4..7684ab63f7 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,33 +1,21 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2023-10-11 11:31:24 -0400 using Haml-Lint version 0.51.0. +# on 2023-10-25 08:29:48 -0400 using Haml-Lint version 0.51.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 946 + # Offense count: 945 LineLength: enabled: false - # Offense count: 22 - UnnecessaryStringOutput: - enabled: false - - # Offense count: 44 + # Offense count: 10 RuboCop: - enabled: false - - # Offense count: 3 - ViewLength: exclude: - - 'app/views/admin/accounts/show.html.haml' - - 'app/views/admin/reports/show.html.haml' - - 'app/views/disputes/strikes/show.html.haml' - - # Offense count: 2 - IdNames: - exclude: - - 'app/views/oauth/authorizations/error.html.haml' - - 'app/views/shared/_error_messages.html.haml' + - 'app/views/admin/accounts/_buttons.html.haml' + - 'app/views/admin/accounts/_local_account.html.haml' + - 'app/views/admin/accounts/index.html.haml' + - 'app/views/admin/roles/_form.html.haml' + - 'app/views/layouts/application.html.haml' diff --git a/.nvmrc b/.nvmrc index fa69d015bd..48ef2c10ba 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.8 +20.9 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 452711e3d4..969aa53e80 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.56.1. +# using RuboCop version 1.57.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -80,7 +80,6 @@ RSpec/AnyInstance: - 'spec/controllers/admin/accounts_controller_spec.rb' - 'spec/controllers/admin/resets_controller_spec.rb' - 'spec/controllers/admin/settings/branding_controller_spec.rb' - - 'spec/controllers/api/v1/media_controller_spec.rb' - 'spec/controllers/auth/sessions_controller_spec.rb' - 'spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb' - 'spec/controllers/settings/two_factor_authentication/recovery_codes_controller_spec.rb' @@ -180,7 +179,6 @@ RSpec/LetSetup: RSpec/MessageChain: Exclude: - - 'spec/controllers/api/v1/media_controller_spec.rb' - 'spec/models/concerns/remotable_spec.rb' - 'spec/models/session_activation_spec.rb' - 'spec/models/setting_spec.rb' @@ -219,19 +217,6 @@ Rails/ApplicationController: Exclude: - 'app/controllers/health_controller.rb' -# Configuration parameters: Include. -# Include: db/**/*.rb -Rails/CreateTableWithTimestamps: - Exclude: - - 'db/migrate/20170508230434_create_conversation_mutes.rb' - - 'db/migrate/20170823162448_create_status_pins.rb' - - 'db/migrate/20171116161857_create_list_accounts.rb' - - 'db/migrate/20180929222014_create_account_conversations.rb' - - 'db/migrate/20181007025445_create_pghero_space_stats.rb' - - 'db/migrate/20190103124649_create_scheduled_statuses.rb' - - 'db/migrate/20220824233535_create_status_trends.rb' - - 'db/migrate/20221006061337_create_preview_card_trends.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Severity. Rails/DuplicateAssociation: @@ -273,7 +258,6 @@ Rails/LexicallyScopedActionFilter: Exclude: - 'app/controllers/auth/passwords_controller.rb' - 'app/controllers/auth/registrations_controller.rb' - - 'app/controllers/auth/sessions_controller.rb' # This cop supports unsafe autocorrection (--autocorrect-all). Rails/NegateInclude: @@ -289,7 +273,6 @@ Rails/NegateInclude: - 'app/models/custom_filter.rb' - 'app/services/activitypub/process_status_update_service.rb' - 'app/services/fetch_link_card_service.rb' - - 'app/services/search_service.rb' - 'app/workers/web/push_notification_worker.rb' - 'lib/paperclip/color_extractor.rb' @@ -309,24 +292,6 @@ Rails/RakeEnvironment: - 'lib/tasks/repo.rake' - 'lib/tasks/statistics.rake' -# Configuration parameters: Include. -# Include: db/**/*.rb -Rails/ReversibleMigration: - Exclude: - - 'db/migrate/20160223164502_make_uris_nullable_in_statuses.rb' - - 'db/migrate/20161122163057_remove_unneeded_indexes.rb' - - 'db/migrate/20170205175257_remove_devices.rb' - - 'db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb' - - 'db/migrate/20170520145338_change_language_filter_to_opt_out.rb' - - 'db/migrate/20170609145826_remove_default_language_from_statuses.rb' - - 'db/migrate/20170711225116_fix_null_booleans.rb' - - 'db/migrate/20171129172043_add_index_on_stream_entries.rb' - - 'db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb' - - 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' - - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180617162849_remove_unused_indexes.rb' - - 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' - # Configuration parameters: ForbiddenMethods, AllowedMethods. # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all Rails/SkipsModelValidations: @@ -379,31 +344,6 @@ Rails/SkipsModelValidations: - 'spec/services/follow_service_spec.rb' - 'spec/services/update_account_service_spec.rb' -# Configuration parameters: Include. -# Include: db/**/*.rb -Rails/ThreeStateBooleanColumn: - Exclude: - - 'db/migrate/20160325130944_add_admin_to_users.rb' - - 'db/migrate/20161123093447_add_sensitive_to_statuses.rb' - - 'db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb' - - 'db/migrate/20170127165745_add_devise_two_factor_to_users.rb' - - 'db/migrate/20170209184350_add_reply_to_statuses.rb' - - 'db/migrate/20170330163835_create_imports.rb' - - 'db/migrate/20170905165803_add_local_to_statuses.rb' - - 'db/migrate/20171210213213_add_local_only_flag_to_statuses.rb' - - 'db/migrate/20181203021853_add_discoverable_to_accounts.rb' - - 'db/migrate/20190509164208_add_by_moderator_to_tombstone.rb' - - 'db/migrate/20190805123746_add_capabilities_to_tags.rb' - - 'db/migrate/20191212163405_add_hide_collections_to_accounts.rb' - - 'db/migrate/20200309150742_add_forwarded_to_reports.rb' - - 'db/migrate/20210609202149_create_login_activities.rb' - - 'db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb' - - 'db/migrate/20211031031021_create_preview_card_providers.rb' - - 'db/migrate/20211115032527_add_trendable_to_preview_cards.rb' - - 'db/migrate/20220202200743_add_trendable_to_accounts.rb' - - 'db/migrate/20220202200926_add_trendable_to_statuses.rb' - - 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' - # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/UniqueValidationWithoutIndex: @@ -467,7 +407,7 @@ Style/CaseEquality: Exclude: - 'config/initializers/trusted_proxies.rb' -# This cop supports safe autocorrection (--autocorrect). +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods, AllowedPatterns. # AllowedMethods: ==, equal?, eql? Style/ClassEqualityComparison: @@ -675,7 +615,6 @@ Style/RedundantReturn: Style/SafeNavigation: Exclude: - 'app/models/concerns/account_finder_concern.rb' - - 'app/models/status.rb' # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. diff --git a/CHANGELOG.md b/CHANGELOG.md index f9303f0115..6f775fcfa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -938,2331 +938,4 @@ Some of the features in this release have been funded through the [NGI0 Discover - Fix rate limiting for paths with formats ([Gargron](https://github.com/mastodon/mastodon/pull/20675)) - Fix out-of-bound reads in blurhash transcoder ([delroth](https://github.com/mastodon/mastodon/pull/20388)) -## [3.5.3] - 2022-05-26 - -### Added - -- **Add language dropdown to compose form in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/18420), [ykzts](https://github.com/mastodon/mastodon/pull/18460)) -- **Add warning for limited accounts in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/18344)) -- Add `limited` attribute to accounts in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/18344)) - -### Changed - -- **Change RSS feeds** ([Gargron](https://github.com/mastodon/mastodon/pull/18356), [tribela](https://github.com/mastodon/mastodon/pull/18406)) - - Titles are now date and time of post - - Bodies now render all content faithfully, including polls and emojis - - All media attachments are included with Media RSS -- Change "dangerous" to "sensitive" in privacy policy and web UI ([Gargron](https://github.com/mastodon/mastodon/pull/18515)) -- Change unconfirmed accounts to not be visible in REST API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17530)) -- Change `tootctl search deploy` to improve performance ([Gargron](https://github.com/mastodon/mastodon/pull/18463), [Gargron](https://github.com/mastodon/mastodon/pull/18514)) -- Change search indexing to use batches to minimize resource usage ([Gargron](https://github.com/mastodon/mastodon/pull/18451)) - -### Fixed - -- Fix follower and other counters being able to go negative ([Gargron](https://github.com/mastodon/mastodon/pull/18517)) -- Fix unnecessary query on when creating a status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17901)) -- Fix warning an account outside of a report closing all reports for that account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18387)) -- Fix error when resolving a link that redirects to a local post ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18314)) -- Fix preferred posting language returning unusable value in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/18428)) -- Fix race condition error when external status is reblogged ([ykzts](https://github.com/mastodon/mastodon/pull/18424)) -- Fix missing string for appeal validation error ([Gargron](https://github.com/mastodon/mastodon/pull/18410)) -- Fix block/mute lists showing a follow button in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18364)) -- Fix Redis configuration not being changed by `mastodon:setup` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18383)) -- Fix streaming notifications not using quick filter logic in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18316)) -- Fix ambiguous wording on appeal actions in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18328)) -- Fix floating action button obscuring last element in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18332)) -- Fix account warnings not being recorded in audit log ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18338)) -- Fix leftover icons for direct visibility statuses ([Steffo99](https://github.com/mastodon/mastodon/pull/18305)) -- Fix link verification requiring case sensitivity on links ([sgolemon](https://github.com/mastodon/mastodon/pull/18320)) -- Fix embeds not setting their height correctly ([rinsuki](https://github.com/mastodon/mastodon/pull/18301)) - -### Security - -- Fix concurrent unfollowing decrementing follower count more than once ([Gargron](https://github.com/mastodon/mastodon/pull/18527)) -- Fix being able to appeal a strike unlimited times ([Gargron](https://github.com/mastodon/mastodon/pull/18529)) -- Fix being able to report otherwise inaccessible statuses ([Gargron](https://github.com/mastodon/mastodon/pull/18528)) -- Fix empty votes arbitrarily increasing voters count in polls ([Gargron](https://github.com/mastodon/mastodon/pull/18526)) -- Fix moderator identity leak when approving appeal of sensitive marked statuses ([Gargron](https://github.com/mastodon/mastodon/pull/18525)) -- Fix suspended users being able to access APIs that don't require a user ([Gargron](https://github.com/mastodon/mastodon/pull/18524)) -- Fix confirmation redirect to app without `Location` header ([Gargron](https://github.com/mastodon/mastodon/pull/18523)) - -## [3.5.2] - 2022-05-04 - -### Added - -- Add warning on direct messages screen in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/18289)) - - We already had a warning when composing a direct message, it has now been reworded to be more clear - - Same warning is now displayed when viewing sent and received direct messages -- Add ability to set approval-based registration through tootctl ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18248)) -- Add pre-filling of domain from search filter in domain allow/block admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18172)) - -## Changed - -- Change name of “Direct” visibility to “Mentioned people only” in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/18146), [Gargron](https://github.com/mastodon/mastodon/pull/18289), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18291)) -- Change trending posts to only show one post from each account ([Gargron](https://github.com/mastodon/mastodon/pull/18181)) -- Change half-life of trending posts from 6 hours to 2 hours ([Gargron](https://github.com/mastodon/mastodon/pull/18182)) -- Change full-text search feature to also include polls you have voted in ([tribela](https://github.com/mastodon/mastodon/pull/18070)) -- Change Redis from using one connection per process, to using a connection pool ([Gargron](https://github.com/mastodon/mastodon/pull/18135), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18160), [Gargron](https://github.com/mastodon/mastodon/pull/18171)) - - Different threads no longer have to wait on a mutex over a single connection - - However, this does increase the number of Redis connections by a fair amount - - We are planning to optimize Redis use so that the pool can be made smaller in the future - -## Removed - -- Remove IP matching from e-mail domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/18190)) - - The IPs of the blocked e-mail domain or its MX records are no longer checked - - Previously it was too easy to block e-mail providers by mistake - -## Fixed - -- Fix compatibility with Friendica's pinned posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18254), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18260)) -- Fix error when looking up handle with surrounding spaces in REST API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18225)) -- Fix double render error when authorizing interaction ([Gargron](https://github.com/mastodon/mastodon/pull/18203)) -- Fix error when a post references an invalid media attachment ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18211)) -- Fix error when trying to revoke OAuth token without supplying a token ([Gargron](https://github.com/mastodon/mastodon/pull/18205)) -- Fix error caused by missing subject in Webfinger response ([Gargron](https://github.com/mastodon/mastodon/pull/18204)) -- Fix error on attempting to delete an account moderation note ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18196)) -- Fix light-mode emoji borders in web UI ([Gaelan](https://github.com/mastodon/mastodon/pull/18131)) -- Fix being able to scroll away from the loading bar in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/18170)) -- Fix error when a bookmark or favorite has been reported and deleted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18174)) -- Fix being offered empty “Server rules violation” report option in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18165)) -- Fix temporary network errors preventing from authorizing interactions with remote accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18161)) -- Fix incorrect link in "new trending tags" email ([cdzombak](https://github.com/mastodon/mastodon/pull/18156)) -- Fix missing indexes on some foreign keys ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18157)) -- Fix n+1 query on feed merge and populate operations ([Gargron](https://github.com/mastodon/mastodon/pull/18111)) -- Fix feed unmerge worker being exceptionally slow in some conditions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18110)) -- Fix PeerTube videos appearing with an erroneous “Edited at” marker ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18100)) -- Fix instance actor being created incorrectly when running through migrations ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18109)) -- Fix web push notifications containing HTML entities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18071)) -- Fix inconsistent parsing of `TRUSTED_PROXY_IP` ([ykzts](https://github.com/mastodon/mastodon/pull/18051)) -- Fix error when fetching pinned posts ([tribela](https://github.com/mastodon/mastodon/pull/18030)) -- Fix wrong optimization in feed populate operation ([dogelover911](https://github.com/mastodon/mastodon/pull/18009)) -- Fix error in alias settings page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18004)) - -## [3.5.1] - 2022-04-08 - -### Added - -- Add pagination for trending statuses in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17976)) - -### Changed - -- Change e-mail notifications to only be sent when recipient is offline ([Gargron](https://github.com/mastodon/mastodon/pull/17984)) - - Send e-mails for mentions and follows by default again - - But only when recipient does not have push notifications through an app -- Change `website` attribute to be nullable on `Application` entity in REST API ([rinsuki](https://github.com/mastodon/mastodon/pull/17962)) - -### Removed - -- Remove sign-in token authentication, instead send e-mail about new sign-in ([Gargron](https://github.com/mastodon/mastodon/pull/17970)) - - You no longer need to enter a security code sent through e-mail - - Instead you get an e-mail about a new sign-in from an unfamiliar IP address - -### Fixed - -- Fix error responses for `from` search prefix ([single-right-quote](https://github.com/mastodon/mastodon/pull/17963)) -- Fix dangling language-specific trends ([Gargron](https://github.com/mastodon/mastodon/pull/17997)) -- Fix extremely rare race condition when deleting a status or account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17994)) -- Fix trends returning less results per page when filtered in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17996)) -- Fix pagination header on empty trends responses in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17986)) -- Fix cookies secure flag being set when served over Tor ([Gargron](https://github.com/mastodon/mastodon/pull/17992)) -- Fix migration error handling ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17991)) -- Fix error when re-running some migrations if they get interrupted at the wrong moment ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17989)) -- Fix potentially missing statuses when reconnecting to streaming API in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17981), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17987), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17980)) -- Fix error when sending warning emails with custom text ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17983)) -- Fix unset `SMTP_RETURN_PATH` environment variable causing e-mail not to send ([Gargron](https://github.com/mastodon/mastodon/pull/17982)) -- Fix possible duplicate statuses in timelines in some edge cases in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17971)) -- Fix spurious edits and require incoming edits to be explicitly marked as such ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17918)) -- Fix error when encountering invalid pinned statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17964)) -- Fix inconsistency in error handling when removing a status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17974)) -- Fix admin API unconditionally requiring CSRF token ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17975)) -- Fix trending tags endpoint missing `offset` param in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17973)) -- Fix unusual number formatting in some locales ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17929)) -- Fix `S3_FORCE_SINGLE_REQUEST` environment variable not working ([HolgerHuo](https://github.com/mastodon/mastodon/pull/17922)) -- Fix failure to build assets with OpenSSL 3 ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17930)) -- Fix PWA manifest using outdated routes ([HolgerHuo](https://github.com/mastodon/mastodon/pull/17921)) -- Fix error when indexing statuses into Elasticsearch ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17912)) - -## [3.5.0] - 2022-03-30 - -### Added - -- **Add support for incoming edited posts** ([Gargron](https://github.com/mastodon/mastodon/pull/16697), [Gargron](https://github.com/mastodon/mastodon/pull/17727), [Gargron](https://github.com/mastodon/mastodon/pull/17728), [Gargron](https://github.com/mastodon/mastodon/pull/17320), [Gargron](https://github.com/mastodon/mastodon/pull/17404), [Gargron](https://github.com/mastodon/mastodon/pull/17390), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17335), [Gargron](https://github.com/mastodon/mastodon/pull/17696), [Gargron](https://github.com/mastodon/mastodon/pull/17745), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17740), [Gargron](https://github.com/mastodon/mastodon/pull/17697), [Gargron](https://github.com/mastodon/mastodon/pull/17648), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17531), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17499), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17498), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17380), [Gargron](https://github.com/mastodon/mastodon/pull/17373), [Gargron](https://github.com/mastodon/mastodon/pull/17334), [Gargron](https://github.com/mastodon/mastodon/pull/17333), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17699), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17748)) - - Previous versions remain available for perusal and comparison - - People who reblogged a post are notified when it's edited - - New REST APIs: - - `PUT /api/v1/statuses/:id` - - `GET /api/v1/statuses/:id/history` - - `GET /api/v1/statuses/:id/source` - - New streaming API event: - - `status.update` -- **Add appeals for moderator decisions** ([Gargron](https://github.com/mastodon/mastodon/pull/17364), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17725), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17566), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17652), [Gargron](https://github.com/mastodon/mastodon/pull/17616), [Gargron](https://github.com/mastodon/mastodon/pull/17615), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17554), [Gargron](https://github.com/mastodon/mastodon/pull/17523)) - - All default moderator decisions now notify the affected user by e-mail - - They now link to an appeal page instead of suggesting replying to the e-mail - - They can now be found in account settings and not just e-mail - - Users can submit one appeal within 20 days of the decision - - Moderators can approve or reject the appeal -- **Add notifications for posts deleted by moderators** ([Gargron](https://github.com/mastodon/mastodon/pull/17204), [Gargron](https://github.com/mastodon/mastodon/pull/17668), [Gargron](https://github.com/mastodon/mastodon/pull/17746), [Gargron](https://github.com/mastodon/mastodon/pull/17679), [Gargron](https://github.com/mastodon/mastodon/pull/17487)) - - New, redesigned report view in admin UI - - Common report actions now only take one click to complete - - Deleting posts or marking as sensitive from report now notifies user - - Reports can be categorized by reason and specific rules violated - - The reasons are automatically cited in the notifications, except for spam - - Marking posts as sensitive now federates using post editing -- **Add explore page with trending posts and links** ([Gargron](https://github.com/mastodon/mastodon/pull/17123), [Gargron](https://github.com/mastodon/mastodon/pull/17431), [Gargron](https://github.com/mastodon/mastodon/pull/16917), [Gargron](https://github.com/mastodon/mastodon/pull/17677), [Gargron](https://github.com/mastodon/mastodon/pull/16938), [Gargron](https://github.com/mastodon/mastodon/pull/17044), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16978), [Gargron](https://github.com/mastodon/mastodon/pull/16979), [tribela](https://github.com/mastodon/mastodon/pull/17066), [Gargron](https://github.com/mastodon/mastodon/pull/17072), [Gargron](https://github.com/mastodon/mastodon/pull/17403), [noiob](https://github.com/mastodon/mastodon/pull/17624), [mayaeh](https://github.com/mastodon/mastodon/pull/17755), [mayaeh](https://github.com/mastodon/mastodon/pull/17757), [Gargron](https://github.com/mastodon/mastodon/pull/17760), [mayaeh](https://github.com/mastodon/mastodon/pull/17762)) - - Hashtag trends algorithm is extended to work for posts and links - - Links are only considered if they have an adequate preview card - - Preview card generation has been improved to support structured data - - Links can only trend if the publisher (domain) has been approved - - Posts can only trend if the author has been approved - - Individual approval and rejection for posts and links is also available - - Moderators are notified about pending trends at most once every 2 hours - - Posts and link trends are language-specific - - Search page is redesigned into explore page in web UI - - Discovery tab is coming soon in official iOS and Android apps - - New REST APIs: - - `GET /api/v1/trends/links` - - `GET /api/v1/trends/statuses` - - `GET /api/v1/trends/tags` (alias of `GET /api/v1/trends`) - - `GET /api/v1/admin/trends/links` - - `GET /api/v1/admin/trends/statuses` - - `GET /api/v1/admin/trends/tags` -- **Add graphs and retention metrics to admin dashboard** ([Gargron](https://github.com/mastodon/mastodon/pull/16829), [Gargron](https://github.com/mastodon/mastodon/pull/17617), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17570), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16910), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16909), [mashirozx](https://github.com/mastodon/mastodon/pull/16884), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16854)) - - Dashboard shows more numbers with development over time - - Other data such as most used interface languages and sign-up sources - - User retention graph shows how many new users stick around - - New REST APIs: - - `POST /api/v1/admin/measures` - - `POST /api/v1/admin/dimensions` - - `POST /api/v1/admin/retention` -- Add `GET /api/v1/accounts/familiar_followers` to REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17700)) -- Add `POST /api/v1/accounts/:id/remove_from_followers` to REST API ([noellabo](https://github.com/mastodon/mastodon/pull/16864)) -- Add `category` and `rule_ids` params to `POST /api/v1/reports` IN REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17492), [Gargron](https://github.com/mastodon/mastodon/pull/17682), [Gargron](https://github.com/mastodon/mastodon/pull/17713)) - - `category` can be one of: `spam`, `violation`, `other` (default) - - `rule_ids` must reference `rules` returned in `GET /api/v1/instance` -- Add global `lang` param to REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17464), [Gargron](https://github.com/mastodon/mastodon/pull/17592)) -- Add `types` param to `GET /api/v1/notifications` in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17767)) -- **Add notifications for moderators about new sign-ups** ([Gargron](https://github.com/mastodon/mastodon/pull/16953), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17629)) - - When a new user confirms e-mail, moderators receive a notification - - New notification type: - - `admin.sign_up` -- Add authentication history ([Gargron](https://github.com/mastodon/mastodon/pull/16408), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16428), [baby-gnu](https://github.com/mastodon/mastodon/pull/16654)) -- Add ability to automatically delete old posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16529), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17691), [tribela](https://github.com/mastodon/mastodon/pull/16653)) -- Add ability to pin private posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16954), [tribela](https://github.com/mastodon/mastodon/pull/17326), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17304), [MitarashiDango](https://github.com/mastodon/mastodon/pull/17647)) -- Add ability to filter search results by author using `from:` syntax ([tribela](https://github.com/mastodon/mastodon/pull/16526)) -- Add ability to delete canonical email blocks in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16644)) -- Add ability to purge undeliverable domains in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16686), [tribela](https://github.com/mastodon/mastodon/pull/17210), [tribela](https://github.com/mastodon/mastodon/pull/17741), [tribela](https://github.com/mastodon/mastodon/pull/17209)) -- Add ability to disable e-mail token authentication for specific users in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/16427)) -- **Add ability to suspend accounts in batches in admin UI** ([Gargron](https://github.com/mastodon/mastodon/pull/17009), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17301), [Gargron](https://github.com/mastodon/mastodon/pull/17444)) - - New, redesigned accounts list in admin UI - - Batch suspensions are meant to help clean up spam and bot accounts - - They do not generate notifications -- Add ability to filter reports by origin of target account in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/16487)) -- Add support for login through OpenID Connect ([chandrn7](https://github.com/mastodon/mastodon/pull/16221)) -- Add lazy loading for emoji picker in web UI ([mashirozx](https://github.com/mastodon/mastodon/pull/16907), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17011)) -- Add single option votes tooltip in polls in web UI ([Brawaru](https://github.com/mastodon/mastodon/pull/16849)) -- Add confirmation modal when closing media edit modal with unsaved changes in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16518)) -- Add hint about missing media attachment description in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17845)) -- Add support for fetching Create and Announce activities by URI in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16383)) -- Add `S3_FORCE_SINGLE_REQUEST` environment variable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16866)) -- Add `OMNIAUTH_ONLY` environment variable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17288), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17345)) -- Add `ES_USER` and `ES_PASS` environment variables for Elasticsearch authentication ([tribela](https://github.com/mastodon/mastodon/pull/16890)) -- Add `CAS_SECURITY_ASSUME_EMAIL_IS_VERIFIED` environment variable ([baby-gnu](https://github.com/mastodon/mastodon/pull/16655)) -- Add ability to pass specific domains to `tootctl accounts cull` ([tribela](https://github.com/mastodon/mastodon/pull/16511)) -- Add `--by-uri` option to `tootctl domains purge` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16434)) -- Add `--batch-size` option to `tootctl search deploy` ([aquarla](https://github.com/mastodon/mastodon/pull/17049)) -- Add `--remove-orphans` option to `tootctl statuses remove` ([noellabo](https://github.com/mastodon/mastodon/pull/17067)) - -### Changed - -- Change design of federation pages in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/17704), [noellabo](https://github.com/mastodon/mastodon/pull/17735), [Gargron](https://github.com/mastodon/mastodon/pull/17765)) -- Change design of account cards in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17689)) -- Change `follow` scope to be covered by `read` and `write` scopes in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17678)) -- Change design of authorized applications page ([Gargron](https://github.com/mastodon/mastodon/pull/17656), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17686)) -- Change e-mail domain blocks to block IPs dynamically ([Gargron](https://github.com/mastodon/mastodon/pull/17635), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17650), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17649)) -- Change report modal to include category selection in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17565), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17734), [Gargron](https://github.com/mastodon/mastodon/pull/17654), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17632)) -- Change reblogs to not count towards hashtag trends anymore ([Gargron](https://github.com/mastodon/mastodon/pull/17501)) -- Change languages to be listed under standard instead of native name in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/17485)) -- Change routing paths to use usernames in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/16171), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16772), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16773), [mashirozx](https://github.com/mastodon/mastodon/pull/16793), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17060)) -- Change list title input design in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17092)) -- Change "Opt-in to profile directory" preference to be general discoverability preference ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16637)) -- Change API rate limits to use /64 masking on IPv6 addresses ([tribela](https://github.com/mastodon/mastodon/pull/17588), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17600), [zunda](https://github.com/mastodon/mastodon/pull/17590)) -- Change allowed formats for locally uploaded custom emojis to include GIF ([rgroothuijsen](https://github.com/mastodon/mastodon/pull/17706), [Gargron](https://github.com/mastodon/mastodon/pull/17759)) -- Change error message when chosen password is too long ([rgroothuijsen](https://github.com/mastodon/mastodon/pull/17082)) -- Change minimum required Elasticsearch version from 6 to 7 ([noellabo](https://github.com/mastodon/mastodon/pull/16915)) - -### Removed - -- Remove profile directory link from main navigation panel in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17688)) -- **Remove language detection through cld3** ([Gargron](https://github.com/mastodon/mastodon/pull/17478), [ykzts](https://github.com/mastodon/mastodon/pull/17539), [Gargron](https://github.com/mastodon/mastodon/pull/17496), [Gargron](https://github.com/mastodon/mastodon/pull/17722)) - - cld3 is very inaccurate on short-form content even with unique alphabets - - Post language can be overridden individually using `language` param - - Otherwise, it defaults to the user's interface language -- Remove support for `OAUTH_REDIRECT_AT_SIGN_IN` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17287)) - - Use `OMNIAUTH_ONLY` instead -- Remove Keybase integration ([Gargron](https://github.com/mastodon/mastodon/pull/17045)) -- Remove old columns and indexes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17245), [Gargron](https://github.com/mastodon/mastodon/pull/16409), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17191)) -- Remove shortcodes from newly-created media attachments ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16730), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16763)) - -### Deprecated - -- `GET /api/v1/trends` → `GET /api/v1/trends/tags` -- OAuth `follow` scope → `read` and/or `write` -- `text` attribute on `DELETE /api/v1/statuses/:id` → `GET /api/v1/statuses/:id/source` - -### Fixed - -- Fix IDN domains not being rendered correctly in a few left-over places ([Gargron](https://github.com/mastodon/mastodon/pull/17848)) -- Fix Sanskrit translation not being used in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17820)) -- Fix Kurdish languages having the wrong language codes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17812)) -- Fix pghero making database schema suggestions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17807)) -- Fix encoding glitch in the OpenGraph description of a profile page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17821)) -- Fix web manifest not permitting PWA usage from alternate domains ([HolgerHuo](https://github.com/mastodon/mastodon/pull/16714)) -- Fix not being able to edit media attachments for scheduled posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17690)) -- Fix subscribed relay activities being recorded as boosts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17571)) -- Fix streaming API server error messages when JSON parsing fails not specifying the source ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17559)) -- Fix browsers autofilling new password field with old password ([mashirozx](https://github.com/mastodon/mastodon/pull/17702)) -- Fix text being invisible before fonts load in web UI ([tribela](https://github.com/mastodon/mastodon/pull/16330)) -- Fix public profile pages of unconfirmed users being accessible ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17385), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17457)) -- Fix nil error when trying to fetch key for signature verification ([Gargron](https://github.com/mastodon/mastodon/pull/17747)) -- Fix null values being included in some indexes ([Gargron](https://github.com/mastodon/mastodon/pull/17711)) -- Fix `POST /api/v1/emails/confirmations` not being available after sign-up ([Gargron](https://github.com/mastodon/mastodon/pull/17743)) -- Fix rare race condition when reblogged post is deleted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17693), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17730)) -- Fix being able to add more than 4 hashtags to hashtag column in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17729)) -- Fix data integrity of featured tags ([Gargron](https://github.com/mastodon/mastodon/pull/17712)) -- Fix performance of account timelines ([Gargron](https://github.com/mastodon/mastodon/pull/17709)) -- Fix returning empty `

` tag for blank account `note` in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17687)) -- Fix leak of existence of otherwise inaccessible posts in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17684)) -- Fix not showing loading indicator when searching in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17655)) -- Fix media modal footer's “external link” not being a link ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17561)) -- Fix reply button on media modal not giving focus to compose form ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17626)) -- Fix some media attachments being converted with too high framerates ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17619)) -- Fix sign in token and warning emails failing to send when contact e-mail address is malformed ([helloworldstack](https://github.com/mastodon/mastodon/pull/17589)) -- Fix opening the emoji picker scrolling the single-column view to the top ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17579)) -- Fix edge case where settings/admin page sidebar would be incorrectly hidden ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17580)) -- Fix performance of server-side filtering ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17575)) -- Fix privacy policy link not being visible on small screens ([Gargron](https://github.com/mastodon/mastodon/pull/17533)) -- Fix duplicate accounts when searching by IP range in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/17524), [tribela](https://github.com/mastodon/mastodon/pull/17150)) -- Fix error when performing a batch action on posts in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17532)) -- Fix deletes not being signed in authorized fetch mode ([Gargron](https://github.com/mastodon/mastodon/pull/17484)) -- Fix Undo Announce sometimes inlining the originally Announced status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17516)) -- Fix localization of cold-start follow recommendations ([Gargron](https://github.com/mastodon/mastodon/pull/17479), [Gargron](https://github.com/mastodon/mastodon/pull/17486)) -- Fix replies collection incorrectly looping ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17462)) -- Fix errors when multiple Delete are received for a given actor ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17460)) -- Fixed prototype pollution bug and only allow trusted origin ([r0hanSH](https://github.com/mastodon/mastodon/pull/17420)) -- Fix text being incorrectly pre-selected in composer textarea on /share ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17339)) -- Fix SMTP_ENABLE_STARTTLS_AUTO/SMTP_TLS/SMTP_SSL environment variables don't work ([kgtkr](https://github.com/mastodon/mastodon/pull/17216)) -- Fix media upload specific rate limits only being applied to v1 endpoint in REST API ([tribela](https://github.com/mastodon/mastodon/pull/17272)) -- Fix media descriptions not being used for client-side filtering ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17206)) -- Fix cold-start follow recommendation favouring older accounts due to wrong sorting ([noellabo](https://github.com/mastodon/mastodon/pull/17126)) -- Fix not redirect to the right page after authenticating with WebAuthn ([heguro](https://github.com/mastodon/mastodon/pull/17098)) -- Fix searching for additional hashtags in hashtag column ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17054)) -- Fix color of hashtag column settings inputs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17058)) -- Fix performance of `tootctl statuses remove` ([noellabo](https://github.com/mastodon/mastodon/pull/17052)) -- Fix `tootctl accounts cull` not excluding domains on timeouts and certificate issues ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16433)) -- Fix 404 error when filtering admin action logs by non-existent target account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16643)) -- Fix error when accessing streaming API without any OAuth scopes ([Brawaru](https://github.com/mastodon/mastodon/pull/16823)) -- Fix follow request count not updating when new follow requests arrive over streaming API in web UI ([matildepark](https://github.com/mastodon/mastodon/pull/16652)) -- Fix error when unsuspending a local account ([HolgerHuo](https://github.com/mastodon/mastodon/pull/16605)) -- Fix crash when a notification contains a not yet processed media attachment in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16573)) -- Fix wrong color of download button in audio player in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16572)) -- Fix notes for others accounts not being deleted when an account is deleted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16579)) -- Fix error when logging occurrence of unsupported video file ([noellabo](https://github.com/mastodon/mastodon/pull/16581)) -- Fix wrong elements in trends widget being hidden on smaller screens in web UI ([tribela](https://github.com/mastodon/mastodon/pull/16570)) -- Fix link to about page being displayed in limited federation mode ([weex](https://github.com/mastodon/mastodon/pull/16432)) -- Fix styling of boost button in media modal not reflecting ability to boost ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16387)) -- Fix OCR failure when erroneous lang data is in cache ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16386)) -- Fix downloading media from blocked domains in `tootctl media refresh` ([tribela](https://github.com/mastodon/mastodon/pull/16914)) -- Fix login form being displayed on landing page when already logged in ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17348)) -- Fix polling for media processing status too frequently in web UI ([tribela](https://github.com/mastodon/mastodon/pull/17271)) -- Fix hashtag autocomplete overriding user-typed case ([weex](https://github.com/mastodon/mastodon/pull/16460)) -- Fix WebAuthn authentication setup to not prompt for PIN ([truongnmt](https://github.com/mastodon/mastodon/pull/16545)) - -### Security - -- Fix being able to post URLs longer than 4096 characters ([Gargron](https://github.com/mastodon/mastodon/pull/17908)) -- Fix being able to bypass e-mail restrictions ([Gargron](https://github.com/mastodon/mastodon/pull/17909)) - -## [3.4.6] - 2022-02-03 - -### Fixed - -- Fix `mastodon:webpush:generate_vapid_key` task requiring a functional environment ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17338)) -- Fix spurious errors when receiving an Add activity for a private post ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17425)) - -### Security - -- Fix error-prone SQL queries ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15828)) -- Fix not compacting incoming signed JSON-LD activities ([puckipedia](https://github.com/mastodon/mastodon/pull/17426), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/17428)) (CVE-2022-24307) -- Fix insufficient sanitization of report comments ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17430)) -- Fix stop condition of a Common Table Expression ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17427)) -- Disable legacy XSS filtering ([Wonderfall](https://github.com/mastodon/mastodon/pull/17289)) - -## [3.4.5] - 2022-01-31 - -### Added - -- Add more advanced migration tests ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17393)) -- Add github workflow to build Docker images ([unasuke](https://github.com/mastodon/mastodon/pull/16973), [Gargron](https://github.com/mastodon/mastodon/pull/16980), [Gargron](https://github.com/mastodon/mastodon/pull/17000)) - -### Fixed - -- Fix some old migrations failing when skipping releases ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17394)) -- Fix migrations script failing in certain edge cases ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17398)) -- Fix Docker build ([tribela](https://github.com/mastodon/mastodon/pull/17188)) -- Fix Ruby 3.0 dependencies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16723)) -- Fix followers synchronization mechanism ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16510)) - -## [3.4.4] - 2021-11-26 - -### Fixed - -- Fix error when suspending user with an already blocked canonical email ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17036)) -- Fix overflow of long profile fields in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17010)) -- Fix confusing error when WebFinger request returns empty document ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16986)) -- Fix upload of remote media with OpenStack Swift sometimes failing ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16998)) -- Fix logout link not working in Safari ([noellabo](https://github.com/mastodon/mastodon/pull/16574)) -- Fix “open” link of media modal not closing modal in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16524)) -- Fix replying from modal in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16516)) -- Fix `mastodon:setup` command crashing in some circumstances ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16976)) - -### Security - -- Fix filtering DMs from non-followed users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17042)) -- Fix handling of recursive toots in WebUI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17041)) - -## [3.4.3] - 2021-11-06 - -### Fixed - -- Fix login being broken due to inaccurately applied backport fix in 3.4.2 ([Gargron](https://github.com/mastodon/mastodon/commit/5c47a18c8df3231aa25c6d1f140a71a7fac9cbf9)) - -## [3.4.2] - 2021-11-06 - -### Added - -- Add `configuration` attribute to `GET /api/v1/instance` ([Gargron](https://github.com/mastodon/mastodon/pull/16485)) - -### Fixed - -- Fix handling of back button with modal windows in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16499)) -- Fix pop-in player when author has long username in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16468)) -- Fix crash when a status with a playing video gets deleted in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16384)) -- Fix crash with Microsoft Translate in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16525)) -- Fix PWA not being usable from alternate domains ([HolgerHuo](https://github.com/mastodon/mastodon/pull/16714)) -- Fix locale-specific number rounding errors ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16469)) -- Fix scheduling a status decreasing status count ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16791)) -- Fix user's canonical email address being blocked when user deletes own account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16503)) -- Fix not being able to suspend users that already have their canonical e-mail blocked ([Gargron](https://github.com/mastodon/mastodon/pull/16455)) -- Fix anonymous access to outbox not being cached by the reverse proxy ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16458)) -- Fix followers synchronization mechanism not working when URI has empty path ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16744)) -- Fix serialization of counts in REST API when user hides their network ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16418)) -- Fix inefficiencies in auto-linking code ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16506)) -- Fix `tootctl self-destruct` not sending delete activities for recently-suspended accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16688)) -- Fix suspicious sign-in e-mail text being out of date ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16690)) -- Fix some frameworks being unnecessarily loaded ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16725)) -- Fix canonical e-mail blocks missing foreign key constraints ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16448)) -- Fix inconsistent order on account's statuses page in admin UI ([tribela](https://github.com/mastodon/mastodon/pull/16937)) -- Fix media from blocked domains being redownloaded by `tootctl media refresh` ([tribela](https://github.com/mastodon/mastodon/pull/16914)) -- Fix `mastodon:setup` generated env-file syntax ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16896)) -- Fix link previews being incorrectly generated from earlier links ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16885)) -- Fix wrong `to`/`cc` values for remote groups in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16700)) -- Fix mentions with non-ascii TLDs not being processed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16689)) -- Fix authentication failures halfway through a sign-in attempt ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16607), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16792)) -- Fix suspended accounts statuses being merged back into timelines ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16628)) -- Fix crash when encountering invalid account fields ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16598)) -- Fix invalid blurhash handling for remote activities ([noellabo](https://github.com/mastodon/mastodon/pull/16583)) -- Fix newlines being added to account notes when an account moves ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16415), [noellabo](https://github.com/mastodon/mastodon/pull/16576)) -- Fix crash when creating an announcement with links ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16941)) -- Fix logging out from one browser logging out all other sessions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16943)) - -### Security - -- Fix user notes not having a length limit ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16942)) -- Fix revoking a specific session not working ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16943)) - -## [3.4.1] - 2021-06-03 - -### Added - -- Add new emoji assets from Twemoji 13.1.0 ([Gargron](https://github.com/mastodon/mastodon/pull/16345)) - -### Fixed - -- Fix some ActivityPub identifiers in server actor outbox ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16343)) -- Fix custom CSS path setting cookies and being uncacheable due to it ([tribela](https://github.com/mastodon/mastodon/pull/16314)) -- Fix unread notification count when polling in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16272)) -- Fix health check not being accessible through localhost ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16270)) -- Fix some redis locks auto-releasing too fast ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16276), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16291)) -- Fix e-mail confirmations API not working correctly ([Gargron](https://github.com/mastodon/mastodon/pull/16348)) -- Fix migration script not being able to run if it fails midway ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16312)) -- Fix account deletion sometimes failing because of optimistic locks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16317)) -- Fix deprecated slash as division in SASS files ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16347)) -- Fix `tootctl search deploy` compatibility error on Ruby 3 ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16346)) -- Fix mailer jobs for deleted notifications erroring out ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16294)) - -## [3.4.0] - 2021-05-16 - -### Added - -- **Add follow recommendations for onboarding** ([Gargron](https://github.com/mastodon/mastodon/pull/15945), [Gargron](https://github.com/mastodon/mastodon/pull/16161), [Gargron](https://github.com/mastodon/mastodon/pull/16060), [Gargron](https://github.com/mastodon/mastodon/pull/16077), [Gargron](https://github.com/mastodon/mastodon/pull/16078), [Gargron](https://github.com/mastodon/mastodon/pull/16160), [Gargron](https://github.com/mastodon/mastodon/pull/16079), [noellabo](https://github.com/mastodon/mastodon/pull/16044), [noellabo](https://github.com/mastodon/mastodon/pull/16045), [Gargron](https://github.com/mastodon/mastodon/pull/16152), [Gargron](https://github.com/mastodon/mastodon/pull/16153), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16082), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16173), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16159), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16189)) - - Tutorial on first web UI launch has been replaced with follow suggestions - - Follow suggestions take user locale into account and are a mix of accounts most followed by currently active local users, and accounts that wrote the most shared/favourited posts in the last 30 days - - Only accounts that have opted-in to being discoverable from their profile settings, and that do not require follow requests, will be suggested - - Moderators can review suggestions for every supported locale and suppress specific suggestions from appearing and admins can ensure certain accounts always show up in suggestions from the settings area - - New users no longer automatically follow admins -- **Add server rules** ([Gargron](https://github.com/mastodon/mastodon/pull/15769), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15778)) - - Admins can create and edit itemized server rules - - They are available through the REST API and on the about page -- **Add canonical e-mail blocks for suspended accounts** ([Gargron](https://github.com/mastodon/mastodon/pull/16049)) - - Normally, people can make multiple accounts using the same e-mail address using the `+` trick or by inserting or removing `.` characters from the first part of their address - - Once an account is suspended, it will no longer be possible for the e-mail address used by that account to be used for new sign-ups in any of its forms -- Add management of delivery availability in admin UI ([noellabo](https://github.com/mastodon/mastodon/pull/15771)) -- **Add system checks to dashboard in admin UI** ([Gargron](https://github.com/mastodon/mastodon/pull/15989), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15954), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16002)) - - The dashboard will now warn you if you some Sidekiq queues are not being processed, if you have not defined any server rules, or if you forgot to run database migrations from the latest Mastodon upgrade -- Add inline description of moderation actions in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15792)) -- Add "recommended" label to activity/peers API toggles in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/16081)) -- Add joined date to profiles in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/16169), [rinsuki](https://github.com/mastodon/mastodon/pull/16186)) -- Add transition to media modal background in web UI ([mkljczk](https://github.com/mastodon/mastodon/pull/15843)) -- Add option to opt-out of unread notification markers in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15842)) -- Add borders to 📱, 🚲, and 📲 emojis in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15794), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16035)) -- Add dropdown for boost privacy in boost confirmation modal in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15704)) -- Add support for Ruby 3.0 ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16046), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16174)) -- Add `Message-ID` header to outgoing emails ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16076)) - - Some e-mail spam filters penalize e-mails that have a `Message-ID` header that uses a different domain name than the sending e-mail address. Now, the same domain will be used -- Add `af`, `gd` and `si` locales ([Gargron](https://github.com/mastodon/mastodon/pull/16090)) -- Add guard against DNS rebinding attacks ([noellabo](https://github.com/mastodon/mastodon/pull/16087), [noellabo](https://github.com/mastodon/mastodon/pull/16095)) -- Add HTTP header to explicitly opt-out of FLoC by default ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16036)) -- Add missing push notification title for polls and statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15929), [mkljczk](https://github.com/mastodon/mastodon/pull/15564), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15931)) -- Add `POST /api/v1/emails/confirmations` to REST API ([Gargron](https://github.com/mastodon/mastodon/pull/15816), [Gargron](https://github.com/mastodon/mastodon/pull/15949)) - - This method allows an app through which a user signed-up to request a new confirmation e-mail to be sent, or to change the e-mail of the account before it is confirmed -- Add `GET /api/v1/accounts/lookup` to REST API ([Gargron](https://github.com/mastodon/mastodon/pull/15740), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15750)) - - This method allows to quickly convert a username of a known account to an ID that can be used with the REST API, or to check if a username is available - for sign-up -- Add `policy` param to `POST /api/v1/push/subscriptions` in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/16040)) - - This param allows an app to control from whom notifications should be delivered as push notifications to the app -- Add `details` to error response for `POST /api/v1/accounts` in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/15803)) - - This attribute allows an app to display more helpful information to the user about why the sign-up did not succeed -- Add `SIDEKIQ_REDIS_URL` and related environment variables to optionally use a separate Redis server for Sidekiq ([noellabo](https://github.com/mastodon/mastodon/pull/16188)) - -### Changed - -- Change trending hashtags to be affected be reblogs ([Gargron](https://github.com/mastodon/mastodon/pull/16164)) - - Previously, only original posts contributed to a hashtag's trending score - - Now, reblogs of posts will also contribute to that hashtag's trending score -- Change e-mail confirmation link to always redirect to web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16151)) -- Change log level of worker lifecycle to WARN in streaming API ([Gargron](https://github.com/mastodon/mastodon/pull/16110)) - - Since running with INFO log level in production is not always desirable, it is easy to miss when a worker is shutdown and a new one is started -- Change the nouns "toot" and "status" to "post" in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/16080), [Gargron](https://github.com/mastodon/mastodon/pull/16089)) - - To be clear, the button still says "Toot!" -- Change order of dropdown menu on posts to be more intuitive in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/15647)) -- Change description of keyboard shortcuts in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/16129)) -- Change option labels on edit profile page ([Gargron](https://github.com/mastodon/mastodon/pull/16041)) - - "Lock account" is now "Require follow requests" - - "List this account on the directory" is now "Suggest account to others" - - "Hide your network" is now "Hide your social graph" -- Change newly generated account IDs to not be enumerable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15844)) -- Change Web Push API deliveries to use request pooling ([Gargron](https://github.com/mastodon/mastodon/pull/16014)) -- Change multiple mentions with same username to render with domain ([Gargron](https://github.com/mastodon/mastodon/pull/15718), [noellabo](https://github.com/mastodon/mastodon/pull/16038)) - - When a post contains mentions of two or more users who have the same username, but on different domains, render their names with domain to help disambiguate them - - Always render the domain of usernames used in profile metadata -- Change health check endpoint to reveal less information ([Gargron](https://github.com/mastodon/mastodon/pull/15988)) -- Change account counters to use upsert (requires Postgres >= 9.5) ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15913)) -- Change `mastodon:setup` to not call `assets:precompile` in Docker ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13942)) -- **Change max. image dimensions to 1920x1080px (1080p)** ([Gargron](https://github.com/mastodon/mastodon/pull/15690)) - - Previously, this was 1280x1280px - - This is the amount of pixels that original images get downsized to -- Change custom emoji to be animated when hovering container in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15637)) -- Change streaming API from deprecated ClusterWS/cws to ws ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15932)) -- Change systemd configuration to add sandboxing features ([Izorkin](https://github.com/mastodon/mastodon/pull/15937), [Izorkin](https://github.com/mastodon/mastodon/pull/16103), [Izorkin](https://github.com/mastodon/mastodon/pull/16127)) -- Change nginx configuration to make running Onion service easier ([cohosh](https://github.com/mastodon/mastodon/pull/15498)) -- Change Helm configuration ([dunn](https://github.com/mastodon/mastodon/pull/15722), [dunn](https://github.com/mastodon/mastodon/pull/15728), [dunn](https://github.com/mastodon/mastodon/pull/15748), [dunn](https://github.com/mastodon/mastodon/pull/15749), [dunn](https://github.com/mastodon/mastodon/pull/15767)) -- Change Docker configuration ([SuperSandro2000](https://github.com/mastodon/mastodon/pull/10823), [mashirozx](https://github.com/mastodon/mastodon/pull/15978)) - -### Removed - -- Remove PubSubHubbub-related columns from accounts table ([Gargron](https://github.com/mastodon/mastodon/pull/16170), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15857)) -- Remove dependency on @babel/plugin-proposal-class-properties ([ykzts](https://github.com/mastodon/mastodon/pull/16155)) -- Remove dependency on pluck_each gem ([Gargron](https://github.com/mastodon/mastodon/pull/16012)) -- Remove spam check and dependency on nilsimsa gem ([Gargron](https://github.com/mastodon/mastodon/pull/16011)) -- Remove MySQL-specific code from Mastodon::MigrationHelpers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15924)) -- Remove IE11 from supported browsers target ([gol-cha](https://github.com/mastodon/mastodon/pull/15779)) - -### Fixed - -- Fix "You might be interested in" flashing while searching in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/16162)) -- Fix display of posts without text content in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15665)) -- Fix Google Translate breaking web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15610), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15611)) -- Fix web UI crashing when SVG support is disabled ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15809)) -- Fix web UI crash when a status opened in the media modal is deleted ([kaias1jp](https://github.com/mastodon/mastodon/pull/15701)) -- Fix OCR language data failing to load in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15519)) -- Fix footer links not being clickable in Safari in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/15496)) -- Fix autofocus/autoselection not working on mobile in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15555), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15985)) -- Fix media redownload worker retrying on unexpected response codes ([Gargron](https://github.com/mastodon/mastodon/pull/16111)) -- Fix thread resolve worker retrying when status no longer exists ([Gargron](https://github.com/mastodon/mastodon/pull/16109)) -- Fix n+1 queries when rendering statuses in REST API ([abcang](https://github.com/mastodon/mastodon/pull/15641)) -- Fix n+1 queries when rendering notifications in REST API ([abcang](https://github.com/mastodon/mastodon/pull/15640)) -- Fix delete of local reply to local parent not being forwarded ([Gargron](https://github.com/mastodon/mastodon/pull/16096)) -- Fix remote reporters not receiving suspend/unsuspend activities ([Gargron](https://github.com/mastodon/mastodon/pull/16050)) -- Fix understanding (not fully qualified) `as:Public` and `Public` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15948)) -- Fix actor update not being distributed on profile picture deletion ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15461)) -- Fix processing of incoming Delete activities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16084)) -- Fix processing of incoming Block activities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15546)) -- Fix processing of incoming Update activities of unknown accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15514)) -- Fix URIs of repeat follow requests not being recorded ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15662)) -- Fix error on requests with no `Digest` header ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15782)) -- Fix activity object not requiring signature in secure mode ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15592)) -- Fix database serialization failure returning HTTP 500 ([Gargron](https://github.com/mastodon/mastodon/pull/16101)) -- Fix media processing getting stuck on too much stdin/stderr ([Gargron](https://github.com/mastodon/mastodon/pull/16136)) -- Fix some inefficient array manipulations ([007lva](https://github.com/mastodon/mastodon/pull/15513), [007lva](https://github.com/mastodon/mastodon/pull/15527)) -- Fix some inefficient regex matching ([007lva](https://github.com/mastodon/mastodon/pull/15528)) -- Fix some inefficient SQL queries ([abcang](https://github.com/mastodon/mastodon/pull/16104), [abcang](https://github.com/mastodon/mastodon/pull/16106), [abcang](https://github.com/mastodon/mastodon/pull/16105)) -- Fix trying to fetch key from empty URI when verifying HTTP signature ([Gargron](https://github.com/mastodon/mastodon/pull/16100)) -- Fix `tootctl maintenance fix-duplicates` failures ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15923), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15515)) -- Fix error when removing status caused by race condition ([Gargron](https://github.com/mastodon/mastodon/pull/16099)) -- Fix blocking someone not clearing up list feeds ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16205)) -- Fix misspelled URLs character counting ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15382)) -- Fix Sidekiq hanging forever due to a Resolv bug in Ruby 2.7.3 ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16157)) -- Fix edge case where follow limit interferes with accepting a follow ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16098)) -- Fix inconsistent lead text style in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/16052), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/16086)) -- Fix reports of already suspended accounts being recorded ([Gargron](https://github.com/mastodon/mastodon/pull/16047)) -- Fix sign-up restrictions based on IP addresses not being enforced ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15607)) -- Fix YouTube embeds failing due to YouTube serving wrong OEmbed URLs ([Gargron](https://github.com/mastodon/mastodon/pull/15716)) -- Fix error when rendering public pages with media without meta ([Gargron](https://github.com/mastodon/mastodon/pull/16112)) -- Fix misaligned logo on follow button on public pages ([noellabo](https://github.com/mastodon/mastodon/pull/15458)) -- Fix video modal not working on public pages ([noellabo](https://github.com/mastodon/mastodon/pull/15469)) -- Fix race conditions on account migration creation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15597)) -- Fix not being able to change world filter expiration back to “Never” ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15858)) -- Fix `.env.vagrant` not setting `RAILS_ENV` variable ([chandrn7](https://github.com/mastodon/mastodon/pull/15709)) -- Fix error when muting users with `duration` in REST API ([Tak](https://github.com/mastodon/mastodon/pull/15516)) -- Fix border padding on front page in light theme ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15926)) -- Fix wrong URL to custom CSS when `CDN_HOST` is used ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15927)) -- Fix `tootctl accounts unfollow` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15639)) -- Fix `tootctl emoji import` wasting time on MacOS shadow files ([cortices](https://github.com/mastodon/mastodon/pull/15430)) -- Fix `tootctl emoji import` not treating shortcodes as case-insensitive ([angristan](https://github.com/mastodon/mastodon/pull/15738)) -- Fix some issues with SAML account creation ([Gargron](https://github.com/mastodon/mastodon/pull/15222), [kaiyou](https://github.com/mastodon/mastodon/pull/15511)) -- Fix MX validation applying for explicitly allowed e-mail domains ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15930)) -- Fix share page not using configured custom mascot ([tribela](https://github.com/mastodon/mastodon/pull/15687)) -- Fix instance actor not being automatically created if it wasn't seeded properly ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15693)) -- Fix HTTPS enforcement preventing Mastodon from being run as an Onion service ([cohosh](https://github.com/mastodon/mastodon/pull/15560), [jtracey](https://github.com/mastodon/mastodon/pull/15741), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15712), [cohosh](https://github.com/mastodon/mastodon/pull/15725)) -- Fix app name, website and redirect URIs not having a maximum length ([Gargron](https://github.com/mastodon/mastodon/pull/16042)) - -## [3.3.0] - 2020-12-27 - -### Added - -- **Add hotkeys for audio/video control in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/15158), [Gargron](https://github.com/mastodon/mastodon/pull/15198)) - - `Space` and `k` to toggle playback - - `m` to toggle mute - - `f` to toggle fullscreen - - `j` and `l` to go back and forward by 10 seconds - - `.` and `,` to go back and forward by a frame (video only) -- Add expand/compress button on media modal in web UI ([mashirozx](https://github.com/mastodon/mastodon/pull/15068), [mashirozx](https://github.com/mastodon/mastodon/pull/15088), [mashirozx](https://github.com/mastodon/mastodon/pull/15094)) -- Add border around 🕺 emoji in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14769)) -- Add border around 🐞 emoji in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14712)) -- Add home link to the getting started column when home isn't mounted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14707)) -- Add option to disable swiping motions across the web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13885)) -- **Add pop-out player for audio/video in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/14870), [Gargron](https://github.com/mastodon/mastodon/pull/15157), [Gargron](https://github.com/mastodon/mastodon/pull/14915), [noellabo](https://github.com/mastodon/mastodon/pull/15309)) - - Continue watching/listening when you scroll away - - Action bar to interact with/open toot from the pop-out player -- Add unread notification markers in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14818), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14960), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14954), [noellabo](https://github.com/mastodon/mastodon/pull/14897), [noellabo](https://github.com/mastodon/mastodon/pull/14907)) -- Add paragraph about browser add-ons when encountering errors in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14801)) -- Add import and export for bookmarks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14956)) -- Add cache buster feature for media files ([Gargron](https://github.com/mastodon/mastodon/pull/15155)) - - If you have a proxy cache in front of object storage, deleted files will persist until the cache expires - - If enabled, cache buster will make a special request to the proxy to signal a cache reset -- Add duration option to the mute function ([aquarla](https://github.com/mastodon/mastodon/pull/13831)) -- Add replies policy option to the list function ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9205), [trwnh](https://github.com/mastodon/mastodon/pull/15304)) -- Add `og:published_time` OpenGraph tags on toots ([nornagon](https://github.com/mastodon/mastodon/pull/14865)) -- **Add option to be notified when a followed user posts** ([Gargron](https://github.com/mastodon/mastodon/pull/13546), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14896), [Gargron](https://github.com/mastodon/mastodon/pull/14822)) - - If you don't want to miss a toot, click the bell button! -- Add client-side validation in password change forms ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14564)) -- Add client-side validation in the registration form ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14560), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14599)) -- Add support for Gemini URLs ([joshleeb](https://github.com/mastodon/mastodon/pull/15013)) -- Add app shortcuts to web app manifest ([mkljczk](https://github.com/mastodon/mastodon/pull/15234)) -- Add WebAuthn as an alternative 2FA method ([santiagorodriguez96](https://github.com/mastodon/mastodon/pull/14466), [jiikko](https://github.com/mastodon/mastodon/pull/14806)) -- Add honeypot fields and minimum fill-out time for sign-up form ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15276)) -- Add icon for mutual relationships in relationship manager ([noellabo](https://github.com/mastodon/mastodon/pull/15149)) -- Add follow selected followers button in relationship manager ([noellabo](https://github.com/mastodon/mastodon/pull/15148)) -- **Add subresource integrity for JS and CSS assets** ([Gargron](https://github.com/mastodon/mastodon/pull/15096)) - - If you use a CDN for static assets (JavaScript, CSS, and so on), you have to trust that the CDN does not modify the assets maliciously - - Subresource integrity compares server-generated asset digests with what's actually served from the CDN and prevents such attacks -- Add `ku`, `sa`, `sc`, `zgh` to available locales ([ykzts](https://github.com/mastodon/mastodon/pull/15138)) -- Add ability to force an account to mark media as sensitive ([noellabo](https://github.com/mastodon/mastodon/pull/14361)) -- **Add ability to block access or limit sign-ups from chosen IPs** ([Gargron](https://github.com/mastodon/mastodon/pull/14963), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15263)) - - Add rules for IPs or CIDR ranges that automatically expire after a configurable amount of time - - Choose the severity of the rule, either blocking all access or merely limiting sign-ups -- **Add support for reversible suspensions through ActivityPub** ([Gargron](https://github.com/mastodon/mastodon/pull/14989)) - - Servers can signal that one of their accounts has been suspended - - During suspension, the account can only delete its own content - - A reversal of the suspension can be signalled the same way - - A local suspension always overrides a remote one -- Add indication to admin UI of whether a report has been forwarded ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13237)) -- Add display of reasons for joining of an account in admin UI ([mashirozx](https://github.com/mastodon/mastodon/pull/15265)) -- Add option to obfuscate domain name in public list of domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/15355)) -- Add option to make reasons for joining required on sign-up ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15326), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15358), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15385), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15405)) -- Add ActivityPub follower synchronization mechanism ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14510), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15026)) -- Add outbox attribute to instance actor ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14721)) -- Add featured hashtags as an ActivityPub collection ([Gargron](https://github.com/mastodon/mastodon/pull/11595), [noellabo](https://github.com/mastodon/mastodon/pull/15277)) -- Add support for dereferencing objects through bearcaps ([Gargron](https://github.com/mastodon/mastodon/pull/14683), [noellabo](https://github.com/mastodon/mastodon/pull/14981)) -- Add `S3_READ_TIMEOUT` environment variable ([tateisu](https://github.com/mastodon/mastodon/pull/14952)) -- Add `ALLOWED_PRIVATE_ADDRESSES` environment variable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14722)) -- Add `--fix-permissions` option to `tootctl media remove-orphans` ([Gargron](https://github.com/mastodon/mastodon/pull/14383), [uist1idrju3i](https://github.com/mastodon/mastodon/pull/14715)) -- Add `tootctl accounts merge` ([Gargron](https://github.com/mastodon/mastodon/pull/15201), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15264), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15256)) - - Has someone changed their domain or subdomain thereby creating two accounts where there should be one? - - This command will fix it on your end -- Add `tootctl maintenance fix-duplicates` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14860), [Gargron](https://github.com/mastodon/mastodon/pull/15223), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15373)) - - Index corruption in the database? - - This command is for you -- **Add support for managing multiple stream subscriptions in a single connection** ([Gargron](https://github.com/mastodon/mastodon/pull/14524), [Gargron](https://github.com/mastodon/mastodon/pull/14566), [mfmfuyu](https://github.com/mastodon/mastodon/pull/14859), [zunda](https://github.com/mastodon/mastodon/pull/14608)) - - Previously, getting live updates for multiple timelines required opening a HTTP or WebSocket connection for each - - More connections means more resource consumption on both ends, not to mention the (ever so slight) delay when establishing a new connection - - Now, with just a single WebSocket connection you can subscribe and unsubscribe to and from multiple streams -- Add support for limiting results by both `min_id` and `max_id` at the same time in REST API ([tateisu](https://github.com/mastodon/mastodon/pull/14776)) -- Add `GET /api/v1/accounts/:id/featured_tags` to REST API ([noellabo](https://github.com/mastodon/mastodon/pull/11817), [noellabo](https://github.com/mastodon/mastodon/pull/15270)) -- Add stoplight for object storage failures, return HTTP 503 in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/13043)) -- Add optional `tootctl remove media` cronjob in Helm chart ([dunn](https://github.com/mastodon/mastodon/pull/14396)) -- Add clean error message when `RAILS_ENV` is unset ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15381)) - -### Changed - -- **Change media modals look in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/15217), [Gargron](https://github.com/mastodon/mastodon/pull/15221), [Gargron](https://github.com/mastodon/mastodon/pull/15284), [Gargron](https://github.com/mastodon/mastodon/pull/15283), [Kjwon15](https://github.com/mastodon/mastodon/pull/15308), [noellabo](https://github.com/mastodon/mastodon/pull/15305), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15417)) - - Background of the overlay matches the color of the image - - Action bar to interact with or open the toot from the modal -- Change order of announcements in admin UI to be newest-first ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15091)) -- **Change account suspensions to be reversible by default** ([Gargron](https://github.com/mastodon/mastodon/pull/14726), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15152), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15106), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15100), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15099), [noellabo](https://github.com/mastodon/mastodon/pull/14855), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15380), [Gargron](https://github.com/mastodon/mastodon/pull/15420), [Gargron](https://github.com/mastodon/mastodon/pull/15414)) - - Suspensions no longer equal deletions - - A suspended account can be unsuspended with minimal consequences for 30 days - - Immediate deletion of data is still available as an explicit option - - Suspended accounts can request an archive of their data through the UI -- Change REST API to return empty data for suspended accounts (14765) -- Change web UI to show empty profile for suspended accounts ([Gargron](https://github.com/mastodon/mastodon/pull/14766), [Gargron](https://github.com/mastodon/mastodon/pull/15345)) -- Change featured hashtag suggestions to be recently used instead of most used ([abcang](https://github.com/mastodon/mastodon/pull/14760)) -- Change direct toots to appear in the home feed again ([Gargron](https://github.com/mastodon/mastodon/pull/14711), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15182), [noellabo](https://github.com/mastodon/mastodon/pull/14727)) - - Return to treating all toots the same instead of trying to retrofit direct visibility into an instant messaging model -- Change email address validation to return more specific errors ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14565)) -- Change HTTP signature requirements to include `Digest` header on `POST` requests ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15069)) -- Change click area of video/audio player buttons to be bigger in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/15049)) -- Change order of filters by alphabetic by "keyword or phrase" ([ariasuni](https://github.com/mastodon/mastodon/pull/15050)) -- Change suspension of remote accounts to also undo outgoing follows ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15188)) -- Change string "Home" to "Home and lists" in the filter creation screen ([ariasuni](https://github.com/mastodon/mastodon/pull/15139)) -- Change string "Boost to original audience" to "Boost with original visibility" in web UI ([3n-k1](https://github.com/mastodon/mastodon/pull/14598)) -- Change string "Show more" to "Show newer" and "Show older" on public pages ([ariasuni](https://github.com/mastodon/mastodon/pull/15052)) -- Change order of announcements to be reverse chronological in web UI ([dariusk](https://github.com/mastodon/mastodon/pull/15065), [dariusk](https://github.com/mastodon/mastodon/pull/15070)) -- Change RTL detection to rely on unicode-bidi paragraph by paragraph in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14573)) -- Change visibility icon next to timestamp to be clickable in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/15053), [mayaeh](https://github.com/mastodon/mastodon/pull/15055)) -- Change public thread view to hide "Show thread" link ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15266)) -- Change number format on about page from full to shortened ([Gargron](https://github.com/mastodon/mastodon/pull/15327)) -- Change how scheduled tasks run in multi-process environments ([noellabo](https://github.com/mastodon/mastodon/pull/15314)) - - New dedicated queue `scheduler` - - Runs by default when Sidekiq is executed with no options - - Has to be added manually in a multi-process environment - -### Removed - -- Remove fade-in animation from modals in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/15199)) -- Remove auto-redirect to direct messages in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/15142)) -- Remove obsolete IndexedDB operations from web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14730)) -- Remove dependency on unused and unmaintained http_parser.rb gem ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14574)) - -### Fixed - -- Fix layout on about page when contact account has a long username ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15357)) -- Fix follow limit preventing re-following of a moved account ([Gargron](https://github.com/mastodon/mastodon/pull/14207), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15384)) -- **Fix deletes not reaching every server that interacted with toot** ([Gargron](https://github.com/mastodon/mastodon/pull/15200)) - - Previously, delete of a toot would be primarily sent to the followers of its author, people mentioned in the toot, and people who reblogged the toot - - Now, additionally, it is ensured that it is sent to people who replied to it, favourited it, and to the person it replies to even if that person is not mentioned -- Fix resolving an account through its non-canonical form (i.e. alternate domain) ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15187)) -- Fix sending redundant ActivityPub events when processing remote account deletion ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15104)) -- Fix Move handler not being triggered when failing to fetch target account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15107)) -- Fix downloading remote media files when server returns empty filename ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14867)) -- Fix account processing failing because of large collections ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15027)) -- Fix not being able to unfavorite toots one has lost access to ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15192)) -- Fix not being able to unbookmark toots one has lost access to ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14604)) -- Fix possible casing inconsistencies in hashtag search ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14906)) -- Fix updating account counters when association is not yet created ([Gargron](https://github.com/mastodon/mastodon/pull/15108)) -- Fix cookies not having a SameSite attribute ([Gargron](https://github.com/mastodon/mastodon/pull/15098)) -- Fix poll ending notifications being created for each vote ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15071)) -- Fix multiple boosts of a same toot erroneously appearing in TL ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14759)) -- Fix asset builds not picking up `CDN_HOST` change ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14381)) -- Fix desktop notifications permission prompt in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14985), [Gargron](https://github.com/mastodon/mastodon/pull/15141), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13543), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15176)) - - Some time ago, browsers added a requirement that desktop notification prompts could only be displayed in response to a user-generated event (such as a click) - - This means that for some time, users who haven't already given the permission before were not getting a prompt and as such were not receiving desktop notifications -- Fix "Mark media as sensitive" string not supporting pluralizations in other languages in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/15051)) -- Fix glitched image uploads when canvas read access is blocked in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15180)) -- Fix some account gallery items having empty labels in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15073)) -- Fix alt-key hotkeys activating while typing in a text field in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14942)) -- Fix wrong seek bar width on media player in web UI ([mfmfuyu](https://github.com/mastodon/mastodon/pull/15060)) -- Fix logging out on mobile in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14901)) -- Fix wrong click area for GIFVs in media modal in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/14615)) -- Fix unreadable placeholder text color in high contrast theme in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14803)) -- Fix scrolling issues when closing some dropdown menus in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14606)) -- Fix notification filter bar incorrectly filtering gaps in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14808)) -- Fix disabled boost icon being replaced by private boost icon on hover in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14456)) -- Fix hashtag detection in compose form being different to server-side in web UI ([kedamaDQ](https://github.com/mastodon/mastodon/pull/14484), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14513)) -- Fix home last read marker mishandling gaps in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14809)) -- Fix unnecessary re-rendering of various components when typing in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/15286)) -- Fix notifications being unnecessarily re-rendered in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15312)) -- Fix column swiping animation logic in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15301)) -- Fix inefficiency when fetching hashtag timeline ([noellabo](https://github.com/mastodon/mastodon/pull/14861), [akihikodaki](https://github.com/mastodon/mastodon/pull/14662)) -- Fix inefficiency when fetching bookmarks ([akihikodaki](https://github.com/mastodon/mastodon/pull/14674)) -- Fix inefficiency when fetching favourites ([akihikodaki](https://github.com/mastodon/mastodon/pull/14673)) -- Fix inefficiency when fetching media-only account timeline ([akihikodaki](https://github.com/mastodon/mastodon/pull/14675)) -- Fix inefficiency when deleting accounts ([Gargron](https://github.com/mastodon/mastodon/pull/15387), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15409), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15407), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15408), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15402), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15416), [Gargron](https://github.com/mastodon/mastodon/pull/15421)) -- Fix redundant query when processing batch actions on custom emojis ([niwatori24](https://github.com/mastodon/mastodon/pull/14534)) -- Fix slow distinct queries where grouped queries are faster ([Gargron](https://github.com/mastodon/mastodon/pull/15287)) -- Fix performance on instances list in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/15282)) -- Fix server actor appearing in list of accounts in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14567)) -- Fix "bootstrap timeline accounts" toggle in site settings in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15325)) -- Fix PostgreSQL secret name for cronjob in Helm chart ([metal3d](https://github.com/mastodon/mastodon/pull/15072)) -- Fix Procfile not being compatible with herokuish ([acuteaura](https://github.com/mastodon/mastodon/pull/12685)) -- Fix installation of tini being split into multiple steps in Dockerfile ([ryncsn](https://github.com/mastodon/mastodon/pull/14686)) - -### Security - -- Fix streaming API allowing connections to persist after access token invalidation ([Gargron](https://github.com/mastodon/mastodon/pull/15111)) -- Fix 2FA/sign-in token sessions being valid after password change ([Gargron](https://github.com/mastodon/mastodon/pull/14802)) -- Fix resolving accounts sometimes creating duplicate records for a given ActivityPub identifier ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15364)) - -## [3.2.2] - 2020-12-19 - -### Added - -- Add `tootctl maintenance fix-duplicates` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14860), [Gargron](https://github.com/mastodon/mastodon/pull/15223)) - - Index corruption in the database? - - This command is for you - -### Removed - -- Remove dependency on unused and unmaintained http_parser.rb gem ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14574)) - -### Fixed - -- Fix Move handler not being triggered when failing to fetch target account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15107)) -- Fix downloading remote media files when server returns empty filename ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14867)) -- Fix possible casing inconsistencies in hashtag search ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14906)) -- Fix updating account counters when association is not yet created ([Gargron](https://github.com/mastodon/mastodon/pull/15108)) -- Fix account processing failing because of large collections ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15027)) -- Fix resolving an account through its non-canonical form (i.e. alternate domain) ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15187)) -- Fix slow distinct queries where grouped queries are faster ([Gargron](https://github.com/mastodon/mastodon/pull/15287)) - -### Security - -- Fix 2FA/sign-in token sessions being valid after password change ([Gargron](https://github.com/mastodon/mastodon/pull/14802)) -- Fix resolving accounts sometimes creating duplicate records for a given ActivityPub identifier ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15364)) - -## [3.2.1] - 2020-10-19 - -### Added - -- Add support for latest HTTP Signatures spec draft ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14556)) -- Add support for inlined objects in ActivityPub `to`/`cc` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14514)) - -### Changed - -- Change actors to not be served at all without authentication in limited federation mode ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14800)) - - Previously, a bare version of an actor was served when not authenticated, i.e. username and public key - - Because all actor fetch requests are signed using a separate system actor, that is no longer required - -### Fixed - -- Fix `tootctl media` commands not recognizing very large IDs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14536)) -- Fix crash when failing to load emoji picker in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14525)) -- Fix contrast requirements in thumbnail color extraction ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14464)) -- Fix audio/video player not using `CDN_HOST` on public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14486)) -- Fix private boost icon not being used on public pages ([OmmyZhang](https://github.com/mastodon/mastodon/pull/14471)) -- Fix audio player on Safari in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14485), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14465)) -- Fix dereferencing remote statuses not using the correct account for signature when receiving a targeted inbox delivery ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14656)) -- Fix nil error in `tootctl media remove` ([noellabo](https://github.com/mastodon/mastodon/pull/14657)) -- Fix videos with near-60 fps being rejected ([Gargron](https://github.com/mastodon/mastodon/pull/14684)) -- Fix reported statuses not being included in warning e-mail ([Gargron](https://github.com/mastodon/mastodon/pull/14778)) -- Fix `Reject` activities of `Follow` objects not correctly destroying a follow relationship ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14479)) -- Fix inefficiencies in fan-out-on-write service ([Gargron](https://github.com/mastodon/mastodon/pull/14682), [noellabo](https://github.com/mastodon/mastodon/pull/14709)) -- Fix timeout errors when trying to webfinger some IPv6 configurations ([Gargron](https://github.com/mastodon/mastodon/pull/14919)) -- Fix files served as `application/octet-stream` being rejected without attempting mime type detection ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14452)) - -## [3.2.0] - 2020-07-27 - -### Added - -- Add `SMTP_SSL` environment variable ([OmmyZhang](https://github.com/mastodon/mastodon/pull/14309)) -- Add hotkey for toggling content warning input in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13987)) -- **Add e-mail-based sign in challenge for users with disabled 2FA** ([Gargron](https://github.com/mastodon/mastodon/pull/14013)) - - If user tries signing in after: - - Being inactive for a while - - With a previously unknown IP - - Without 2FA being enabled - - Require to enter a token sent via e-mail before sigining in -- Add `limit` param to RSS feeds ([noellabo](https://github.com/mastodon/mastodon/pull/13743)) -- Add `visibility` param to share page ([noellabo](https://github.com/mastodon/mastodon/pull/13023)) -- Add blurhash to link previews ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13984), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14143), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13985), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14267), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14278), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14126), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14261), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14260)) - - In web UI, toots cannot be marked as sensitive unless there is media attached - - However, it's possible to do via API or ActivityPub - - Thumbnails of link previews of such posts now use blurhash in web UI - - The Card entity in REST API has a new `blurhash` attribute -- Add support for `summary` field for media description in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13763)) -- Add hints about incomplete remote content to web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14031), [noellabo](https://github.com/mastodon/mastodon/pull/14195)) -- **Add personal notes for accounts** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14148), [Gargron](https://github.com/mastodon/mastodon/pull/14208), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14251)) - - To clarify, these are notes only you can see, to help you remember details - - Notes can be viewed and edited from profiles in web UI - - New REST API: `POST /api/v1/accounts/:id/note` with `comment` param - - The Relationship entity in REST API has a new `note` attribute -- Add Helm chart ([dunn](https://github.com/mastodon/mastodon/pull/14090), [dunn](https://github.com/mastodon/mastodon/pull/14256), [dunn](https://github.com/mastodon/mastodon/pull/14245)) -- **Add customizable thumbnails for audio and video attachments** ([Gargron](https://github.com/mastodon/mastodon/pull/14145), [Gargron](https://github.com/mastodon/mastodon/pull/14244), [Gargron](https://github.com/mastodon/mastodon/pull/14273), [Gargron](https://github.com/mastodon/mastodon/pull/14203), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14255), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14306), [noellabo](https://github.com/mastodon/mastodon/pull/14358), [noellabo](https://github.com/mastodon/mastodon/pull/14357)) - - Metadata (album, artist, etc) is no longer stripped from audio files - - Album art is automatically extracted from audio files - - Thumbnail can be manually uploaded for both audio and video attachments - - Media upload APIs now support `thumbnail` param - - On `POST /api/v1/media` and `POST /api/v2/media` - - And on `PUT /api/v1/media/:id` - - ActivityPub representation of media attachments represents custom thumbnails with an `icon` attribute - - The Media Attachment entity in REST API now has a `preview_remote_url` to its `preview_url`, equivalent to `remote_url` to its `url` -- **Add color extraction for thumbnails** ([Gargron](https://github.com/mastodon/mastodon/pull/14209), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14264)) - - The `meta` attribute on the Media Attachment entity in REST API can now have a `colors` attribute which in turn contains three hex colors: `background`, `foreground`, and `accent` - - The background color is chosen from the most dominant color around the edges of the thumbnail - - The foreground and accent colors are chosen from the colors that are the most different from the background color using the CIEDE2000 algorithm - - The most saturated color of the two is designated as the accent color - - The one with the highest W3C contrast is designated as the foreground color - - If there are not enough colors in the thumbnail, new ones are generated using a monochrome pattern -- Add a visibility indicator to toots in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/14123), [highemerly](https://github.com/mastodon/mastodon/pull/14292)) -- Add `tootctl email_domain_blocks` ([tateisu](https://github.com/mastodon/mastodon/pull/13589), [Gargron](https://github.com/mastodon/mastodon/pull/14147)) -- Add "Add new domain block" to header of federation page in admin UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13934)) -- Add ability to keep emoji picker open with ctrl+click in web UI ([bclindner](https://github.com/mastodon/mastodon/pull/13896), [noellabo](https://github.com/mastodon/mastodon/pull/14096)) -- Add custom icon for private boosts in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14380)) -- Add support for Create and Update activities that don't inline objects in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14359)) -- Add support for Undo activities that don't inline activities in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14346)) - -### Changed - -- Change `.env.production.sample` to be leaner and cleaner ([Gargron](https://github.com/mastodon/mastodon/pull/14206)) - - It was overloaded as de-facto documentation and getting quite crowded - - Defer to the actual documentation while still giving a minimal example -- Change `tootctl search deploy` to work faster and display progress ([Gargron](https://github.com/mastodon/mastodon/pull/14300)) -- Change User-Agent of link preview fetching service to include "Bot" ([Gargron](https://github.com/mastodon/mastodon/pull/14248)) - - Some websites may not render OpenGraph tags into HTML if that's not the case -- Change behaviour to carry blocks over when someone migrates their followers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14144)) -- Change volume control and download buttons in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14122)) -- **Change design of audio players in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/14095), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14281), [Gargron](https://github.com/mastodon/mastodon/pull/14282), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14118), [Gargron](https://github.com/mastodon/mastodon/pull/14199), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14338)) -- Change reply filter to never filter own toots in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14128)) -- Change boost button to no longer serve as visibility indicator in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/14132), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14373)) -- Change contrast of flash messages ([cchoi12](https://github.com/mastodon/mastodon/pull/13892)) -- Change wording from "Hide media" to "Hide image/images" in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13834)) -- Change appearance of settings pages to be more consistent ([ariasuni](https://github.com/mastodon/mastodon/pull/13938)) -- Change "Add media" tooltip to not include long list of formats in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13954)) -- Change how badly contrasting emoji are rendered in web UI ([leo60228](https://github.com/mastodon/mastodon/pull/13773), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13772), [mfmfuyu](https://github.com/mastodon/mastodon/pull/14020), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14015)) -- Change structure of unavailable content section on about page ([ariasuni](https://github.com/mastodon/mastodon/pull/13930)) -- Change behaviour to accept ActivityPub activities relayed through group actor ([noellabo](https://github.com/mastodon/mastodon/pull/14279)) -- Change amount of processing retries for ActivityPub activities ([noellabo](https://github.com/mastodon/mastodon/pull/14355)) - -### Removed - -- Remove the terms "blacklist" and "whitelist" from UX ([Gargron](https://github.com/mastodon/mastodon/pull/14149), [mayaeh](https://github.com/mastodon/mastodon/pull/14192)) - - Environment variables changed (old versions continue to work): - - `WHITELIST_MODE` → `LIMITED_FEDERATION_MODE` - - `EMAIL_DOMAIN_BLACKLIST` → `EMAIL_DOMAIN_DENYLIST` - - `EMAIL_DOMAIN_WHITELIST` → `EMAIL_DOMAIN_ALLOWLIST` - - CLI option changed: - - `tootctl domains purge --whitelist-mode` → `tootctl domains purge --limited-federation-mode` -- Remove some unnecessary database indexes ([lfuelling](https://github.com/mastodon/mastodon/pull/13695), [noellabo](https://github.com/mastodon/mastodon/pull/14259)) -- Remove unnecessary Node.js version upper bound ([ykzts](https://github.com/mastodon/mastodon/pull/14139)) - -### Fixed - -- Fix `following` param not working when exact match is found in account search ([noellabo](https://github.com/mastodon/mastodon/pull/14394)) -- Fix sometimes occurring duplicate mention notifications ([noellabo](https://github.com/mastodon/mastodon/pull/14378)) -- Fix RSS feeds not being cacheable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14368)) -- Fix lack of locking around processing of Announce activities in ActivityPub ([noellabo](https://github.com/mastodon/mastodon/pull/14365)) -- Fix boosted toots from blocked account not being retroactively removed from TL ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14339)) -- Fix large shortened numbers (like 1.2K) using incorrect pluralization ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14061)) -- Fix streaming server trying to use empty password to connect to Redis when `REDIS_PASSWORD` is given but blank ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14135)) -- Fix being unable to unboost posts when blocked by their author ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14308)) -- Fix account domain block not properly unfollowing accounts from domain ([Gargron](https://github.com/mastodon/mastodon/pull/14304)) -- Fix removing a domain allow wiping known accounts in open federation mode ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14298)) -- Fix blocks and mutes pagination in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14275)) -- Fix new posts pushing down origin of opened dropdown in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14271), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14348)) -- Fix timeline markers not being saved sometimes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13887), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13889), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14155)) -- Fix CSV uploads being rejected ([noellabo](https://github.com/mastodon/mastodon/pull/13835)) -- Fix incompatibility with Elasticsearch 7.x ([noellabo](https://github.com/mastodon/mastodon/pull/13828)) -- Fix being able to search posts where you're in the target audience but not actively mentioned ([noellabo](https://github.com/mastodon/mastodon/pull/13829)) -- Fix non-local posts appearing on local-only hashtag timelines in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/13827)) -- Fix `tootctl media remove-orphans` choking on unknown files in storage ([Gargron](https://github.com/mastodon/mastodon/pull/13765)) -- Fix `tootctl upgrade storage-schema` misbehaving ([Gargron](https://github.com/mastodon/mastodon/pull/13761), [angristan](https://github.com/mastodon/mastodon/pull/13768)) - - Fix it marking records as upgraded even though no files were moved - - Fix it not working with S3 storage - - Fix it not working with custom emojis -- Fix GIF reader raising incorrect exceptions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13760)) -- Fix hashtag search performing account search as well ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13758)) -- Fix Webfinger returning wrong status code on malformed or missing param ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13759)) -- Fix `rake mastodon:setup` error when some environment variables are set ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13928)) -- Fix admin page crashing when trying to block an invalid domain name in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13884)) -- Fix unsent toot confirmation dialog not popping up in single column mode in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13888)) -- Fix performance of follow import ([noellabo](https://github.com/mastodon/mastodon/pull/13836)) - - Reduce timeout of Webfinger requests to that of other requests - - Use circuit breakers to stop hitting unresponsive servers - - Avoid hitting servers that are already known to be generally unavailable -- Fix filters ignoring media descriptions ([BenLubar](https://github.com/mastodon/mastodon/pull/13837)) -- Fix some actions on custom emojis leading to cryptic errors in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13951)) -- Fix ActivityPub serialization of replies when some of them are URIs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13957)) -- Fix `rake mastodon:setup` choking on environment variables containing `%` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13940)) -- Fix account redirect confirmation message talking about moved followers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13950)) -- Fix avatars having the wrong size on public detailed status pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14140)) -- Fix various issues around OpenGraph representation of media ([Gargron](https://github.com/mastodon/mastodon/pull/14133)) - - Pages containing audio no longer say "Attached: 1 image" in description - - Audio attachments now represented as OpenGraph `og:audio` - - The `twitter:player` page now uses Mastodon's proper audio/video player - - Audio/video buffered bars now display correctly in audio/video player - - Volume and progress bars now respond to movement/move smoother -- Fix audio/video/images/cards not reacting to window resizes in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14130)) -- Fix very wide media attachments resulting in too thin a thumbnail in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14127)) -- Fix crash when merging posts into home feed after following someone ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14129)) -- Fix unique username constraint for local users not being enforced in database ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14099)) -- Fix unnecessary gap under video modal in web UI ([mfmfuyu](https://github.com/mastodon/mastodon/pull/14098)) -- Fix 2FA and sign in token pages not respecting user locale ([mfmfuyu](https://github.com/mastodon/mastodon/pull/14087)) -- Fix unapproved users being able to view profiles when in limited-federation mode _and_ requiring approval for sign-ups ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14093)) -- Fix initial audio volume not corresponding to what's displayed in audio player in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14057)) -- Fix timelines sometimes jumping when closing modals in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14019)) -- Fix memory usage of downloading remote files ([Gargron](https://github.com/mastodon/mastodon/pull/14184), [Gargron](https://github.com/mastodon/mastodon/pull/14181), [noellabo](https://github.com/mastodon/mastodon/pull/14356)) - - Don't read entire file (up to 40 MB) into memory - - Read and write it to temp file in small chunks -- Fix inconsistent account header padding in web UI ([trwnh](https://github.com/mastodon/mastodon/pull/14179)) -- Fix Thai being skipped from language detection ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/13989)) - - Since Thai has its own alphabet, it can be detected more reliably -- Fix broken hashtag column options styling in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14247)) -- Fix pointer cursor being shown on toots that are not clickable in web UI ([arielrodrigues](https://github.com/mastodon/mastodon/pull/14185)) -- Fix lock icon not being shown when locking account in profile settings ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14190)) -- Fix domain blocks doing work the wrong way around ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13424)) - - Instead of suspending accounts one by one, mark all as suspended first (quick) - - Only then proceed to start removing their data (slow) - - Clear out media attachments in a separate worker (slow) - -## [3.1.5] - 2020-07-07 - -### Security - -- Fix media attachment enumeration ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14254)) -- Change rate limits for various paths ([Gargron](https://github.com/mastodon/mastodon/pull/14253)) -- Fix other sessions not being logged out on password change ([Gargron](https://github.com/mastodon/mastodon/pull/14252)) - -## [3.1.4] - 2020-05-14 - -### Added - -- Add `vi` to available locales ([taicv](https://github.com/mastodon/mastodon/pull/13542)) -- Add ability to remove identity proofs from account ([Gargron](https://github.com/mastodon/mastodon/pull/13682)) -- Add ability to exclude local content from federated timeline ([noellabo](https://github.com/mastodon/mastodon/pull/13504), [noellabo](https://github.com/mastodon/mastodon/pull/13745)) - - Add `remote` param to `GET /api/v1/timelines/public` REST API - - Add `public/remote` / `public:remote` variants to streaming API - - "Remote only" option in federated timeline column settings in web UI -- Add ability to exclude remote content from hashtag timelines in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/13502)) - - No changes to REST API - - "Local only" option in hashtag column settings in web UI -- Add Capistrano tasks that reload the services after deploying ([berkes](https://github.com/mastodon/mastodon/pull/12642)) -- Add `invites_enabled` attribute to `GET /api/v1/instance` in REST API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13501)) -- Add `tootctl emoji export` command ([lfuelling](https://github.com/mastodon/mastodon/pull/13534)) -- Add separate cache directory for non-local uploads ([Gargron](https://github.com/mastodon/mastodon/pull/12821), [Hanage999](https://github.com/mastodon/mastodon/pull/13593), [mayaeh](https://github.com/mastodon/mastodon/pull/13551)) - - Add `tootctl upgrade storage-schema` command to move old non-local uploads to the cache directory -- Add buttons to delete header and avatar from profile settings ([sternenseemann](https://github.com/mastodon/mastodon/pull/13234)) -- Add emoji graphics and shortcodes from Twemoji 12.1.5 ([DeeUnderscore](https://github.com/mastodon/mastodon/pull/13021)) - -### Changed - -- Change error message when trying to migrate to an account that does not have current account set as an alias to be more clear ([TheEvilSkeleton](https://github.com/mastodon/mastodon/pull/13746)) -- Change delivery failure tracking to work with hostnames instead of URLs ([Gargron](https://github.com/mastodon/mastodon/pull/13437), [noellabo](https://github.com/mastodon/mastodon/pull/13481), [noellabo](https://github.com/mastodon/mastodon/pull/13482), [noellabo](https://github.com/mastodon/mastodon/pull/13535)) -- Change Content-Security-Policy to not need unsafe-inline style-src ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13679), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13692), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13576), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13575), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13438)) -- Change how RSS items are titled and formatted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13592), [ykzts](https://github.com/mastodon/mastodon/pull/13591)) - -### Fixed - -- Fix dropdown of muted and followed accounts offering option to hide boosts in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13748)) -- Fix "You are already signed in" alert being shown at wrong times ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13547)) -- Fix retrying of failed-to-download media files not actually working ([noellabo](https://github.com/mastodon/mastodon/pull/13741)) -- Fix first poll option not being focused when adding a poll in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13740)) -- Fix `sr` locale being selected over `sr-Latn` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13693)) -- Fix error within error when limiting backtrace to 3 lines ([Gargron](https://github.com/mastodon/mastodon/pull/13120)) -- Fix `tootctl media remove-orphans` crashing on "Import" files ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13685)) -- Fix regression in `tootctl media remove-orphans` ([Gargron](https://github.com/mastodon/mastodon/pull/13405)) -- Fix old unique jobs digests not having been cleaned up ([Gargron](https://github.com/mastodon/mastodon/pull/13683)) -- Fix own following/followers not showing muted users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13614)) -- Fix list of followed people ignoring sorting on Follows & Followers page ([taras2358](https://github.com/mastodon/mastodon/pull/13676)) -- Fix wrong pgHero Content-Security-Policy when `CDN_HOST` is set ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13595)) -- Fix needlessly deduplicating usernames on collisions with remote accounts when signing-up through SAML/CAS ([kaiyou](https://github.com/mastodon/mastodon/pull/13581)) -- Fix page incorrectly scrolling when bringing up dropdown menus in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13574)) -- Fix messed up z-index when NoScript blocks media/previews in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13449)) -- Fix "See what's happening" page showing public instead of local timeline for logged-in users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13499)) -- Fix not being able to resolve public resources in development environment ([Gargron](https://github.com/mastodon/mastodon/pull/13505)) -- Fix uninformative error message when uploading unsupported image files ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13540)) -- Fix expanded video player issues in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13541), [eai04191](https://github.com/mastodon/mastodon/pull/13533)) -- Fix and refactor keyboard navigation in dropdown menus in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13528)) -- Fix uploaded image orientation being messed up in some browsers in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13493)) -- Fix actions log crash when displaying updates of deleted announcements in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13489)) -- Fix search not working due to proxy settings when using hidden services ([Gargron](https://github.com/mastodon/mastodon/pull/13488)) -- Fix poll refresh button not being debounced in web UI ([rasjonell](https://github.com/mastodon/mastodon/pull/13485), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13490)) -- Fix confusing error when failing to add an alias to an unknown account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13480)) -- Fix "Email changed" notification sometimes having wrong e-mail ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13475)) -- Fix various issues on the account aliases page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13452)) -- Fix API footer link in web UI ([bubblineyuri](https://github.com/mastodon/mastodon/pull/13441)) -- Fix pagination of following, followers, follow requests, blocks and mutes lists in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13445)) -- Fix styling of polls in JS-less fallback on public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13436)) -- Fix trying to delete already deleted file when post-processing ([Gargron](https://github.com/mastodon/mastodon/pull/13406)) - -### Security - -- Fix Doorkeeper vulnerability that exposed app secret to users who authorized the app and reset secret of the web UI that could have been exposed ([dependabot-preview[bot]](https://github.com/mastodon/mastodon/pull/13613), [Gargron](https://github.com/mastodon/mastodon/pull/13688)) - - For apps that self-register on behalf of every individual user (such as most mobile apps), this is a non-issue - - The issue only affects developers of apps who are shared between multiple users, such as server-side apps like cross-posters - -## [3.1.3] - 2020-04-05 - -### Added - -- Add ability to filter audit log in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/13381)) -- Add titles to warning presets in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/13252)) -- Add option to include resolved DNS records when blacklisting e-mail domains in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/13254)) -- Add ability to delete files uploaded for settings in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13192)) -- Add sorting by username, creation and last activity in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13076)) -- Add explanation as to why unlocked accounts may have follow requests in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13385)) -- Add link to bookmarks to dropdown in web UI ([mayaeh](https://github.com/mastodon/mastodon/pull/13273)) -- Add support for links to statuses in announcements to be opened in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13212), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13250)) -- Add tooltips to audio/video player buttons in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13203)) -- Add submit button to the top of preferences pages ([guigeekz](https://github.com/mastodon/mastodon/pull/13068)) -- Add specific rate limits for posting, following and reporting ([Gargron](https://github.com/mastodon/mastodon/pull/13172), [Gargron](https://github.com/mastodon/mastodon/pull/13390)) - - 300 posts every 3 hours - - 400 follows or follow requests every 24 hours - - 400 reports every 24 hours -- Add federation support for the "hide network" preference ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11673)) -- Add `--skip-media-remove` option to `tootctl statuses remove` ([tateisu](https://github.com/mastodon/mastodon/pull/13080)) - -### Changed - -- **Change design of polls in web UI** ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/13257), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13313)) -- Change status click areas in web UI to be bigger ([ariasuni](https://github.com/mastodon/mastodon/pull/13327)) -- **Change `tootctl media remove-orphans` to work for all classes** ([Gargron](https://github.com/mastodon/mastodon/pull/13316)) -- **Change local media attachments to perform heavy processing asynchronously** ([Gargron](https://github.com/mastodon/mastodon/pull/13210)) -- Change video uploads to always be converted to H264/MP4 ([Gargron](https://github.com/mastodon/mastodon/pull/13220), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13239), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13242)) -- Change video uploads to enforce certain limits ([Gargron](https://github.com/mastodon/mastodon/pull/13218)) - - Dimensions smaller than 1920x1200px - - Frame rate at most 60fps -- Change the tooltip "Toggle visibility" to "Hide media" in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13199)) -- Change description of privacy levels to be more intuitive in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13197)) -- Change GIF label to be displayed even when autoplay is enabled in web UI ([koyuawsmbrtn](https://github.com/mastodon/mastodon/pull/13209)) -- Change the string "Hide everything from …" to "Block domain …" in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13178), [mayaeh](https://github.com/mastodon/mastodon/pull/13221)) -- Change wording of media display preferences to be more intuitive ([ariasuni](https://github.com/mastodon/mastodon/pull/13198)) - -### Deprecated - -- `POST /api/v1/media` → `POST /api/v2/media` ([Gargron](https://github.com/mastodon/mastodon/pull/13210)) - -### Fixed - -- Fix `tootctl media remove-orphans` ignoring `PAPERCLIP_ROOT_PATH` ([Gargron](https://github.com/mastodon/mastodon/pull/13375)) -- Fix returning results when searching for URL with non-zero offset ([Gargron](https://github.com/mastodon/mastodon/pull/13377)) -- Fix pinning a column in web UI sometimes redirecting out of web UI ([Gargron](https://github.com/mastodon/mastodon/pull/13376)) -- Fix background jobs not using locks like they are supposed to ([Gargron](https://github.com/mastodon/mastodon/pull/13361)) -- Fix content warning being unnecessarily cleared when hiding content warning input in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13348)) -- Fix "Show more" not switching to "Show less" on public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13174)) -- Fix import overwrite option not being selectable ([noellabo](https://github.com/mastodon/mastodon/pull/13347)) -- Fix wrong color for ellipsis in boost confirmation dialog in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13355)) -- Fix unnecessary unfollowing when importing follows with overwrite option ([noellabo](https://github.com/mastodon/mastodon/pull/13350)) -- Fix 404 and 410 API errors being silently discarded in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13279)) -- Fix OCR not working on Safari because of unsupported worker-src CSP ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13323)) -- Fix media not being marked sensitive when a content warning is set with no text ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13277)) -- Fix crash after deleting announcements in web UI ([codesections](https://github.com/mastodon/mastodon/pull/13283), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13312)) -- Fix bookmarks not being searchable ([Kjwon15](https://github.com/mastodon/mastodon/pull/13271), [noellabo](https://github.com/mastodon/mastodon/pull/13293)) -- Fix reported accounts not being whitelisted from further spam checks when resolving a spam check report ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13289)) -- Fix web UI crash in single-column mode on prehistoric browsers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13267)) -- Fix some timeouts when searching for URLs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13253)) -- Fix detailed view of direct messages displaying a 0 boost count in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13244)) -- Fix regression in “Edit media” modal in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13243)) -- Fix public posts from silenced accounts not being changed to unlisted visibility ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13096)) -- Fix error when searching for URLs that contain the mention syntax ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13151)) -- Fix text area above/right of emoji picker being accidentally clickable in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13148)) -- Fix too large announcements not being scrollable in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13211)) -- Fix `tootctl media remove-orphans` crashing when encountering invalid media ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13170)) -- Fix installation failing when Redis password contains special characters ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13156)) -- Fix announcements with fully-qualified mentions to local users crashing web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13164)) - -### Security - -- Fix re-sending of e-mail confirmation not being rate limited ([Gargron](https://github.com/mastodon/mastodon/pull/13360)) - -## [v3.1.2] - 2020-02-27 - -### Added - -- Add `--reset-password` option to `tootctl accounts modify` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13126)) -- Add source-mapped stacktrace to error message in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13082)) - -### Fixed - -- Fix dismissing an announcement twice raising an obscure error ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13124)) -- Fix misleading error when attempting to re-send a pending follow request ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13133)) -- Fix backups failing when files are missing from media attachments ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13146)) -- Fix duplicate accounts being created when fetching an account for its key only ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13147)) -- Fix `/web` redirecting to `/web/web` in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13128)) -- Fix previously OStatus-based accounts not being detected as ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13129)) -- Fix account JSON/RSS not being cacheable due to wrong mime type comparison ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13116)) -- Fix old browsers crashing because of missing `finally` polyfill in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13115)) -- Fix account's bio not being shown if there are no proofs/fields in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13075)) -- Fix sign-ups without checked user agreement being accepted through the web form ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13088)) -- Fix non-x64 architectures not being able to build Docker image because of hardcoded Node.js architecture ([SaraSmiseth](https://github.com/mastodon/mastodon/pull/13081)) -- Fix invite request input not being shown on sign-up error if left empty ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13089)) -- Fix some migration hints mentioning GitLab instead of Mastodon ([saper](https://github.com/mastodon/mastodon/pull/13084)) - -### Security - -- Fix leak of arbitrary statuses through unfavourite action in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/13161)) - -## [3.1.1] - 2020-02-10 - -### Fixed - -- Fix yanked dependency preventing installation ([mayaeh](https://github.com/mastodon/mastodon/pull/13059)) - -## [3.1.0] - 2020-02-09 - -### Added - -- Add bookmarks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/7107), [Gargron](https://github.com/mastodon/mastodon/pull/12494), [Gomasy](https://github.com/mastodon/mastodon/pull/12381)) -- Add announcements ([Gargron](https://github.com/mastodon/mastodon/pull/12662), [Gargron](https://github.com/mastodon/mastodon/pull/12967), [Gargron](https://github.com/mastodon/mastodon/pull/12970), [Gargron](https://github.com/mastodon/mastodon/pull/12963), [Gargron](https://github.com/mastodon/mastodon/pull/12950), [Gargron](https://github.com/mastodon/mastodon/pull/12990), [Gargron](https://github.com/mastodon/mastodon/pull/12949), [Gargron](https://github.com/mastodon/mastodon/pull/12989), [Gargron](https://github.com/mastodon/mastodon/pull/12964), [Gargron](https://github.com/mastodon/mastodon/pull/12965), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12958), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12957), [Gargron](https://github.com/mastodon/mastodon/pull/12955), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12946), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12954)) -- Add number animations in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12948), [Gargron](https://github.com/mastodon/mastodon/pull/12971)) -- Add `kab`, `is`, `kn`, `mr`, `ur` to available locales ([Gargron](https://github.com/mastodon/mastodon/pull/12882), [BoFFire](https://github.com/mastodon/mastodon/pull/12962), [Gargron](https://github.com/mastodon/mastodon/pull/12379)) -- Add profile filter category ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12918)) -- Add ability to add oneself to lists ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12271)) -- Add hint how to contribute translations to preferences page ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12736)) -- Add signatures to statuses in archive takeout ([noellabo](https://github.com/mastodon/mastodon/pull/12649)) -- Add support for `magnet:` and `xmpp` links ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12905), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12709)) -- Add `follow_request` notification type ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12198)) -- Add ability to filter reports by account domain in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12154)) -- Add link to search for users connected from the same IP address to admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12157)) -- Add link to reports targeting a specific domain in admin view ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12513)) -- Add support for EventSource streaming in web UI ([BenLubar](https://github.com/mastodon/mastodon/pull/12887)) -- Add hotkey for opening media attachments in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12498), [Kjwon15](https://github.com/mastodon/mastodon/pull/12546)) -- Add relationship-based options to status dropdowns in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12377), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12535), [Gargron](https://github.com/mastodon/mastodon/pull/12430)) -- Add support for submitting media description with `ctrl`+`enter` in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12272)) -- Add download button to audio and video players in web UI ([NimaBoscarino](https://github.com/mastodon/mastodon/pull/12179)) -- Add setting for whether to crop images in timelines in web UI ([duxovni](https://github.com/mastodon/mastodon/pull/12126)) -- Add support for `Event` activities ([tcitworld](https://github.com/mastodon/mastodon/pull/12637)) -- Add basic support for `Group` actors ([noellabo](https://github.com/mastodon/mastodon/pull/12071)) -- Add `S3_OVERRIDE_PATH_STYLE` environment variable ([Gargron](https://github.com/mastodon/mastodon/pull/12594)) -- Add `S3_OPEN_TIMEOUT` environment variable ([tateisu](https://github.com/mastodon/mastodon/pull/12459)) -- Add `LDAP_MAIL` environment variable ([madmath03](https://github.com/mastodon/mastodon/pull/12053)) -- Add `LDAP_UID_CONVERSION_ENABLED` environment variable ([madmath03](https://github.com/mastodon/mastodon/pull/12461)) -- Add `--remote-only` option to `tootctl emoji purge` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12810)) -- Add `tootctl media remove-orphans` ([Gargron](https://github.com/mastodon/mastodon/pull/12568), [Gargron](https://github.com/mastodon/mastodon/pull/12571)) -- Add `tootctl media lookup` command ([irlcatgirl](https://github.com/mastodon/mastodon/pull/12283)) -- Add cache for OEmbed endpoints to avoid extra HTTP requests ([Gargron](https://github.com/mastodon/mastodon/pull/12403)) -- Add support for KaiOS arrow navigation to public pages ([nolanlawson](https://github.com/mastodon/mastodon/pull/12251)) -- Add `discoverable` to accounts in REST API ([trwnh](https://github.com/mastodon/mastodon/pull/12508)) -- Add admin setting to disable default follows ([ArisuOngaku](https://github.com/mastodon/mastodon/pull/12566)) -- Add support for LDAP and PAM in the OAuth password grant strategy ([ntl-purism](https://github.com/mastodon/mastodon/pull/12390), [Gargron](https://github.com/mastodon/mastodon/pull/12743)) -- Allow support for `Accept`/`Reject` activities with a non-embedded object ([puckipedia](https://github.com/mastodon/mastodon/pull/12199)) -- Add "Show thread" button to public profiles ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/13000)) - -### Changed - -- Change `last_status_at` to be a date, not datetime in REST API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12966)) -- Change followers page to relationships page in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/12927), [Gargron](https://github.com/mastodon/mastodon/pull/12934)) -- Change reported media attachments to always be hidden in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/12879), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12907)) -- Change string from "Disable" to "Disable login" in admin UI ([nileshkumar](https://github.com/mastodon/mastodon/pull/12201)) -- Change report page structure in admin UI ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12615)) -- Change swipe sensitivity to be lower on small screens in web UI ([umonaca](https://github.com/mastodon/mastodon/pull/12168)) -- Change audio/video playback to stop playback when out of view in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12486)) -- Change media description label based on upload type in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12270)) -- Change large numbers to render without decimal units in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/12706)) -- Change "Add a choice" button to be disabled rather than hidden when poll limit reached in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12319), [hinaloe](https://github.com/mastodon/mastodon/pull/12544)) -- Change `tootctl statuses remove` to keep statuses favourited or bookmarked by local users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11267), [Gomasy](https://github.com/mastodon/mastodon/pull/12818)) -- Change domain block behavior to update user records (fast) before deleting data (slower) ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12247)) -- Change behaviour to strip audio metadata on uploads ([hugogameiro](https://github.com/mastodon/mastodon/pull/12171)) -- Change accepted length of remote media descriptions from 420 to 1,500 characters ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12262)) -- Change preferences pages structure ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12497), [mayaeh](https://github.com/mastodon/mastodon/pull/12517), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12801), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12797), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12799), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12793)) -- Change format of titles in RSS ([devkral](https://github.com/mastodon/mastodon/pull/8596)) -- Change favourite icon animation from spring-based motion to CSS animation in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12175)) -- Change minimum required Node.js version to 10, and default to 12 ([Shleeble](https://github.com/mastodon/mastodon/pull/12791), [mkody](https://github.com/mastodon/mastodon/pull/12906), [Shleeble](https://github.com/mastodon/mastodon/pull/12703)) -- Change spam check to exempt server staff ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12874)) -- Change to fallback to to `Create` audience when `object` has no defined audience ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12249)) -- Change Twemoji library to 12.1.3 in web UI ([koyuawsmbrtn](https://github.com/mastodon/mastodon/pull/12342)) -- Change blocked users to be hidden from following/followers lists ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12733)) -- Change signature verification to ignore signatures with invalid host ([Gargron](https://github.com/mastodon/mastodon/pull/13033)) - -### Removed - -- Remove unused dependencies ([ykzts](https://github.com/mastodon/mastodon/pull/12861), [mayaeh](https://github.com/mastodon/mastodon/pull/12826), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12822), [ykzts](https://github.com/mastodon/mastodon/pull/12533)) - -### Fixed - -- Fix some translatable strings being used wrongly ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12569), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12589), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12502), [mayaeh](https://github.com/mastodon/mastodon/pull/12231)) -- Fix headline of public timeline page when set to local-only ([ykzts](https://github.com/mastodon/mastodon/pull/12224)) -- Fix space between tabs not being spread evenly in web UI ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12944), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12961), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12446)) -- Fix interactive delays in database migrations with no TTY ([Gargron](https://github.com/mastodon/mastodon/pull/12969)) -- Fix status overflowing in report dialog in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12959)) -- Fix unlocalized dropdown button title in web UI ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/12947)) -- Fix media attachments without file being uploadable ([Gargron](https://github.com/mastodon/mastodon/pull/12562)) -- Fix unfollow confirmations in profile directory in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12922)) -- Fix duplicate `description` meta tag on accounts public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12923)) -- Fix slow query of federated timeline ([notozeki](https://github.com/mastodon/mastodon/pull/12886)) -- Fix not all of account's active IPs showing up in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/12909), [Gargron](https://github.com/mastodon/mastodon/pull/12943)) -- Fix search by IP not using alternative browser sessions in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/12904)) -- Fix “X new items” not showing up for slow mode on empty timelines in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12875)) -- Fix OEmbed endpoint being inaccessible in secure mode ([Gargron](https://github.com/mastodon/mastodon/pull/12864)) -- Fix proofs API being inaccessible in secure mode ([Gargron](https://github.com/mastodon/mastodon/pull/12495)) -- Fix Ruby 2.7 incompatibilities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12831), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12824), [Shleeble](https://github.com/mastodon/mastodon/pull/12759), [zunda](https://github.com/mastodon/mastodon/pull/12769)) -- Fix invalid poll votes being accepted in REST API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12601)) -- Fix old migrations failing because of strong migrations update ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12787), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12692)) -- Fix reuse of detailed status components in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12792)) -- Fix base64-encoded file uploads not being possible in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/12748), [Gargron](https://github.com/mastodon/mastodon/pull/12857)) -- Fix error due to missing authentication call in filters controller ([Gargron](https://github.com/mastodon/mastodon/pull/12746)) -- Fix uncaught unknown format error in host meta controller ([Gargron](https://github.com/mastodon/mastodon/pull/12747)) -- Fix URL search not returning private toots user has access to ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12742), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/12336)) -- Fix cache digesting log noise on status embeds ([Gargron](https://github.com/mastodon/mastodon/pull/12750)) -- Fix slowness due to layout thrashing when reloading a large set of statuses in web UI ([panarom](https://github.com/mastodon/mastodon/pull/12661), [panarom](https://github.com/mastodon/mastodon/pull/12744), [Gargron](https://github.com/mastodon/mastodon/pull/12712)) -- Fix error when fetching followers/following from REST API when user has network hidden ([Gargron](https://github.com/mastodon/mastodon/pull/12716)) -- Fix IDN mentions not being processed, IDN domains not being rendered ([Gargron](https://github.com/mastodon/mastodon/pull/12715), [Gargron](https://github.com/mastodon/mastodon/pull/13035), [Gargron](https://github.com/mastodon/mastodon/pull/13030)) -- Fix error when searching for empty phrase ([Gargron](https://github.com/mastodon/mastodon/pull/12711)) -- Fix backups stopping due to read timeouts ([chr-1x](https://github.com/mastodon/mastodon/pull/12281)) -- Fix batch actions on non-pending tags in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12537)) -- Fix sample `SAML_ACS_URL`, `SAML_ISSUER` ([orlea](https://github.com/mastodon/mastodon/pull/12669)) -- Fix manual scrolling issue on Firefox/Windows in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12648)) -- Fix archive takeout failing if total dump size exceeds 2GB ([scd31](https://github.com/mastodon/mastodon/pull/12602), [Gargron](https://github.com/mastodon/mastodon/pull/12653)) -- Fix custom emoji category creation silently erroring out on duplicate category ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12647)) -- Fix link crawler not specifying preferred content type ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12646)) -- Fix featured hashtag setting page erroring out instead of rejecting invalid tags ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12436)) -- Fix tooltip messages of single/multiple-choice polls switcher being reversed in web UI ([acid-chicken](https://github.com/mastodon/mastodon/pull/12616)) -- Fix typo in help text of `tootctl statuses remove` ([trwnh](https://github.com/mastodon/mastodon/pull/12603)) -- Fix generic HTTP 500 error on duplicate records ([Gargron](https://github.com/mastodon/mastodon/pull/12563)) -- Fix old migration failing with new status default scope ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12493)) -- Fix errors when using search API with no query ([Gargron](https://github.com/mastodon/mastodon/pull/12541), [trwnh](https://github.com/mastodon/mastodon/pull/12549)) -- Fix poll options not being selectable via keyboard in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12538)) -- Fix conversations not having an unread indicator in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12506)) -- Fix lost focus when modals open/close in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12437)) -- Fix pending upload count not being decremented on error in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12499)) -- Fix empty poll options not being removed on remote poll update ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12484)) -- Fix OCR with delete & redraft in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12465)) -- Fix blur behind closed registration message ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12442)) -- Fix OEmbed discovery not handling different URL variants in query ([Gargron](https://github.com/mastodon/mastodon/pull/12439)) -- Fix link crawler crashing on `` tags without `href` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12159)) -- Fix whitelisted subdomains being ignored in whitelist mode ([noiob](https://github.com/mastodon/mastodon/pull/12435)) -- Fix broken audit log in whitelist mode in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12303)) -- Fix unread indicator not honoring "Only media" option in local and federated timelines in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12330)) -- Fix error when rebuilding home feeds ([dariusk](https://github.com/mastodon/mastodon/pull/12324)) -- Fix relationship caches being broken as result of a follow request ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12299)) -- Fix more items than the limit being uploadable in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12300)) -- Fix various issues with account migration ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12301)) -- Fix filtered out items being counted as pending items in slow mode in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12266)) -- Fix notification filters not applying to poll options ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12269)) -- Fix notification message for user's own poll saying it's a poll they voted on in web UI ([ykzts](https://github.com/mastodon/mastodon/pull/12219)) -- Fix polls with an expiration not showing up as expired in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/12222)) -- Fix volume slider having an offset between cursor and slider in Chromium in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12158)) -- Fix Vagrant image not accepting connections ([shrft](https://github.com/mastodon/mastodon/pull/12180)) -- Fix batch actions being hidden on small screens in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12183)) -- Fix incoming federation not working in whitelist mode ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12185)) -- Fix error when passing empty `source` param to `PUT /api/v1/accounts/update_credentials` ([jglauche](https://github.com/mastodon/mastodon/pull/12259)) -- Fix HTTP-based streaming API being cacheable by proxies ([BenLubar](https://github.com/mastodon/mastodon/pull/12945)) -- Fix users being able to register while `tootctl self-destruct` is in progress ([Kjwon15](https://github.com/mastodon/mastodon/pull/12877)) -- Fix microformats detection in link crawler not ignoring `h-card` links ([nightpool](https://github.com/mastodon/mastodon/pull/12189)) -- Fix outline on full-screen video in web UI ([hinaloe](https://github.com/mastodon/mastodon/pull/12176)) -- Fix TLD domain blocks not being editable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12805)) -- Fix Nanobox deploy hooks ([danhunsaker](https://github.com/mastodon/mastodon/pull/12663)) -- Fix needlessly complicated SQL query when performing account search amongst followings ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12302)) -- Fix favourites count not updating when unfavouriting in web UI ([NimaBoscarino](https://github.com/mastodon/mastodon/pull/12140)) -- Fix occasional crash on scroll in Chromium in web UI ([hinaloe](https://github.com/mastodon/mastodon/pull/12274)) -- Fix intersection observer not working in single-column mode web UI ([panarom](https://github.com/mastodon/mastodon/pull/12735)) -- Fix voting issue with remote polls that contain trailing spaces ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12515)) -- Fix dynamic elements not working in pgHero due to CSP rules ([ykzts](https://github.com/mastodon/mastodon/pull/12489)) -- Fix overly verbose backtraces when delivering ActivityPub payloads ([zunda](https://github.com/mastodon/mastodon/pull/12798)) -- Fix rendering `` without `href` when scheme unsupported ([Gargron](https://github.com/mastodon/mastodon/pull/13040)) -- Fix unfiltered params error when generating ActivityPub tag pagination ([Gargron](https://github.com/mastodon/mastodon/pull/13049)) -- Fix malformed HTML causing uncaught error ([Gargron](https://github.com/mastodon/mastodon/pull/13042)) -- Fix native share button not being displayed for unlisted toots ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13045)) -- Fix remote convertible media attachments (e.g. GIFs) not being saved ([Gargron](https://github.com/mastodon/mastodon/pull/13032)) -- Fix account query not using faster index ([abcang](https://github.com/mastodon/mastodon/pull/13016)) -- Fix error when sending moderation notification ([renatolond](https://github.com/mastodon/mastodon/pull/13014)) - -### Security - -- Fix OEmbed leaking information about existence of non-public statuses ([Gargron](https://github.com/mastodon/mastodon/pull/12930)) -- Fix password change/reset not immediately invalidating other sessions ([Gargron](https://github.com/mastodon/mastodon/pull/12928)) -- Fix settings pages being cacheable by the browser ([Gargron](https://github.com/mastodon/mastodon/pull/12714)) - -## [3.0.1] - 2019-10-10 - -### Added - -- Add `tootctl media usage` command ([Gargron](https://github.com/mastodon/mastodon/pull/12115)) -- Add admin setting to auto-approve trending hashtags ([Gargron](https://github.com/mastodon/mastodon/pull/12122), [Gargron](https://github.com/mastodon/mastodon/pull/12130)) - -### Changed - -- Change `tootctl media refresh` to skip already downloaded attachments ([Gargron](https://github.com/mastodon/mastodon/pull/12118)) - -### Removed - -- Remove auto-silence behaviour from spam check ([Gargron](https://github.com/mastodon/mastodon/pull/12117)) -- Remove HTML `lang` attribute from individual statuses in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12124)) -- Remove fallback to long description on sidebar and meta description ([Gargron](https://github.com/mastodon/mastodon/pull/12119)) - -### Fixed - -- Fix preloaded JSON-LD context for identity not being used ([Gargron](https://github.com/mastodon/mastodon/pull/12138)) -- Fix media editing modal changing dimensions once the image loads ([Gargron](https://github.com/mastodon/mastodon/pull/12131)) -- Fix not showing whether a custom emoji has a local counterpart in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/12135)) -- Fix attachment not being re-downloaded even if file is not stored ([Gargron](https://github.com/mastodon/mastodon/pull/12125)) -- Fix old migration trying to use new column due to default status scope ([Gargron](https://github.com/mastodon/mastodon/pull/12095)) -- Fix column back button missing for not found accounts ([trwnh](https://github.com/mastodon/mastodon/pull/12094)) -- Fix issues with tootctl's parallelization and progress reporting ([Gargron](https://github.com/mastodon/mastodon/pull/12093), [Gargron](https://github.com/mastodon/mastodon/pull/12097)) -- Fix existing user records with now-renamed `pt` locale ([Gargron](https://github.com/mastodon/mastodon/pull/12092)) -- Fix hashtag timeline REST API accepting too many hashtags ([Gargron](https://github.com/mastodon/mastodon/pull/12091)) -- Fix `GET /api/v1/instance` REST APIs being unavailable in secure mode ([Gargron](https://github.com/mastodon/mastodon/pull/12089)) -- Fix performance of home feed regeneration and merging ([Gargron](https://github.com/mastodon/mastodon/pull/12084)) -- Fix ffmpeg performance issues due to stdout buffer overflow ([hugogameiro](https://github.com/mastodon/mastodon/pull/12088)) -- Fix S3 adapter retrying failing uploads with exponential backoff ([Gargron](https://github.com/mastodon/mastodon/pull/12085)) -- Fix `tootctl accounts cull` advertising unused option flag ([Kjwon15](https://github.com/mastodon/mastodon/pull/12074)) - -## [3.0.0] - 2019-10-03 - -### Added - -- Add "not available" label to unloaded media attachments in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11715), [Gargron](https://github.com/mastodon/mastodon/pull/11745)) -- **Add profile directory to web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11688), [mayaeh](https://github.com/mastodon/mastodon/pull/11872)) - - Add profile directory opt-in federation - - Add profile directory REST API -- Add special alert for throttled requests in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11677)) -- Add confirmation modal when logging out from the web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11671)) -- **Add audio player in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11644), [Gargron](https://github.com/mastodon/mastodon/pull/11652), [Gargron](https://github.com/mastodon/mastodon/pull/11654), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11629), [Gargron](https://github.com/mastodon/mastodon/pull/12056)) -- **Add autosuggestions for hashtags in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11422), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11632), [Gargron](https://github.com/mastodon/mastodon/pull/11764), [Gargron](https://github.com/mastodon/mastodon/pull/11588), [Gargron](https://github.com/mastodon/mastodon/pull/11442)) -- **Add media editing modal with OCR tool in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11563), [Gargron](https://github.com/mastodon/mastodon/pull/11566), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11575), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11576), [Gargron](https://github.com/mastodon/mastodon/pull/11577), [Gargron](https://github.com/mastodon/mastodon/pull/11573), [Gargron](https://github.com/mastodon/mastodon/pull/11571)) -- Add indicator of unread notifications to window title when web UI is out of focus ([Gargron](https://github.com/mastodon/mastodon/pull/11560), [Gargron](https://github.com/mastodon/mastodon/pull/11572)) -- Add indicator for which options you voted for in a poll in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11195)) -- **Add search results pagination to web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11409), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11447)) -- **Add option to disable real-time updates in web UI ("slow mode")** ([Gargron](https://github.com/mastodon/mastodon/pull/9984), [ykzts](https://github.com/mastodon/mastodon/pull/11880), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11883), [Gargron](https://github.com/mastodon/mastodon/pull/11898), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11859)) -- Add option to disable blurhash previews in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11188)) -- Add native smooth scrolling when supported in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11207)) -- Add scrolling to the search bar on focus in web UI ([Kjwon15](https://github.com/mastodon/mastodon/pull/12032)) -- Add refresh button to list of rebloggers/favouriters in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12031)) -- Add error description and button to copy stack trace to web UI ([Gargron](https://github.com/mastodon/mastodon/pull/12033)) -- Add search and sort functions to hashtag admin UI ([mayaeh](https://github.com/mastodon/mastodon/pull/11829), [Gargron](https://github.com/mastodon/mastodon/pull/11897), [mayaeh](https://github.com/mastodon/mastodon/pull/11875)) -- Add setting for default search engine indexing in admin UI ([brortao](https://github.com/mastodon/mastodon/pull/11804)) -- Add account bio to account view in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11473)) -- **Add option to include reported statuses in warning e-mail from admin UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11639), [Gargron](https://github.com/mastodon/mastodon/pull/11812), [Gargron](https://github.com/mastodon/mastodon/pull/11741), [Gargron](https://github.com/mastodon/mastodon/pull/11698), [mayaeh](https://github.com/mastodon/mastodon/pull/11765)) -- Add number of pending accounts and pending hashtags to dashboard in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/11514)) -- **Add account migration UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11846), [noellabo](https://github.com/mastodon/mastodon/pull/11905), [noellabo](https://github.com/mastodon/mastodon/pull/11907), [noellabo](https://github.com/mastodon/mastodon/pull/11906), [noellabo](https://github.com/mastodon/mastodon/pull/11902)) -- **Add table of contents to about page** ([Gargron](https://github.com/mastodon/mastodon/pull/11885), [ykzts](https://github.com/mastodon/mastodon/pull/11941), [ykzts](https://github.com/mastodon/mastodon/pull/11895), [Kjwon15](https://github.com/mastodon/mastodon/pull/11916)) -- **Add password challenge to 2FA settings, e-mail notifications** ([Gargron](https://github.com/mastodon/mastodon/pull/11878)) -- **Add optional public list of domain blocks with comments** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11298), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11515), [Gargron](https://github.com/mastodon/mastodon/pull/11908)) -- Add an RSS feed for featured hashtags ([noellabo](https://github.com/mastodon/mastodon/pull/10502)) -- Add explanations to featured hashtags UI and profile ([Gargron](https://github.com/mastodon/mastodon/pull/11586)) -- **Add hashtag trends with admin and user settings** ([Gargron](https://github.com/mastodon/mastodon/pull/11490), [Gargron](https://github.com/mastodon/mastodon/pull/11502), [Gargron](https://github.com/mastodon/mastodon/pull/11641), [Gargron](https://github.com/mastodon/mastodon/pull/11594), [Gargron](https://github.com/mastodon/mastodon/pull/11517), [mayaeh](https://github.com/mastodon/mastodon/pull/11845), [Gargron](https://github.com/mastodon/mastodon/pull/11774), [Gargron](https://github.com/mastodon/mastodon/pull/11712), [Gargron](https://github.com/mastodon/mastodon/pull/11791), [Gargron](https://github.com/mastodon/mastodon/pull/11743), [Gargron](https://github.com/mastodon/mastodon/pull/11740), [Gargron](https://github.com/mastodon/mastodon/pull/11714), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11631), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/11569), [Gargron](https://github.com/mastodon/mastodon/pull/11524), [Gargron](https://github.com/mastodon/mastodon/pull/11513)) - - Add hashtag usage breakdown to admin UI - - Add batch actions for hashtags to admin UI - - Add trends to web UI - - Add trends to public pages - - Add user preference to hide trends - - Add admin setting to disable trends -- **Add categories for custom emojis** ([Gargron](https://github.com/mastodon/mastodon/pull/11196), [Gargron](https://github.com/mastodon/mastodon/pull/11793), [Gargron](https://github.com/mastodon/mastodon/pull/11920), [highemerly](https://github.com/mastodon/mastodon/pull/11876)) - - Add custom emoji categories to emoji picker in web UI - - Add `category` to custom emojis in REST API - - Add batch actions for custom emojis in admin UI -- Add max image dimensions to error message ([raboof](https://github.com/mastodon/mastodon/pull/11552)) -- Add aac, m4a, 3gp, amr, wma to allowed audio formats ([Gargron](https://github.com/mastodon/mastodon/pull/11342), [umonaca](https://github.com/mastodon/mastodon/pull/11687)) -- **Add search syntax for operators and phrases** ([Gargron](https://github.com/mastodon/mastodon/pull/11411)) -- **Add REST API for managing featured hashtags** ([noellabo](https://github.com/mastodon/mastodon/pull/11778)) -- **Add REST API for managing timeline read markers** ([Gargron](https://github.com/mastodon/mastodon/pull/11762)) -- Add `exclude_unreviewed` param to `GET /api/v2/search` REST API ([Gargron](https://github.com/mastodon/mastodon/pull/11977)) -- Add `reason` param to `POST /api/v1/accounts` REST API ([Gargron](https://github.com/mastodon/mastodon/pull/12064)) -- **Add ActivityPub secure mode** ([Gargron](https://github.com/mastodon/mastodon/pull/11269), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11332), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11295)) -- Add HTTP signatures to all outgoing ActivityPub GET requests ([Gargron](https://github.com/mastodon/mastodon/pull/11284), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11300)) -- Add support for ActivityPub Audio activities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11189)) -- Add ActivityPub actor representing the entire server ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11321), [rtucker](https://github.com/mastodon/mastodon/pull/11400), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11561), [Gargron](https://github.com/mastodon/mastodon/pull/11798)) -- **Add whitelist mode** ([Gargron](https://github.com/mastodon/mastodon/pull/11291), [mayaeh](https://github.com/mastodon/mastodon/pull/11634)) -- Add config of multipart threshold for S3 ([ykzts](https://github.com/mastodon/mastodon/pull/11924), [ykzts](https://github.com/mastodon/mastodon/pull/11944)) -- Add health check endpoint for web ([ykzts](https://github.com/mastodon/mastodon/pull/11770), [ykzts](https://github.com/mastodon/mastodon/pull/11947)) -- Add HTTP signature keyId to request log ([Gargron](https://github.com/mastodon/mastodon/pull/11591)) -- Add `SMTP_REPLY_TO` environment variable ([hugogameiro](https://github.com/mastodon/mastodon/pull/11718)) -- Add `tootctl preview_cards remove` command ([mayaeh](https://github.com/mastodon/mastodon/pull/11320)) -- Add `tootctl media refresh` command ([Gargron](https://github.com/mastodon/mastodon/pull/11775)) -- Add `tootctl cache recount` command ([Gargron](https://github.com/mastodon/mastodon/pull/11597)) -- Add option to exclude suspended domains from `tootctl domains crawl` ([dariusk](https://github.com/mastodon/mastodon/pull/11454)) -- Add parallelization to `tootctl search deploy` ([noellabo](https://github.com/mastodon/mastodon/pull/12051)) -- Add soft delete for statuses for instant deletes through API ([Gargron](https://github.com/mastodon/mastodon/pull/11623), [Gargron](https://github.com/mastodon/mastodon/pull/11648)) -- Add rails-level JSON caching ([Gargron](https://github.com/mastodon/mastodon/pull/11333), [Gargron](https://github.com/mastodon/mastodon/pull/11271)) -- **Add request pool to improve delivery performance** ([Gargron](https://github.com/mastodon/mastodon/pull/10353), [ykzts](https://github.com/mastodon/mastodon/pull/11756)) -- Add concurrent connection attempts to resolved IP addresses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11757)) -- Add index for remember_token to improve login performance ([abcang](https://github.com/mastodon/mastodon/pull/11881)) -- **Add more accurate hashtag search** ([Gargron](https://github.com/mastodon/mastodon/pull/11579), [Gargron](https://github.com/mastodon/mastodon/pull/11427), [Gargron](https://github.com/mastodon/mastodon/pull/11448)) -- **Add more accurate account search** ([Gargron](https://github.com/mastodon/mastodon/pull/11537), [Gargron](https://github.com/mastodon/mastodon/pull/11580)) -- **Add a spam check** ([Gargron](https://github.com/mastodon/mastodon/pull/11217), [Gargron](https://github.com/mastodon/mastodon/pull/11806), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11296)) -- Add new languages ([Gargron](https://github.com/mastodon/mastodon/pull/12062)) - - Breton - - Spanish (Argentina) - - Estonian - - Macedonian - - New Norwegian -- Add NodeInfo endpoint ([Gargron](https://github.com/mastodon/mastodon/pull/12002), [Gargron](https://github.com/mastodon/mastodon/pull/12058)) - -### Changed - -- **Change conversations UI** ([Gargron](https://github.com/mastodon/mastodon/pull/11896)) -- Change dashboard to short number notation ([noellabo](https://github.com/mastodon/mastodon/pull/11847), [noellabo](https://github.com/mastodon/mastodon/pull/11911)) -- Change REST API `GET /api/v1/timelines/public` to require authentication when public preview is off ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11802)) -- Change REST API `POST /api/v1/follow_requests/:id/(approve|reject)` to return relationship ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11800)) -- Change rate limit for media proxy ([ykzts](https://github.com/mastodon/mastodon/pull/11814)) -- Change unlisted custom emoji to not appear in autosuggestions ([Gargron](https://github.com/mastodon/mastodon/pull/11818)) -- Change max length of media descriptions from 420 to 1500 characters ([Gargron](https://github.com/mastodon/mastodon/pull/11819), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11836)) -- **Change deletes to preserve soft-deleted statuses in unresolved reports** ([Gargron](https://github.com/mastodon/mastodon/pull/11805)) -- **Change tootctl to use inline parallelization instead of Sidekiq** ([Gargron](https://github.com/mastodon/mastodon/pull/11776)) -- **Change account deletion page to have better explanations** ([Gargron](https://github.com/mastodon/mastodon/pull/11753), [Gargron](https://github.com/mastodon/mastodon/pull/11763)) -- Change hashtag component in web UI to show numbers for 2 last days ([Gargron](https://github.com/mastodon/mastodon/pull/11742), [Gargron](https://github.com/mastodon/mastodon/pull/11755), [Gargron](https://github.com/mastodon/mastodon/pull/11754)) -- Change OpenGraph description on sign-up page to reflect invite ([Gargron](https://github.com/mastodon/mastodon/pull/11744)) -- Change layout of public profile directory to be the same as in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11705)) -- Change detailed status child ordering to sort self-replies on top ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11686)) -- Change window resize handler to switch to/from mobile layout as soon as needed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11656)) -- Change icon button styles to make hover/focus states more obvious ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11474)) -- Change contrast of status links that are not mentions or hashtags ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11406)) -- **Change hashtags to preserve first-used casing** ([Gargron](https://github.com/mastodon/mastodon/pull/11416), [Gargron](https://github.com/mastodon/mastodon/pull/11508), [Gargron](https://github.com/mastodon/mastodon/pull/11504), [Gargron](https://github.com/mastodon/mastodon/pull/11507), [Gargron](https://github.com/mastodon/mastodon/pull/11441)) -- **Change unconfirmed user login behaviour** ([Gargron](https://github.com/mastodon/mastodon/pull/11375), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11394), [Gargron](https://github.com/mastodon/mastodon/pull/11860)) -- **Change single-column mode to scroll the whole page** ([Gargron](https://github.com/mastodon/mastodon/pull/11359), [Gargron](https://github.com/mastodon/mastodon/pull/11894), [Gargron](https://github.com/mastodon/mastodon/pull/11891), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11655), [Gargron](https://github.com/mastodon/mastodon/pull/11463), [Gargron](https://github.com/mastodon/mastodon/pull/11458), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11395), [Gargron](https://github.com/mastodon/mastodon/pull/11418)) -- Change `tootctl accounts follow` to only work with local accounts ([angristan](https://github.com/mastodon/mastodon/pull/11592)) -- Change Dockerfile ([Shleeble](https://github.com/mastodon/mastodon/pull/11710), [ykzts](https://github.com/mastodon/mastodon/pull/11768), [Shleeble](https://github.com/mastodon/mastodon/pull/11707)) -- Change supported Node versions to include v12 ([abcang](https://github.com/mastodon/mastodon/pull/11706)) -- Change Portuguese language from `pt` to `pt-PT` ([Gargron](https://github.com/mastodon/mastodon/pull/11820)) -- Change domain block silence to always require approval on follow ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11975)) -- Change link preview fetcher to not perform a HEAD request first ([Gargron](https://github.com/mastodon/mastodon/pull/12028)) -- Change `tootctl domains purge` to accept multiple domains at once ([Gargron](https://github.com/mastodon/mastodon/pull/12046)) - -### Removed - -- **Remove OStatus support** ([Gargron](https://github.com/mastodon/mastodon/pull/11205), [Gargron](https://github.com/mastodon/mastodon/pull/11303), [Gargron](https://github.com/mastodon/mastodon/pull/11460), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11280), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11278)) -- Remove Atom feeds and old URLs in the form of `GET /:username/updates/:id` ([Gargron](https://github.com/mastodon/mastodon/pull/11247)) -- Remove WebP support ([angristan](https://github.com/mastodon/mastodon/pull/11589)) -- Remove deprecated config options from Heroku and Scalingo ([ykzts](https://github.com/mastodon/mastodon/pull/11925)) -- Remove deprecated REST API `GET /api/v1/search` API ([Gargron](https://github.com/mastodon/mastodon/pull/11823)) -- Remove deprecated REST API `GET /api/v1/statuses/:id/card` ([Gargron](https://github.com/mastodon/mastodon/pull/11213)) -- Remove deprecated REST API `POST /api/v1/notifications/dismiss?id=:id` ([Gargron](https://github.com/mastodon/mastodon/pull/11214)) -- Remove deprecated REST API `GET /api/v1/timelines/direct` ([Gargron](https://github.com/mastodon/mastodon/pull/11212)) - -### Fixed - -- Fix manifest warning ([ykzts](https://github.com/mastodon/mastodon/pull/11767)) -- Fix admin UI for custom emoji not respecting GIF autoplay preference ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11801)) -- Fix page body not being scrollable in admin/settings layout ([Gargron](https://github.com/mastodon/mastodon/pull/11893)) -- Fix placeholder colors for inputs not being explicitly defined ([Gargron](https://github.com/mastodon/mastodon/pull/11890)) -- Fix incorrect enclosure length in RSS ([tsia](https://github.com/mastodon/mastodon/pull/11889)) -- Fix TOTP codes not being filtered from logs during enabling/disabling ([Gargron](https://github.com/mastodon/mastodon/pull/11877)) -- Fix webfinger response not returning 410 when account is suspended ([Gargron](https://github.com/mastodon/mastodon/pull/11869)) -- Fix ActivityPub Move handler queuing jobs that will fail if account is suspended ([Gargron](https://github.com/mastodon/mastodon/pull/11864)) -- Fix SSO login not using existing account when e-mail is verified ([Gargron](https://github.com/mastodon/mastodon/pull/11862)) -- Fix web UI allowing uploads past status limit via drag & drop ([Gargron](https://github.com/mastodon/mastodon/pull/11863)) -- Fix expiring polls not being displayed as such in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11835)) -- Fix 2FA challenge and password challenge for non-database users ([Gargron](https://github.com/mastodon/mastodon/pull/11831), [Gargron](https://github.com/mastodon/mastodon/pull/11943)) -- Fix profile fields overflowing page width in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11828)) -- Fix web push subscriptions being deleted on rate limit or timeout ([Gargron](https://github.com/mastodon/mastodon/pull/11826)) -- Fix display of long poll options in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11717), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11833)) -- Fix search API not resolving URL when `type` is given ([Gargron](https://github.com/mastodon/mastodon/pull/11822)) -- Fix hashtags being split by ZWNJ character ([Gargron](https://github.com/mastodon/mastodon/pull/11821)) -- Fix scroll position resetting when opening media modals in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11815)) -- Fix duplicate HTML IDs on about page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11803)) -- Fix admin UI showing superfluous reject media/reports on suspended domain blocks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11749)) -- Fix ActivityPub context not being dynamically computed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11746)) -- Fix Mastodon logo style on hover on public pages' footer ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11735)) -- Fix height of dashboard counters ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11736)) -- Fix custom emoji animation on hover in web UI directory bios ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11716)) -- Fix non-numbers being passed to Redis and causing an error ([Gargron](https://github.com/mastodon/mastodon/pull/11697)) -- Fix error in REST API for an account's statuses ([Gargron](https://github.com/mastodon/mastodon/pull/11700)) -- Fix uncaught error when resource param is missing in Webfinger request ([Gargron](https://github.com/mastodon/mastodon/pull/11701)) -- Fix uncaught domain normalization error in remote follow ([Gargron](https://github.com/mastodon/mastodon/pull/11703)) -- Fix uncaught 422 and 500 errors ([Gargron](https://github.com/mastodon/mastodon/pull/11590), [Gargron](https://github.com/mastodon/mastodon/pull/11811)) -- Fix uncaught parameter missing exceptions and missing error templates ([Gargron](https://github.com/mastodon/mastodon/pull/11702)) -- Fix encoding error when checking e-mail MX records ([Gargron](https://github.com/mastodon/mastodon/pull/11696)) -- Fix items in StatusContent render list not all having a key ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11645)) -- Fix remote and staff-removed statuses leaving media behind for a day ([Gargron](https://github.com/mastodon/mastodon/pull/11638)) -- Fix CSP needlessly allowing blob URLs in script-src ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11620)) -- Fix ignoring whole status because of one invalid hashtag ([Gargron](https://github.com/mastodon/mastodon/pull/11621)) -- Fix hidden statuses losing focus ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11208)) -- Fix loading bar being obscured by other elements in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11598)) -- Fix multiple issues with replies collection for pages further than self-replies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11582)) -- Fix blurhash and autoplay not working on public pages ([Gargron](https://github.com/mastodon/mastodon/pull/11585)) -- Fix 422 being returned instead of 404 when POSTing to unmatched routes ([Gargron](https://github.com/mastodon/mastodon/pull/11574), [Gargron](https://github.com/mastodon/mastodon/pull/11704)) -- Fix client-side resizing of image uploads ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11570)) -- Fix short number formatting for numbers above million in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11559)) -- Fix ActivityPub and REST API queries setting cookies and preventing caching ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11539), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11557), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11336), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11331)) -- Fix some emojis in profile metadata labels are not emojified. ([kedamaDQ](https://github.com/mastodon/mastodon/pull/11534)) -- Fix account search always returning exact match on paginated results ([Gargron](https://github.com/mastodon/mastodon/pull/11525)) -- Fix acct URIs with IDN domains not being resolved ([Gargron](https://github.com/mastodon/mastodon/pull/11520)) -- Fix admin dashboard missing latest features ([Gargron](https://github.com/mastodon/mastodon/pull/11505)) -- Fix jumping of toot date when clicking spoiler button ([ariasuni](https://github.com/mastodon/mastodon/pull/11449)) -- Fix boost to original audience not working on mobile in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11371)) -- Fix handling of webfinger redirects in ResolveAccountService ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11279)) -- Fix URLs appearing twice in errors of ActivityPub::DeliveryWorker ([Gargron](https://github.com/mastodon/mastodon/pull/11231)) -- Fix support for HTTP proxies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11245)) -- Fix HTTP requests to IPv6 hosts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11240)) -- Fix error in Elasticsearch index import ([mayaeh](https://github.com/mastodon/mastodon/pull/11192)) -- Fix duplicate account error when seeding development database ([ysksn](https://github.com/mastodon/mastodon/pull/11366)) -- Fix performance of session clean-up scheduler ([abcang](https://github.com/mastodon/mastodon/pull/11871)) -- Fix older migrations not running ([zunda](https://github.com/mastodon/mastodon/pull/11377)) -- Fix URLs counting towards RTL detection ([ahangarha](https://github.com/mastodon/mastodon/pull/11759)) -- Fix unnecessary status re-rendering in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11211)) -- Fix http_parser.rb gem not being compiled when no network available ([petabyteboy](https://github.com/mastodon/mastodon/pull/11444)) -- Fix muted text color not applying to all text ([trwnh](https://github.com/mastodon/mastodon/pull/11996)) -- Fix follower/following lists resetting on back-navigation in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11986)) -- Fix n+1 query when approving multiple follow requests ([abcang](https://github.com/mastodon/mastodon/pull/12004)) -- Fix records not being indexed into Elasticsearch sometimes ([Gargron](https://github.com/mastodon/mastodon/pull/12024)) -- Fix needlessly indexing unsearchable statuses into Elasticsearch ([Gargron](https://github.com/mastodon/mastodon/pull/12041)) -- Fix new user bootstrapping crashing when to-be-followed accounts are invalid ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/12037)) -- Fix featured hashtag URL being interpreted as media or replies tab ([Gargron](https://github.com/mastodon/mastodon/pull/12048)) -- Fix account counters being overwritten by parallel writes ([Gargron](https://github.com/mastodon/mastodon/pull/12045)) - -### Security - -- Fix performance of GIF re-encoding and always strip EXIF data from videos ([Gargron](https://github.com/mastodon/mastodon/pull/12057)) - -## [2.9.3] - 2019-08-10 - -### Added - -- Add GIF and WebP support for custom emojis ([Gargron](https://github.com/mastodon/mastodon/pull/11519)) -- Add logout link to dropdown menu in web UI ([koyuawsmbrtn](https://github.com/mastodon/mastodon/pull/11353)) -- Add indication that text search is unavailable in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11112), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11202)) -- Add `suffix` to `Mastodon::Version` to help forks ([clarfon](https://github.com/mastodon/mastodon/pull/11407)) -- Add on-hover animation to animated custom emoji in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11348), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11404), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11522)) -- Add custom emoji support in profile metadata labels ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11350)) - -### Changed - -- Change default interface of web and streaming from 0.0.0.0 to 127.0.0.1 ([Gargron](https://github.com/mastodon/mastodon/pull/11302), [zunda](https://github.com/mastodon/mastodon/pull/11378), [Gargron](https://github.com/mastodon/mastodon/pull/11351), [zunda](https://github.com/mastodon/mastodon/pull/11326)) -- Change the retry limit of web push notifications ([highemerly](https://github.com/mastodon/mastodon/pull/11292)) -- Change ActivityPub deliveries to not retry HTTP 501 errors ([Gargron](https://github.com/mastodon/mastodon/pull/11233)) -- Change language detection to include hashtags as words ([Gargron](https://github.com/mastodon/mastodon/pull/11341)) -- Change terms and privacy policy pages to always be accessible ([Gargron](https://github.com/mastodon/mastodon/pull/11334)) -- Change robots tag to include `noarchive` when user opts out of indexing ([Kjwon15](https://github.com/mastodon/mastodon/pull/11421)) - -### Fixed - -- Fix account domain block not clearing out notifications ([Gargron](https://github.com/mastodon/mastodon/pull/11393)) -- Fix incorrect locale sometimes being detected for browser ([Gargron](https://github.com/mastodon/mastodon/pull/8657)) -- Fix crash when saving invalid domain name ([Gargron](https://github.com/mastodon/mastodon/pull/11528)) -- Fix pinned statuses REST API returning pagination headers ([Gargron](https://github.com/mastodon/mastodon/pull/11526)) -- Fix "cancel follow request" button having unreadable text in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11521)) -- Fix image uploads being blank when canvas read access is blocked ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11499)) -- Fix avatars not being animated on hover when not logged in ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11349)) -- Fix overzealous sanitization of HTML lists ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11354)) -- Fix block crashing when a follow request exists ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11288)) -- Fix backup service crashing when an attachment is missing ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11241)) -- Fix account moderation action always sending e-mail notification ([Gargron](https://github.com/mastodon/mastodon/pull/11242)) -- Fix swiping columns on mobile sometimes failing in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11200)) -- Fix wrong actor URI being serialized into poll updates ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11194)) -- Fix statsd UDP sockets not being cleaned up in Sidekiq ([Gargron](https://github.com/mastodon/mastodon/pull/11230)) -- Fix expiration date of filters being set to "never" when editing them ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11204)) -- Fix support for MP4 files that are actually M4V files ([Gargron](https://github.com/mastodon/mastodon/pull/11210)) -- Fix `alerts` not being typecast correctly in push subscription in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/11343)) -- Fix some notices staying on unrelated pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11364)) -- Fix unboosting sometimes preventing a boost from reappearing on feed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11405), [Gargron](https://github.com/mastodon/mastodon/pull/11450)) -- Fix only one middle dot being recognized in hashtags ([Gargron](https://github.com/mastodon/mastodon/pull/11345), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11363)) -- Fix unnecessary SQL query performed on unauthenticated requests ([Gargron](https://github.com/mastodon/mastodon/pull/11179)) -- Fix incorrect timestamp displayed on featured tags ([Kjwon15](https://github.com/mastodon/mastodon/pull/11477)) -- Fix privacy dropdown active state when dropdown is placed on top of it ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11495)) -- Fix filters not being applied to poll options ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11174)) -- Fix keyboard navigation on various dropdowns ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11511), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11492), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11491)) -- Fix keyboard navigation in modals ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11493)) -- Fix image conversation being non-deterministic due to timestamps ([Gargron](https://github.com/mastodon/mastodon/pull/11408)) -- Fix web UI performance ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11211), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11234)) -- Fix scrolling to compose form when not necessary in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11246), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/11182)) -- Fix save button being enabled when list title is empty in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11475)) -- Fix poll expiration not being pre-filled on delete & redraft in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11203)) -- Fix content warning sometimes being set when not requested in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11206)) - -### Security - -- Fix invites not being disabled upon account suspension ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11412)) -- Fix blocked domains still being able to fill database with account records ([Gargron](https://github.com/mastodon/mastodon/pull/11219)) - -## [2.9.2] - 2019-06-22 - -### Added - -- Add `short_description` and `approval_required` to `GET /api/v1/instance` ([Gargron](https://github.com/mastodon/mastodon/pull/11146)) - -### Changed - -- Change camera icon to paperclip icon in upload form ([koyuawsmbrtn](https://github.com/mastodon/mastodon/pull/11149)) - -### Fixed - -- Fix audio-only OGG and WebM files not being processed as such ([Gargron](https://github.com/mastodon/mastodon/pull/11151)) -- Fix audio not being downloaded from remote servers ([Gargron](https://github.com/mastodon/mastodon/pull/11145)) - -## [2.9.1] - 2019-06-22 - -### Added - -- Add moderation API ([Gargron](https://github.com/mastodon/mastodon/pull/9387)) -- Add audio uploads ([Gargron](https://github.com/mastodon/mastodon/pull/11123), [Gargron](https://github.com/mastodon/mastodon/pull/11141)) - -### Changed - -- Change domain blocks to automatically support subdomains ([Gargron](https://github.com/mastodon/mastodon/pull/11138)) -- Change Nanobox configuration to bring it up to date ([danhunsaker](https://github.com/mastodon/mastodon/pull/11083)) - -### Removed - -- Remove expensive counters from federation page in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/11139)) - -### Fixed - -- Fix converted media being saved with original extension and mime type ([Gargron](https://github.com/mastodon/mastodon/pull/11130)) -- Fix layout of identity proofs settings ([acid-chicken](https://github.com/mastodon/mastodon/pull/11126)) -- Fix active scope only returning suspended users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11111)) -- Fix sanitizer making block level elements unreadable ([Gargron](https://github.com/mastodon/mastodon/pull/10836)) -- Fix label for site theme not being translated in admin UI ([palindromordnilap](https://github.com/mastodon/mastodon/pull/11121)) -- Fix statuses not being filtered irreversibly in web UI under some circumstances ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11113)) -- Fix scrolling behaviour in compose form ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11093)) - -## [2.9.0] - 2019-06-13 - -### Added - -- **Add single-column mode in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/10807), [Gargron](https://github.com/mastodon/mastodon/pull/10848), [Gargron](https://github.com/mastodon/mastodon/pull/11003), [Gargron](https://github.com/mastodon/mastodon/pull/10961), [Hanage999](https://github.com/mastodon/mastodon/pull/10915), [noellabo](https://github.com/mastodon/mastodon/pull/10917), [abcang](https://github.com/mastodon/mastodon/pull/10859), [Gargron](https://github.com/mastodon/mastodon/pull/10820), [Gargron](https://github.com/mastodon/mastodon/pull/10835), [Gargron](https://github.com/mastodon/mastodon/pull/10809), [Gargron](https://github.com/mastodon/mastodon/pull/10963), [noellabo](https://github.com/mastodon/mastodon/pull/10883), [Hanage999](https://github.com/mastodon/mastodon/pull/10839)) -- Add waiting time to the list of pending accounts in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/10985)) -- Add a keyboard shortcut to hide/show media in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10647), [Gargron](https://github.com/mastodon/mastodon/pull/10838), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10872)) -- Add `account_id` param to `GET /api/v1/notifications` ([pwoolcoc](https://github.com/mastodon/mastodon/pull/10796)) -- Add confirmation modal for unboosting toots in web UI ([aurelien-reeves](https://github.com/mastodon/mastodon/pull/10287)) -- Add emoji suggestions to content warning and poll option fields in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10555)) -- Add `source` attribute to response of `DELETE /api/v1/statuses/:id` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10669)) -- Add some caching for HTML versions of public status pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10701)) -- Add button to conveniently copy OAuth code ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/11065)) - -### Changed - -- **Change default layout to single column in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/10847)) -- **Change light theme** ([Gargron](https://github.com/mastodon/mastodon/pull/10992), [Gargron](https://github.com/mastodon/mastodon/pull/10996), [yuzulabo](https://github.com/mastodon/mastodon/pull/10754), [Gargron](https://github.com/mastodon/mastodon/pull/10845)) -- **Change preferences page into appearance, notifications, and other** ([Gargron](https://github.com/mastodon/mastodon/pull/10977), [Gargron](https://github.com/mastodon/mastodon/pull/10988)) -- Change priority of delete activity forwards for replies and reblogs ([Gargron](https://github.com/mastodon/mastodon/pull/11002)) -- Change Mastodon logo to use primary text color of the given theme ([Gargron](https://github.com/mastodon/mastodon/pull/10994)) -- Change reblogs counter to be updated when boosted privately ([Gargron](https://github.com/mastodon/mastodon/pull/10964)) -- Change bio limit from 160 to 500 characters ([trwnh](https://github.com/mastodon/mastodon/pull/10790)) -- Change API rate limiting to reduce allowed unauthenticated requests ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10860), [hinaloe](https://github.com/mastodon/mastodon/pull/10868), [mayaeh](https://github.com/mastodon/mastodon/pull/10867)) -- Change help text of `tootctl emoji import` command to specify a gzipped TAR archive is required ([dariusk](https://github.com/mastodon/mastodon/pull/11000)) -- Change web UI to hide poll options behind content warnings ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10983)) -- Change silencing to ensure local effects and remote effects are the same for silenced local users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10575)) -- Change `tootctl domains purge` to remove custom emoji as well ([Kjwon15](https://github.com/mastodon/mastodon/pull/10721)) -- Change Docker image to keep `apt` working ([SuperSandro2000](https://github.com/mastodon/mastodon/pull/10830)) - -### Removed - -- Remove `dist-upgrade` from Docker image ([SuperSandro2000](https://github.com/mastodon/mastodon/pull/10822)) - -### Fixed - -- Fix RTL layout not being RTL within the columns area in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10990)) -- Fix display of alternative text when a media attachment is not available in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10981)) -- Fix not being able to directly switch between list timelines in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10973)) -- Fix media sensitivity not being maintained in delete & redraft in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10980)) -- Fix emoji picker being always displayed in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/10979), [yuzulabo](https://github.com/mastodon/mastodon/pull/10801), [wcpaez](https://github.com/mastodon/mastodon/pull/10978)) -- Fix potential private status leak through caching ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10969)) -- Fix refreshing featured toots when the new collection is empty in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10971)) -- Fix undoing domain block also undoing individual moderation on users from before the domain block ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10660)) -- Fix time not being local in the audit log ([yuzulabo](https://github.com/mastodon/mastodon/pull/10751)) -- Fix statuses removed by moderation re-appearing on subsequent fetches ([Kjwon15](https://github.com/mastodon/mastodon/pull/10732)) -- Fix misattribution of inlined announces if `attributedTo` isn't present in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10967)) -- Fix `GET /api/v1/polls/:id` not requiring authentication for non-public polls ([Gargron](https://github.com/mastodon/mastodon/pull/10960)) -- Fix handling of blank poll options in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10946)) -- Fix avatar preview aspect ratio on edit profile page ([Kjwon15](https://github.com/mastodon/mastodon/pull/10931)) -- Fix web push notifications not being sent for polls ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10864)) -- Fix cut off letters in last paragraph of statuses in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/10821)) -- Fix list not being automatically unpinned when it returns 404 in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/11045)) -- Fix login sometimes redirecting to paths that are not pages ([Gargron](https://github.com/mastodon/mastodon/pull/11019)) - -## [2.8.4] - 2019-05-24 - -### Fixed - -- Fix delivery not retrying on some inbox errors that should be retriable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10812)) -- Fix unnecessary 5 minute cooldowns on signature verifications in some cases ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10813)) -- Fix possible race condition when processing statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10815)) - -### Security - -- Require specific OAuth scopes for specific endpoints of the streaming API, instead of merely requiring a token for all endpoints, and allow using WebSockets protocol negotiation to specify the access token instead of using a query string ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10818)) - -## [2.8.3] - 2019-05-19 - -### Added - -- Add `og:image:alt` OpenGraph tag ([BenLubar](https://github.com/mastodon/mastodon/pull/10779)) -- Add clickable area below avatar in statuses in web UI ([Dar13](https://github.com/mastodon/mastodon/pull/10766)) -- Add crossed-out eye icon on account gallery in web UI ([Kjwon15](https://github.com/mastodon/mastodon/pull/10715)) -- Add media description tooltip to thumbnails in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10713)) - -### Changed - -- Change "mark as sensitive" button into a checkbox for clarity ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10748)) - -### Fixed - -- Fix bug allowing users to publicly boost their private statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10775), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10783)) -- Fix performance in formatter by a little ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10765)) -- Fix some colors in the light theme ([yuzulabo](https://github.com/mastodon/mastodon/pull/10754)) -- Fix some colors of the high contrast theme ([yuzulabo](https://github.com/mastodon/mastodon/pull/10711)) -- Fix ambivalent active state of poll refresh button in web UI ([MaciekBaron](https://github.com/mastodon/mastodon/pull/10720)) -- Fix duplicate posting being possible from web UI ([hinaloe](https://github.com/mastodon/mastodon/pull/10785)) -- Fix "invited by" not showing up in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10791)) - -## [2.8.2] - 2019-05-05 - -### Added - -- Add `SOURCE_TAG` environment variable ([ushitora-anqou](https://github.com/mastodon/mastodon/pull/10698)) - -### Fixed - -- Fix cropped hero image on frontpage ([BaptisteGelez](https://github.com/mastodon/mastodon/pull/10702)) -- Fix blurhash gem not compiling on some operating systems ([Gargron](https://github.com/mastodon/mastodon/pull/10700)) -- Fix unexpected CSS animations in some browsers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10699)) -- Fix closing video modal scrolling timelines to top ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10695)) - -## [2.8.1] - 2019-05-04 - -### Added - -- Add link to existing domain block when trying to block an already-blocked domain ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10663)) -- Add button to view context to media modal when opened from account gallery in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10676)) -- Add ability to create multiple-choice polls in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10603)) -- Add `GITHUB_REPOSITORY` and `SOURCE_BASE_URL` environment variables ([rosylilly](https://github.com/mastodon/mastodon/pull/10600)) -- Add `/interact/` paths to `robots.txt` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10666)) -- Add `blurhash` to the Attachment entity in the REST API ([Gargron](https://github.com/mastodon/mastodon/pull/10630)) - -### Changed - -- Change hidden media to be shown as a blurhash-based colorful gradient instead of a black box in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10630)) -- Change rejected media to be shown as a blurhash-based gradient instead of a list of filenames in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10630)) -- Change e-mail whitelist/blacklist to not be checked when invited ([Gargron](https://github.com/mastodon/mastodon/pull/10683)) -- Change cache header of REST API results to no-cache ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10655)) -- Change the "mark media as sensitive" button to be more obvious in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10673), [Gargron](https://github.com/mastodon/mastodon/pull/10682)) -- Change account gallery in web UI to display 3 columns, open media modal ([Gargron](https://github.com/mastodon/mastodon/pull/10667), [Gargron](https://github.com/mastodon/mastodon/pull/10674)) - -### Fixed - -- Fix LDAP/PAM/SAML/CAS users not being pre-approved ([Gargron](https://github.com/mastodon/mastodon/pull/10621)) -- Fix accounts created through tootctl not being always pre-approved ([Gargron](https://github.com/mastodon/mastodon/pull/10684)) -- Fix Sidekiq retrying ActivityPub processing jobs that fail validation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10614)) -- Fix toots not being scrolled into view sometimes through keyboard selection ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10593)) -- Fix expired invite links being usable to bypass approval mode ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10657)) -- Fix not being able to save e-mail preference for new pending accounts ([Gargron](https://github.com/mastodon/mastodon/pull/10622)) -- Fix upload progressbar when image resizing is involved ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10632)) -- Fix block action not automatically cancelling pending follow request ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10633)) -- Fix stoplight logging to stderr separate from Rails logger ([Gargron](https://github.com/mastodon/mastodon/pull/10624)) -- Fix sign up button not saying sign up when invite is used ([Gargron](https://github.com/mastodon/mastodon/pull/10623)) -- Fix health checks in Docker Compose configuration ([fabianonline](https://github.com/mastodon/mastodon/pull/10553)) -- Fix modal items not being scrollable on touch devices ([kedamaDQ](https://github.com/mastodon/mastodon/pull/10605)) -- Fix Keybase configuration using wrong domain when a web domain is used ([BenLubar](https://github.com/mastodon/mastodon/pull/10565)) -- Fix avatar GIFs not being animated on-hover on public profiles ([hyenagirl64](https://github.com/mastodon/mastodon/pull/10549)) -- Fix OpenGraph parser not understanding some valid property meta tags ([da2x](https://github.com/mastodon/mastodon/pull/10604)) -- Fix wrong fonts being displayed when Roboto is installed on user's machine ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10594)) -- Fix confirmation modals being too narrow for a secondary action button ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10586)) - -## [2.8.0] - 2019-04-10 - -### Added - -- Add polls ([Gargron](https://github.com/mastodon/mastodon/pull/10111), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10155), [Gargron](https://github.com/mastodon/mastodon/pull/10184), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10196), [Gargron](https://github.com/mastodon/mastodon/pull/10248), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10255), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10322), [Gargron](https://github.com/mastodon/mastodon/pull/10138), [Gargron](https://github.com/mastodon/mastodon/pull/10139), [Gargron](https://github.com/mastodon/mastodon/pull/10144), [Gargron](https://github.com/mastodon/mastodon/pull/10145),[Gargron](https://github.com/mastodon/mastodon/pull/10146), [Gargron](https://github.com/mastodon/mastodon/pull/10148), [Gargron](https://github.com/mastodon/mastodon/pull/10151), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10150), [Gargron](https://github.com/mastodon/mastodon/pull/10168), [Gargron](https://github.com/mastodon/mastodon/pull/10165), [Gargron](https://github.com/mastodon/mastodon/pull/10172), [Gargron](https://github.com/mastodon/mastodon/pull/10170), [Gargron](https://github.com/mastodon/mastodon/pull/10171), [Gargron](https://github.com/mastodon/mastodon/pull/10186), [Gargron](https://github.com/mastodon/mastodon/pull/10189), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10200), [rinsuki](https://github.com/mastodon/mastodon/pull/10203), [Gargron](https://github.com/mastodon/mastodon/pull/10213), [Gargron](https://github.com/mastodon/mastodon/pull/10246), [Gargron](https://github.com/mastodon/mastodon/pull/10265), [Gargron](https://github.com/mastodon/mastodon/pull/10261), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10333), [Gargron](https://github.com/mastodon/mastodon/pull/10352), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10140), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10142), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10141), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10162), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10161), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10158), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10156), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10160), [Gargron](https://github.com/mastodon/mastodon/pull/10185), [Gargron](https://github.com/mastodon/mastodon/pull/10188), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10195), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10208), [Gargron](https://github.com/mastodon/mastodon/pull/10187), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10214), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10209)) -- Add follows & followers managing UI ([Gargron](https://github.com/mastodon/mastodon/pull/10268), [Gargron](https://github.com/mastodon/mastodon/pull/10308), [Gargron](https://github.com/mastodon/mastodon/pull/10404), [Gargron](https://github.com/mastodon/mastodon/pull/10293)) -- Add identity proof integration with Keybase ([Gargron](https://github.com/mastodon/mastodon/pull/10297), [xgess](https://github.com/mastodon/mastodon/pull/10375), [Gargron](https://github.com/mastodon/mastodon/pull/10338), [Gargron](https://github.com/mastodon/mastodon/pull/10350), [Gargron](https://github.com/mastodon/mastodon/pull/10414)) -- Add option to overwrite imported data instead of merging ([Gargron](https://github.com/mastodon/mastodon/pull/9962)) -- Add featured hashtags to profiles ([Gargron](https://github.com/mastodon/mastodon/pull/9755), [Gargron](https://github.com/mastodon/mastodon/pull/10167), [Gargron](https://github.com/mastodon/mastodon/pull/10249), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10034)) -- Add admission-based registrations mode ([Gargron](https://github.com/mastodon/mastodon/pull/10250), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10269), [Gargron](https://github.com/mastodon/mastodon/pull/10264), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10321), [Gargron](https://github.com/mastodon/mastodon/pull/10349), [Gargron](https://github.com/mastodon/mastodon/pull/10469)) -- Add support for WebP uploads ([acid-chicken](https://github.com/mastodon/mastodon/pull/9879)) -- Add "copy link" item to status action bars in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/9983)) -- Add list title editing in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9748)) -- Add a "Block & Report" button to the block confirmation dialog in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10360)) -- Add disappointed elephant when the page crashes in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10275)) -- Add ability to upload multiple files at once in web UI ([tmm576](https://github.com/mastodon/mastodon/pull/9856)) -- Add indication when you are not allowed to follow an account in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10420), [Gargron](https://github.com/mastodon/mastodon/pull/10491)) -- Add validations to admin settings to catch common mistakes ([Gargron](https://github.com/mastodon/mastodon/pull/10348), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10354)) -- Add `type`, `limit`, `offset`, `min_id`, `max_id`, `account_id` to search API ([Gargron](https://github.com/mastodon/mastodon/pull/10091)) -- Add a preferences API so apps can share basic behaviours ([Gargron](https://github.com/mastodon/mastodon/pull/10109)) -- Add `visibility` param to reblog REST API ([Gargron](https://github.com/mastodon/mastodon/pull/9851), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10302)) -- Add `allowfullscreen` attribute to OEmbed iframe ([rinsuki](https://github.com/mastodon/mastodon/pull/10370)) -- Add `blocked_by` relationship to the REST API ([Gargron](https://github.com/mastodon/mastodon/pull/10373)) -- Add `tootctl statuses remove` to sweep unreferenced statuses ([Gargron](https://github.com/mastodon/mastodon/pull/10063)) -- Add `tootctl search deploy` to avoid ugly rake task syntax ([Gargron](https://github.com/mastodon/mastodon/pull/10403)) -- Add `tootctl self-destruct` to shut down server gracefully ([Gargron](https://github.com/mastodon/mastodon/pull/10367)) -- Add option to hide application used to toot ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9897), [rinsuki](https://github.com/mastodon/mastodon/pull/9994), [hinaloe](https://github.com/mastodon/mastodon/pull/10086)) -- Add `DB_SSLMODE` configuration variable ([sascha-sl](https://github.com/mastodon/mastodon/pull/10210)) -- Add click-to-copy UI to invites page ([Gargron](https://github.com/mastodon/mastodon/pull/10259)) -- Add self-replies fetching ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10106), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10128), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10175), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10201)) -- Add rate limit for media proxy requests ([Gargron](https://github.com/mastodon/mastodon/pull/10490)) -- Add `tootctl emoji purge` ([Gargron](https://github.com/mastodon/mastodon/pull/10481)) -- Add `tootctl accounts approve` ([Gargron](https://github.com/mastodon/mastodon/pull/10480)) -- Add `tootctl accounts reset-relationships` ([noellabo](https://github.com/mastodon/mastodon/pull/10483)) - -### Changed - -- Change design of landing page ([Gargron](https://github.com/mastodon/mastodon/pull/10232), [Gargron](https://github.com/mastodon/mastodon/pull/10260), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10284), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10291), [koyuawsmbrtn](https://github.com/mastodon/mastodon/pull/10356), [Gargron](https://github.com/mastodon/mastodon/pull/10245)) -- Change design of profile column in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10337), [Aditoo17](https://github.com/mastodon/mastodon/pull/10387), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10390), [mayaeh](https://github.com/mastodon/mastodon/pull/10379), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10411)) -- Change language detector threshold from 140 characters to 4 words ([Gargron](https://github.com/mastodon/mastodon/pull/10376)) -- Change language detector to always kick in for non-latin alphabets ([Gargron](https://github.com/mastodon/mastodon/pull/10276)) -- Change icons of features on admin dashboard ([Gargron](https://github.com/mastodon/mastodon/pull/10366)) -- Change DNS timeouts from 1s to 5s ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10238)) -- Change Docker image to use Ubuntu with jemalloc ([Sir-Boops](https://github.com/mastodon/mastodon/pull/10100), [BenLubar](https://github.com/mastodon/mastodon/pull/10212)) -- Change public pages to be cacheable by proxies ([BenLubar](https://github.com/mastodon/mastodon/pull/9059)) -- Change the 410 gone response for suspended accounts to be cacheable by proxies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10339)) -- Change web UI to not empty timeline of blocked users on block ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10359)) -- Change JSON serializer to remove unused `@context` values ([Gargron](https://github.com/mastodon/mastodon/pull/10378)) -- Change GIFV file size limit to be the same as for other videos ([rinsuki](https://github.com/mastodon/mastodon/pull/9924)) -- Change Webpack to not use @babel/preset-env to compile node_modules ([ykzts](https://github.com/mastodon/mastodon/pull/10289)) -- Change web UI to use new Web Share Target API ([gol-cha](https://github.com/mastodon/mastodon/pull/9963)) -- Change ActivityPub reports to have persistent URIs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10303)) -- Change `tootctl accounts cull --dry-run` to list accounts that would be deleted ([BenLubar](https://github.com/mastodon/mastodon/pull/10460)) -- Change format of CSV exports of follows and mutes to include extra settings ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10495), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10335)) -- Change ActivityPub collections to be cacheable by proxies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10467)) -- Change REST API and public profiles to not return follows/followers for users that have blocked you ([Gargron](https://github.com/mastodon/mastodon/pull/10491)) -- Change the groupings of menu items in settings navigation ([Gargron](https://github.com/mastodon/mastodon/pull/10533)) - -### Removed - -- Remove zopfli compression to speed up Webpack from 6min to 1min ([nolanlawson](https://github.com/mastodon/mastodon/pull/10288)) -- Remove stats.json generation to speed up Webpack ([nolanlawson](https://github.com/mastodon/mastodon/pull/10290)) - -### Fixed - -- Fix public timelines being broken by new toots when they are not mounted in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10131)) -- Fix quick filter settings not being saved when selecting a different filter in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10296)) -- Fix remote interaction dialogs being indexed by search engines ([Gargron](https://github.com/mastodon/mastodon/pull/10240)) -- Fix maxed-out invites not showing up as expired in UI ([Gargron](https://github.com/mastodon/mastodon/pull/10274)) -- Fix scrollbar styles on compose textarea ([Gargron](https://github.com/mastodon/mastodon/pull/10292)) -- Fix timeline merge workers being queued for remote users ([Gargron](https://github.com/mastodon/mastodon/pull/10355)) -- Fix alternative relay support regression ([Gargron](https://github.com/mastodon/mastodon/pull/10398)) -- Fix trying to fetch keys of unknown accounts on a self-delete from them ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10326)) -- Fix CAS `:service_validate_url` option ([enewhuis](https://github.com/mastodon/mastodon/pull/10328)) -- Fix race conditions when creating backups ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10234)) -- Fix whitespace not being stripped out of username before validation ([aurelien-reeves](https://github.com/mastodon/mastodon/pull/10239)) -- Fix n+1 query when deleting status ([Gargron](https://github.com/mastodon/mastodon/pull/10247)) -- Fix exiting follows not being rejected when suspending a remote account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10230)) -- Fix the underlying button element in a disabled icon button not being disabled ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10194)) -- Fix race condition when streaming out deleted statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10280)) -- Fix performance of admin federation UI by caching account counts ([Gargron](https://github.com/mastodon/mastodon/pull/10374)) -- Fix JS error on pages that don't define a CSRF token ([hinaloe](https://github.com/mastodon/mastodon/pull/10383)) -- Fix `tootctl accounts cull` sometimes removing accounts that are temporarily unreachable ([BenLubar](https://github.com/mastodon/mastodon/pull/10460)) - -## [2.7.4] - 2019-03-05 - -### Fixed - -- Fix web UI not cleaning up notifications after block ([Gargron](https://github.com/mastodon/mastodon/pull/10108)) -- Fix redundant HTTP requests when resolving private statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10115)) -- Fix performance of account media query ([abcang](https://github.com/mastodon/mastodon/pull/10121)) -- Fix mention processing for unknown accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10125)) -- Fix getting started column not scrolling on short screens ([trwnh](https://github.com/mastodon/mastodon/pull/10075)) -- Fix direct messages pagination in the web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10126)) -- Fix serialization of Announce activities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10129)) -- Fix home timeline perpetually reloading when empty in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/10130)) -- Fix lists export ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10136)) -- Fix edit profile page crash for suspended-then-unsuspended users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10178)) - -## [2.7.3] - 2019-02-23 - -### Added - -- Add domain filter to the admin federation page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10071)) -- Add quick link from admin account view to block/unblock instance ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10073)) - -### Fixed - -- Fix video player width not being updated to fit container width ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10069)) -- Fix domain filter being shown in admin page when local filter is active ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10074)) -- Fix crash when conversations have no valid participants ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10078)) -- Fix error when performing admin actions on no statuses ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10094)) - -### Changed - -- Change custom emojis to randomize stored file name ([hinaloe](https://github.com/mastodon/mastodon/pull/10090)) - -## [2.7.2] - 2019-02-17 - -### Added - -- Add support for IPv6 in e-mail validation ([zoc](https://github.com/mastodon/mastodon/pull/10009)) -- Add record of IP address used for signing up ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10026)) -- Add tight rate-limit for API deletions (30 per 30 minutes) ([Gargron](https://github.com/mastodon/mastodon/pull/10042)) -- Add support for embedded `Announce` objects attributed to the same actor ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9998), [Gargron](https://github.com/mastodon/mastodon/pull/10065)) -- Add spam filter for `Create` and `Announce` activities ([Gargron](https://github.com/mastodon/mastodon/pull/10005), [Gargron](https://github.com/mastodon/mastodon/pull/10041), [Gargron](https://github.com/mastodon/mastodon/pull/10062)) -- Add `registrations` attribute to `GET /api/v1/instance` ([Gargron](https://github.com/mastodon/mastodon/pull/10060)) -- Add `vapid_key` to `POST /api/v1/apps` and `GET /api/v1/apps/verify_credentials` ([Gargron](https://github.com/mastodon/mastodon/pull/10058)) - -### Fixed - -- Fix link color and add link underlines in high-contrast theme ([Gargron](https://github.com/mastodon/mastodon/pull/9949), [Gargron](https://github.com/mastodon/mastodon/pull/10028)) -- Fix unicode characters in URLs not being linkified ([JMendyk](https://github.com/mastodon/mastodon/pull/8447), [hinaloe](https://github.com/mastodon/mastodon/pull/9991)) -- Fix URLs linkifier grabbing ending quotation as part of the link ([Gargron](https://github.com/mastodon/mastodon/pull/9997)) -- Fix authorized applications page design ([rinsuki](https://github.com/mastodon/mastodon/pull/9969)) -- Fix custom emojis not showing up in share page emoji picker ([rinsuki](https://github.com/mastodon/mastodon/pull/9970)) -- Fix too liberal application of whitespace in toots ([trwnh](https://github.com/mastodon/mastodon/pull/9968)) -- Fix misleading e-mail hint being displayed in admin view ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9973)) -- Fix tombstones not being cleared out ([abcang](https://github.com/mastodon/mastodon/pull/9978)) -- Fix some timeline jumps ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9982), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/10001), [rinsuki](https://github.com/mastodon/mastodon/pull/10046)) -- Fix content warning input taking keyboard focus even when hidden ([hinaloe](https://github.com/mastodon/mastodon/pull/10017)) -- Fix hashtags select styling in default and high-contrast themes ([Gargron](https://github.com/mastodon/mastodon/pull/10029)) -- Fix style regressions on landing page ([Gargron](https://github.com/mastodon/mastodon/pull/10030)) -- Fix hashtag column not subscribing to stream on mount ([Gargron](https://github.com/mastodon/mastodon/pull/10040)) -- Fix relay enabling/disabling not resetting inbox availability status ([Gargron](https://github.com/mastodon/mastodon/pull/10048)) -- Fix mutes, blocks, domain blocks and follow requests not paginating ([Gargron](https://github.com/mastodon/mastodon/pull/10057)) -- Fix crash on public hashtag pages when streaming fails ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10061)) - -### Changed - -- Change icon for unlisted visibility level ([clarcharr](https://github.com/mastodon/mastodon/pull/9952)) -- Change queue of actor deletes from push to pull for non-follower recipients ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10016)) -- Change robots.txt to exclude media proxy URLs ([nightpool](https://github.com/mastodon/mastodon/pull/10038)) -- Change upload description input to allow line breaks ([BenLubar](https://github.com/mastodon/mastodon/pull/10036)) -- Change `dist/mastodon-streaming.service` to recommend running node without intermediary npm command ([nolanlawson](https://github.com/mastodon/mastodon/pull/10032)) -- Change conversations to always show names of other participants ([Gargron](https://github.com/mastodon/mastodon/pull/10047)) -- Change buttons on timeline preview to open the interaction dialog ([Gargron](https://github.com/mastodon/mastodon/pull/10054)) -- Change error graphic to hover-to-play ([Gargron](https://github.com/mastodon/mastodon/pull/10055)) - -## [2.7.1] - 2019-01-28 - -### Fixed - -- Fix SSO authentication not working due to missing agreement boolean ([Gargron](https://github.com/mastodon/mastodon/pull/9915)) -- Fix slow fallback of CopyAccountStats migration setting stats to 0 ([Gargron](https://github.com/mastodon/mastodon/pull/9930)) -- Fix wrong command in migration error message ([angristan](https://github.com/mastodon/mastodon/pull/9877)) -- Fix initial value of volume slider in video player and handle volume changes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9929)) -- Fix missing hotkeys for notifications ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9927)) -- Fix being able to attach unattached media created by other users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9921)) -- Fix unrescued SSL error during link verification ([renatolond](https://github.com/mastodon/mastodon/pull/9914)) -- Fix Firefox scrollbar color regression ([trwnh](https://github.com/mastodon/mastodon/pull/9908)) -- Fix scheduled status with media immediately creating a status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9894)) -- Fix missing strong style for landing page description ([Kjwon15](https://github.com/mastodon/mastodon/pull/9892)) - -## [2.7.0] - 2019-01-20 - -### Added - -- Add link for adding a user to a list from their profile ([namelessGonbai](https://github.com/mastodon/mastodon/pull/9062)) -- Add joining several hashtags in a single column ([gdpelican](https://github.com/mastodon/mastodon/pull/8904)) -- Add volume sliders for videos ([sumdog](https://github.com/mastodon/mastodon/pull/9366)) -- Add a tooltip explaining what a locked account is ([pawelngei](https://github.com/mastodon/mastodon/pull/9403)) -- Add preloaded cache for common JSON-LD contexts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9412)) -- Add profile directory ([Gargron](https://github.com/mastodon/mastodon/pull/9427)) -- Add setting to not group reblogs in home feed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9248)) -- Add admin ability to remove a user's header image ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9495)) -- Add account hashtags to ActivityPub actor JSON ([Gargron](https://github.com/mastodon/mastodon/pull/9450)) -- Add error message for avatar image that's too large ([sumdog](https://github.com/mastodon/mastodon/pull/9518)) -- Add notification quick-filter bar ([pawelngei](https://github.com/mastodon/mastodon/pull/9399)) -- Add new first-time tutorial ([Gargron](https://github.com/mastodon/mastodon/pull/9531)) -- Add moderation warnings ([Gargron](https://github.com/mastodon/mastodon/pull/9519)) -- Add emoji codepoint mappings for v11.0 ([Gargron](https://github.com/mastodon/mastodon/pull/9618)) -- Add REST API for creating an account ([Gargron](https://github.com/mastodon/mastodon/pull/9572)) -- Add support for Malayalam in language filter ([tachyons](https://github.com/mastodon/mastodon/pull/9624)) -- Add exclude_reblogs option to account statuses API ([Gargron](https://github.com/mastodon/mastodon/pull/9640)) -- Add local followers page to admin account UI ([chr-1x](https://github.com/mastodon/mastodon/pull/9610)) -- Add healthcheck commands to docker-compose.yml ([BenLubar](https://github.com/mastodon/mastodon/pull/9143)) -- Add handler for Move activity to migrate followers ([Gargron](https://github.com/mastodon/mastodon/pull/9629)) -- Add CSV export for lists and domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/9677)) -- Add `tootctl accounts follow ACCT` ([Gargron](https://github.com/mastodon/mastodon/pull/9414)) -- Add scheduled statuses ([Gargron](https://github.com/mastodon/mastodon/pull/9706)) -- Add immutable caching for S3 objects ([nolanlawson](https://github.com/mastodon/mastodon/pull/9722)) -- Add cache to custom emojis API ([Gargron](https://github.com/mastodon/mastodon/pull/9732)) -- Add preview cards to non-detailed statuses on public pages ([Gargron](https://github.com/mastodon/mastodon/pull/9714)) -- Add `mod` and `moderator` to list of default reserved usernames ([Gargron](https://github.com/mastodon/mastodon/pull/9713)) -- Add quick links to the admin interface in the web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8545)) -- Add `tootctl domains crawl` ([Gargron](https://github.com/mastodon/mastodon/pull/9809)) -- Add attachment list fallback to public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9780)) -- Add `tootctl --version` ([Gargron](https://github.com/mastodon/mastodon/pull/9835)) -- Add information about how to opt-in to the directory on the directory ([Gargron](https://github.com/mastodon/mastodon/pull/9834)) -- Add timeouts for S3 ([Gargron](https://github.com/mastodon/mastodon/pull/9842)) -- Add support for non-public reblogs from ActivityPub ([Gargron](https://github.com/mastodon/mastodon/pull/9841)) -- Add sending of `Reject` activity when sending a `Block` activity ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9811)) - -### Changed - -- Temporarily pause timeline if mouse moved recently ([lmorchard](https://github.com/mastodon/mastodon/pull/9200)) -- Change the password form order ([mayaeh](https://github.com/mastodon/mastodon/pull/9267)) -- Redesign admin UI for accounts ([Gargron](https://github.com/mastodon/mastodon/pull/9340), [Gargron](https://github.com/mastodon/mastodon/pull/9643)) -- Redesign admin UI for instances/domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/9645)) -- Swap avatar and header input fields in profile page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9271)) -- When posting in mobile mode, go back to previous history location ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9502)) -- Split out is_changing_upload from is_submitting ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9536)) -- Back to the getting-started when pins the timeline. ([kedamaDQ](https://github.com/mastodon/mastodon/pull/9561)) -- Allow unauthenticated REST API access to GET /api/v1/accounts/:id/statuses ([Gargron](https://github.com/mastodon/mastodon/pull/9573)) -- Limit maximum visibility of local silenced users to unlisted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9583)) -- Change API error message for unconfirmed accounts ([noellabo](https://github.com/mastodon/mastodon/pull/9625)) -- Change the icon to "reply-all" when it's a reply to other accounts ([mayaeh](https://github.com/mastodon/mastodon/pull/9378)) -- Do not ignore federated reports targeting already-reported accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9534)) -- Upgrade default Ruby version to 2.6.0 ([Gargron](https://github.com/mastodon/mastodon/pull/9688)) -- Change e-mail digest frequency ([Gargron](https://github.com/mastodon/mastodon/pull/9689)) -- Change Docker images for Tor support in docker-compose.yml ([Sir-Boops](https://github.com/mastodon/mastodon/pull/9438)) -- Display fallback link card thumbnail when none is given ([Gargron](https://github.com/mastodon/mastodon/pull/9715)) -- Change account bio length validation to ignore mention domains and URLs ([Gargron](https://github.com/mastodon/mastodon/pull/9717)) -- Use configured contact user for "anonymous" federation activities ([yukimochi](https://github.com/mastodon/mastodon/pull/9661)) -- Change remote interaction dialog to use specific actions instead of generic "interact" ([Gargron](https://github.com/mastodon/mastodon/pull/9743)) -- Always re-fetch public key when signature verification fails to support blind key rotation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9667)) -- Make replies to boosts impossible, connect reply to original status instead ([valerauko](https://github.com/mastodon/mastodon/pull/9129)) -- Change e-mail MX validation to check both A and MX records against blacklist ([Gargron](https://github.com/mastodon/mastodon/pull/9489)) -- Hide floating action button on search and getting started pages ([tmm576](https://github.com/mastodon/mastodon/pull/9826)) -- Redesign public hashtag page to use a masonry layout ([Gargron](https://github.com/mastodon/mastodon/pull/9822)) -- Use `summary` as summary instead of content warning for converted ActivityPub objects ([Gargron](https://github.com/mastodon/mastodon/pull/9823)) -- Display a double reply arrow on public pages for toots that are replies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9808)) -- Change admin UI right panel size to be wider ([Kjwon15](https://github.com/mastodon/mastodon/pull/9768)) - -### Removed - -- Remove links to bridge.joinmastodon.org (non-functional) ([Gargron](https://github.com/mastodon/mastodon/pull/9608)) -- Remove LD-Signatures from activities that do not need them ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9659)) - -### Fixed - -- Remove unused computation of reblog references from updateTimeline ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9244)) -- Fix loaded embeds resetting if a status arrives from API again ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9270)) -- Fix race condition causing shallow status with only a "favourited" attribute ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9272)) -- Remove intermediary arrays when creating hash maps from results ([Gargron](https://github.com/mastodon/mastodon/pull/9291)) -- Extract counters from accounts table to account_stats table to improve performance ([Gargron](https://github.com/mastodon/mastodon/pull/9295)) -- Change identities id column to a bigint ([Gargron](https://github.com/mastodon/mastodon/pull/9371)) -- Fix conversations API pagination ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9407)) -- Improve account suspension speed and completeness ([Gargron](https://github.com/mastodon/mastodon/pull/9290)) -- Fix thread depth computation in statuses_controller ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9426)) -- Fix database deadlocks by moving account stats update outside transaction ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9437)) -- Escape HTML in profile name preview in profile settings ([pawelngei](https://github.com/mastodon/mastodon/pull/9446)) -- Use same CORS policy for /@:username and /users/:username ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9485)) -- Make custom emoji domains case insensitive ([Esteth](https://github.com/mastodon/mastodon/pull/9474)) -- Various fixes to scrollable lists and media gallery ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9501)) -- Fix bootsnap cache directory being declared relatively ([Gargron](https://github.com/mastodon/mastodon/pull/9511)) -- Fix timeline pagination in the web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9516)) -- Fix padding on dropdown elements in preferences ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9517)) -- Make avatar and headers respect GIF autoplay settings ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9515)) -- Do no retry Web Push workers if the server returns a 4xx response ([Gargron](https://github.com/mastodon/mastodon/pull/9434)) -- Minor scrollable list fixes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9551)) -- Ignore low-confidence CharlockHolmes guesses when parsing link cards ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9510)) -- Fix `tootctl accounts rotate` not updating public keys ([Gargron](https://github.com/mastodon/mastodon/pull/9556)) -- Fix CSP / X-Frame-Options for media players ([jomo](https://github.com/mastodon/mastodon/pull/9558)) -- Fix unnecessary loadMore calls when the end of a timeline has been reached ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9581)) -- Skip mailer job retries when a record no longer exists ([Gargron](https://github.com/mastodon/mastodon/pull/9590)) -- Fix composer not getting focus after reply confirmation dialog ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9602)) -- Fix signature verification stoplight triggering on non-timeout errors ([Gargron](https://github.com/mastodon/mastodon/pull/9617)) -- Fix ThreadResolveWorker getting queued with invalid URLs ([Gargron](https://github.com/mastodon/mastodon/pull/9628)) -- Fix crash when clearing uninitialized timeline ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9662)) -- Avoid duplicate work by merging ReplyDistributionWorker into DistributionWorker ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9660)) -- Skip full text search if it fails, instead of erroring out completely ([Kjwon15](https://github.com/mastodon/mastodon/pull/9654)) -- Fix profile metadata links not verifying correctly sometimes ([shrft](https://github.com/mastodon/mastodon/pull/9673)) -- Ensure blocked user unfollows blocker if Block/Undo-Block activities are processed out of order ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9687)) -- Fix unreadable text color in report modal for some statuses ([Gargron](https://github.com/mastodon/mastodon/pull/9716)) -- Stop GIFV timeline preview explicitly when it's opened in modal ([kedamaDQ](https://github.com/mastodon/mastodon/pull/9749)) -- Fix scrollbar width compensation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9824)) -- Fix race conditions when processing deleted toots ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9815)) -- Fix SSO issues on WebKit browsers by disabling Same-Site cookie again ([moritzheiber](https://github.com/mastodon/mastodon/pull/9819)) -- Fix empty OEmbed error ([renatolond](https://github.com/mastodon/mastodon/pull/9807)) -- Fix drag & drop modal not disappearing sometimes ([hinaloe](https://github.com/mastodon/mastodon/pull/9797)) -- Fix statuses with content warnings being displayed in web push notifications sometimes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9778)) -- Fix scroll-to-detailed status not working on public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9773)) -- Fix media modal loading indicator ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9771)) -- Fix hashtag search results not having a permalink fallback in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9810)) -- Fix slightly cropped font on settings page dropdowns when using system font ([ariasuni](https://github.com/mastodon/mastodon/pull/9839)) -- Fix not being able to drag & drop text into forms ([tmm576](https://github.com/mastodon/mastodon/pull/9840)) - -### Security - -- Sanitize and sandbox toot embeds in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9552)) -- Add tombstones for remote statuses to prevent replay attacks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9830)) - -## [2.6.5] - 2018-12-01 - -### Changed - -- Change lists to display replies to others on the list and list owner ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9324)) - -### Fixed - -- Fix failures caused by commonly-used JSON-LD contexts being unavailable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9412)) - -## [2.6.4] - 2018-11-30 - -### Fixed - -- Fix yarn dependencies not installing due to yanked event-stream package ([Gargron](https://github.com/mastodon/mastodon/pull/9401)) - -## [2.6.3] - 2018-11-30 - -### Added - -- Add hyphen to characters allowed in remote usernames ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9345)) - -### Changed - -- Change server user count to exclude suspended accounts ([Gargron](https://github.com/mastodon/mastodon/pull/9380)) - -### Fixed - -- Fix ffmpeg processing sometimes stalling due to overfilled stdout buffer ([hugogameiro](https://github.com/mastodon/mastodon/pull/9368)) -- Fix missing DNS records raising the wrong kind of exception ([Gargron](https://github.com/mastodon/mastodon/pull/9379)) -- Fix already queued deliveries still trying to reach inboxes marked as unavailable ([Gargron](https://github.com/mastodon/mastodon/pull/9358)) - -### Security - -- Fix TLS handshake timeout not being enforced ([Gargron](https://github.com/mastodon/mastodon/pull/9381)) - -## [2.6.2] - 2018-11-23 - -### Added - -- Add Page to whitelisted ActivityPub types ([mbajur](https://github.com/mastodon/mastodon/pull/9188)) -- Add 20px to column width in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/9227)) -- Add amount of freed disk space in `tootctl media remove` ([Gargron](https://github.com/mastodon/mastodon/pull/9229), [Gargron](https://github.com/mastodon/mastodon/pull/9239), [mayaeh](https://github.com/mastodon/mastodon/pull/9288)) -- Add "Show thread" link to self-replies ([Gargron](https://github.com/mastodon/mastodon/pull/9228)) - -### Changed - -- Change order of Atom and RSS links so Atom is first ([Alkarex](https://github.com/mastodon/mastodon/pull/9302)) -- Change Nginx configuration for Nanobox apps ([danhunsaker](https://github.com/mastodon/mastodon/pull/9310)) -- Change the follow action to appear instant in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/9220)) -- Change how the ActiveRecord connection is instantiated in on_worker_boot ([Gargron](https://github.com/mastodon/mastodon/pull/9238)) -- Change `tootctl accounts cull` to always touch accounts so they can be skipped ([renatolond](https://github.com/mastodon/mastodon/pull/9293)) -- Change mime type comparison to ignore JSON-LD profile ([valerauko](https://github.com/mastodon/mastodon/pull/9179)) - -### Fixed - -- Fix web UI crash when conversation has no last status ([sammy8806](https://github.com/mastodon/mastodon/pull/9207)) -- Fix follow limit validator reporting lower number past threshold ([Gargron](https://github.com/mastodon/mastodon/pull/9230)) -- Fix form validation flash message color and input borders ([Gargron](https://github.com/mastodon/mastodon/pull/9235)) -- Fix invalid twitter:player cards being displayed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9254)) -- Fix emoji update date being processed incorrectly ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9255)) -- Fix playing embed resetting if status is reloaded in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9270), [Gargron](https://github.com/mastodon/mastodon/pull/9275)) -- Fix web UI crash when favouriting a deleted status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9272)) -- Fix intermediary arrays being created for hash maps ([Gargron](https://github.com/mastodon/mastodon/pull/9291)) -- Fix filter ID not being a string in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/9303)) - -### Security - -- Fix multiple remote account deletions being able to deadlock the database ([Gargron](https://github.com/mastodon/mastodon/pull/9292)) -- Fix HTTP connection timeout of 10s not being enforced ([Gargron](https://github.com/mastodon/mastodon/pull/9329)) - -## [2.6.1] - 2018-10-30 - -### Fixed - -- Fix resolving resources by URL not working due to a regression in [valerauko](https://github.com/mastodon/mastodon/pull/9132) ([Gargron](https://github.com/mastodon/mastodon/pull/9171)) -- Fix reducer error in web UI when a conversation has no last status ([Gargron](https://github.com/mastodon/mastodon/pull/9173)) - -## [2.6.0] - 2018-10-30 - -### Added - -- Add link ownership verification ([Gargron](https://github.com/mastodon/mastodon/pull/8703)) -- Add conversations API ([Gargron](https://github.com/mastodon/mastodon/pull/8832)) -- Add limit for the number of people that can be followed from one account ([Gargron](https://github.com/mastodon/mastodon/pull/8807)) -- Add admin setting to customize mascot ([ashleyhull-versent](https://github.com/mastodon/mastodon/pull/8766)) -- Add support for more granular ActivityPub audiences from other software, i.e. circles ([Gargron](https://github.com/mastodon/mastodon/pull/8950), [Gargron](https://github.com/mastodon/mastodon/pull/9093), [Gargron](https://github.com/mastodon/mastodon/pull/9150)) -- Add option to block all reports from a domain ([Gargron](https://github.com/mastodon/mastodon/pull/8830)) -- Add user preference to always expand toots marked with content warnings ([webroo](https://github.com/mastodon/mastodon/pull/8762)) -- Add user preference to always hide all media ([fvh-P](https://github.com/mastodon/mastodon/pull/8569)) -- Add `force_login` param to OAuth authorize page ([Gargron](https://github.com/mastodon/mastodon/pull/8655)) -- Add `tootctl accounts backup` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl accounts create` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl accounts cull` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl accounts delete` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl accounts modify` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl accounts refresh` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl feeds build` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl feeds clear` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl settings registrations open` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `tootctl settings registrations close` ([Gargron](https://github.com/mastodon/mastodon/pull/8642), [Gargron](https://github.com/mastodon/mastodon/pull/8811)) -- Add `min_id` param to REST API to support backwards pagination ([Gargron](https://github.com/mastodon/mastodon/pull/8736)) -- Add a confirmation dialog when hitting reply and the compose box isn't empty ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8893)) -- Add PostgreSQL disk space growth tracking in PGHero ([Gargron](https://github.com/mastodon/mastodon/pull/8906)) -- Add button for disabling local account to report quick actions bar ([Gargron](https://github.com/mastodon/mastodon/pull/9024)) -- Add Czech language ([Aditoo17](https://github.com/mastodon/mastodon/pull/8594)) -- Add `same-site` (`lax`) attribute to cookies ([sorin-davidoi](https://github.com/mastodon/mastodon/pull/8626)) -- Add support for styled scrollbars in Firefox Nightly ([sorin-davidoi](https://github.com/mastodon/mastodon/pull/8653)) -- Add highlight to the active tab in web UI profiles ([rhoio](https://github.com/mastodon/mastodon/pull/8673)) -- Add auto-focus for comment textarea in report modal ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8689)) -- Add auto-focus for emoji picker's search field ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8688)) -- Add nginx and systemd templates to `dist/` directory ([Gargron](https://github.com/mastodon/mastodon/pull/8770)) -- Add support for `/.well-known/change-password` ([Gargron](https://github.com/mastodon/mastodon/pull/8828)) -- Add option to override FFMPEG binary path ([sascha-sl](https://github.com/mastodon/mastodon/pull/8855)) -- Add `dns-prefetch` tag when using different host for assets or uploads ([Gargron](https://github.com/mastodon/mastodon/pull/8942)) -- Add `description` meta tag ([Gargron](https://github.com/mastodon/mastodon/pull/8941)) -- Add `Content-Security-Policy` header ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8957)) -- Add cache for the instance info API ([ykzts](https://github.com/mastodon/mastodon/pull/8765)) -- Add suggested follows to search screen in mobile layout ([Gargron](https://github.com/mastodon/mastodon/pull/9010)) -- Add CORS header to `/.well-known/*` routes ([BenLubar](https://github.com/mastodon/mastodon/pull/9083)) -- Add `card` attribute to statuses returned from REST API ([Gargron](https://github.com/mastodon/mastodon/pull/9120)) -- Add in-stream link preview ([Gargron](https://github.com/mastodon/mastodon/pull/9120)) -- Add support for ActivityPub `Page` objects ([mbajur](https://github.com/mastodon/mastodon/pull/9121)) - -### Changed - -- Change forms design ([Gargron](https://github.com/mastodon/mastodon/pull/8703)) -- Change reports overview to group by target account ([Gargron](https://github.com/mastodon/mastodon/pull/8674)) -- Change web UI to show "read more" link on overly long in-stream statuses ([lanodan](https://github.com/mastodon/mastodon/pull/8205)) -- Change design of direct messages column ([Gargron](https://github.com/mastodon/mastodon/pull/8832), [Gargron](https://github.com/mastodon/mastodon/pull/9022)) -- Change home timelines to exclude DMs ([Gargron](https://github.com/mastodon/mastodon/pull/8940)) -- Change list timelines to exclude all replies ([cbayerlein](https://github.com/mastodon/mastodon/pull/8683)) -- Change admin accounts UI default sort to most recent ([Gargron](https://github.com/mastodon/mastodon/pull/8813)) -- Change documentation URL in the UI ([Gargron](https://github.com/mastodon/mastodon/pull/8898)) -- Change style of success and failure messages ([Gargron](https://github.com/mastodon/mastodon/pull/8973)) -- Change DM filtering to always allow DMs from staff ([qguv](https://github.com/mastodon/mastodon/pull/8993)) -- Change recommended Ruby version to 2.5.3 ([zunda](https://github.com/mastodon/mastodon/pull/9003)) -- Change docker-compose default to persist volumes in current directory ([Gargron](https://github.com/mastodon/mastodon/pull/9055)) -- Change character counters on edit profile page to input length limit ([Gargron](https://github.com/mastodon/mastodon/pull/9100)) -- Change notification filtering to always let through messages from staff ([Gargron](https://github.com/mastodon/mastodon/pull/9152)) -- Change "hide boosts from user" function also hiding notifications about boosts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9147)) -- Change CSS `detailed-status__wrapper` class actually wrap the detailed status ([trwnh](https://github.com/mastodon/mastodon/pull/8547)) - -### Deprecated - -- `GET /api/v1/timelines/direct` → `GET /api/v1/conversations` ([Gargron](https://github.com/mastodon/mastodon/pull/8832)) -- `POST /api/v1/notifications/dismiss` → `POST /api/v1/notifications/:id/dismiss` ([Gargron](https://github.com/mastodon/mastodon/pull/8905)) -- `GET /api/v1/statuses/:id/card` → `card` attributed included in status ([Gargron](https://github.com/mastodon/mastodon/pull/9120)) - -### Removed - -- Remove "on this device" label in column push settings ([rhoio](https://github.com/mastodon/mastodon/pull/8704)) -- Remove rake tasks in favour of tootctl commands ([Gargron](https://github.com/mastodon/mastodon/pull/8675)) - -### Fixed - -- Fix remote statuses using instance's default locale if no language given ([Kjwon15](https://github.com/mastodon/mastodon/pull/8861)) -- Fix streaming API not exiting when port or socket is unavailable ([Gargron](https://github.com/mastodon/mastodon/pull/9023)) -- Fix network calls being performed in database transaction in ActivityPub handler ([Gargron](https://github.com/mastodon/mastodon/pull/8951)) -- Fix dropdown arrow position ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8637)) -- Fix first element of dropdowns being focused even if not using keyboard ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8679)) -- Fix tootctl requiring `bundle exec` invocation ([abcang](https://github.com/mastodon/mastodon/pull/8619)) -- Fix public pages not using animation preference for avatars ([renatolond](https://github.com/mastodon/mastodon/pull/8614)) -- Fix OEmbed/OpenGraph cards not understanding relative URLs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8669)) -- Fix some dark emojis not having a white outline ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8597)) -- Fix media description not being displayed in various media modals ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8678)) -- Fix generated URLs of desktop notifications missing base URL ([GenbuHase](https://github.com/mastodon/mastodon/pull/8758)) -- Fix RTL styles ([mabkenar](https://github.com/mastodon/mastodon/pull/8764), [mabkenar](https://github.com/mastodon/mastodon/pull/8767), [mabkenar](https://github.com/mastodon/mastodon/pull/8823), [mabkenar](https://github.com/mastodon/mastodon/pull/8897), [mabkenar](https://github.com/mastodon/mastodon/pull/9005), [mabkenar](https://github.com/mastodon/mastodon/pull/9007), [mabkenar](https://github.com/mastodon/mastodon/pull/9018), [mabkenar](https://github.com/mastodon/mastodon/pull/9021), [mabkenar](https://github.com/mastodon/mastodon/pull/9145), [mabkenar](https://github.com/mastodon/mastodon/pull/9146)) -- Fix crash in streaming API when tag param missing ([Gargron](https://github.com/mastodon/mastodon/pull/8955)) -- Fix hotkeys not working when no element is focused ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8998)) -- Fix some hotkeys not working on detailed status view ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9006)) -- Fix og:url on status pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9047)) -- Fix upload option buttons only being visible on hover ([Gargron](https://github.com/mastodon/mastodon/pull/9074)) -- Fix tootctl not returning exit code 1 on wrong arguments ([sascha-sl](https://github.com/mastodon/mastodon/pull/9094)) -- Fix preview cards for appearing for profiles mentioned in toot ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/6934), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/9158)) -- Fix local accounts sometimes being duplicated as faux-remote ([Gargron](https://github.com/mastodon/mastodon/pull/9109)) -- Fix emoji search when the shortcode has multiple separators ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9124)) -- Fix dropdowns sometimes being partially obscured by other elements ([kedamaDQ](https://github.com/mastodon/mastodon/pull/9126)) -- Fix cache not updating when reply/boost/favourite counters or media sensitivity update ([Gargron](https://github.com/mastodon/mastodon/pull/9119)) -- Fix empty display name precedence over username in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/9163)) -- Fix td instead of th in sessions table header ([Gargron](https://github.com/mastodon/mastodon/pull/9162)) -- Fix handling of content types with profile ([valerauko](https://github.com/mastodon/mastodon/pull/9132)) - -## [2.5.2] - 2018-10-12 - -### Security - -- Fix XSS vulnerability ([Gargron](https://github.com/mastodon/mastodon/pull/8959)) - -## [2.5.1] - 2018-10-07 - -### Fixed - -- Fix database migrations for PostgreSQL below 9.5 ([Gargron](https://github.com/mastodon/mastodon/pull/8903)) -- Fix class autoloading issue in ActivityPub Create handler ([Gargron](https://github.com/mastodon/mastodon/pull/8820)) -- Fix cache statistics not being sent via statsd when statsd enabled ([ykzts](https://github.com/mastodon/mastodon/pull/8831)) -- Bump puma from 3.11.4 to 3.12.0 ([dependabot[bot]](https://github.com/mastodon/mastodon/pull/8883)) - -### Security - -- Fix some local images not having their EXIF metadata stripped on upload ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8714)) -- Fix being able to enable a disabled relay via ActivityPub Accept handler ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8864)) -- Bump nokogiri from 1.8.4 to 1.8.5 ([dependabot[bot]](https://github.com/mastodon/mastodon/pull/8881)) -- Fix being able to report statuses not belonging to the reported account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/8916)) +_For previous changes, review the [stable-3.5 branch](https://github.com/mastodon/mastodon/blob/stable-3.5/CHANGELOG.md)_ diff --git a/Dockerfile b/Dockerfile index 049f95e768..dfe21b59fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN --mount=type=cache,id=apt,target=/var/cache/apt,sharing=private \ libpq-dev \ libreadline8 \ libssl-dev \ - libyaml-0-2 \ + libyaml-dev \ python3 \ shared-mime-info \ zlib1g-dev diff --git a/Gemfile b/Gemfile index 5b275ef630..e2c849f2b8 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' ruby '>= 3.0.0' gem 'puma', '~> 6.3' -gem 'rails', '~> 7.0' +gem 'rails', '~> 7.1.1' gem 'sprockets', '~> 3.7.2' gem 'thor', '~> 1.2' gem 'rack', '~> 2.2.7' diff --git a/Gemfile.lock b/Gemfile.lock index ecde34d537..f537a5b479 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,75 +39,83 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + actioncable (7.1.1) + actionpack (= 7.1.1) + activesupport (= 7.1.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + zeitwerk (~> 2.6) + actionmailbox (7.1.1) + actionpack (= 7.1.1) + activejob (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8) - actionpack (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activesupport (= 7.0.8) + actionmailer (7.1.1) + actionpack (= 7.1.1) + actionview (= 7.1.1) + activejob (= 7.1.1) + activesupport (= 7.1.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8) - actionview (= 7.0.8) - activesupport (= 7.0.8) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.1) + actionview (= 7.1.1) + activesupport (= 7.1.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8) - actionpack (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.1) + actionpack (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8) - activesupport (= 7.0.8) + actionview (7.1.1) + activesupport (= 7.1.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) active_model_serializers (0.10.14) actionpack (>= 4.1) activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.8) - activesupport (= 7.0.8) + activejob (7.1.1) + activesupport (= 7.1.1) globalid (>= 0.3.6) - activemodel (7.0.8) - activesupport (= 7.0.8) - activerecord (7.0.8) - activemodel (= 7.0.8) - activesupport (= 7.0.8) - activestorage (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activesupport (= 7.0.8) + activemodel (7.1.1) + activesupport (= 7.1.1) + activerecord (7.1.1) + activemodel (= 7.1.1) + activesupport (= 7.1.1) + timeout (>= 0.4.0) + activestorage (7.1.1) + actionpack (= 7.1.1) + activejob (= 7.1.1) + activerecord (= 7.1.1) + activesupport (= 7.1.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8) + activesupport (7.1.1) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) @@ -158,6 +166,7 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties + bigdecimal (3.1.4) bindata (2.4.15) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) @@ -237,6 +246,8 @@ GEM dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) + drb (2.1.1) + ruby2_keywords ed25519 (1.3.0) elasticsearch (7.13.3) elasticsearch-api (= 7.13.3) @@ -306,8 +317,8 @@ GEM fuubar (2.5.1) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) haml (6.2.0) temple (>= 0.8.2) thor @@ -358,7 +369,11 @@ GEM rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) idn-ruby (0.1.5) + io-console (0.6.0) ipaddress (0.8.3) + irb (1.8.1) + rdoc + reline (>= 0.3.8) jmespath (1.6.2) json (2.6.3) json-canonicalization (0.3.2) @@ -435,7 +450,6 @@ GEM azure-storage-blob (~> 2.0.1) hashie (~> 5.0) memory_profiler (1.0.1) - method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.0808) @@ -445,11 +459,12 @@ GEM msgpack (1.7.1) multi_json (1.15.0) multipart-post (2.3.0) + mutex_m (0.1.2) net-http (0.3.2) uri net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.3.7) + net-imap (0.4.1) date net-protocol net-ldap (0.18.0) @@ -457,7 +472,7 @@ GEM net-protocol net-protocol (0.2.1) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol nio4r (2.5.9) nokogiri (1.15.4) @@ -513,6 +528,8 @@ GEM net-smtp premailer (~> 1.7, >= 1.7.9) private_address_check (0.5.0) + psych (5.1.1) + stringio public_suffix (5.0.3) puma (6.4.0) nio4r (~> 2.0) @@ -535,22 +552,27 @@ GEM rack rack-proxy (0.7.6) rack + rack-session (1.0.1) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8) - actioncable (= 7.0.8) - actionmailbox (= 7.0.8) - actionmailer (= 7.0.8) - actionpack (= 7.0.8) - actiontext (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activemodel (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.1) + actioncable (= 7.1.1) + actionmailbox (= 7.1.1) + actionmailer (= 7.1.1) + actionpack (= 7.1.1) + actiontext (= 7.1.1) + actionview (= 7.1.1) + activejob (= 7.1.1) + activemodel (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) bundler (>= 1.15.0) - railties (= 7.0.8) + railties (= 7.1.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -565,19 +587,22 @@ GEM rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) - method_source + railties (7.1.1) + actionpack (= 7.1.1) + activesupport (= 7.1.1) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) rdf (3.2.11) link_header (~> 0.0, >= 0.0.8) rdf-normalize (0.6.1) rdf (~> 3.2) + rdoc (6.5.0) + psych (>= 4.0.0) redcarpet (3.6.0) redis (4.8.1) redis-namespace (1.11.0) @@ -585,13 +610,15 @@ GEM redlock (1.3.2) redis (>= 3.0.0, < 6.0) regexp_parser (2.8.2) + reline (0.3.9) + io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) rexml (3.2.6) - rotp (6.2.2) + rotp (6.3.0) rouge (4.1.2) rpam2 (4.0.2) rqrcode (2.2.0) @@ -713,6 +740,7 @@ GEM statsd-ruby (1.5.0) stoplight (3.0.2) redlock (~> 1.0) + stringio (3.0.8) strong_migrations (0.8.0) activerecord (>= 5.2) swd (1.3.0) @@ -784,6 +812,7 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) + webrick (1.8.1) websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) @@ -880,7 +909,7 @@ DEPENDENCIES rack-attack (~> 6.6) rack-cors (~> 2.0) rack-test (~> 2.1) - rails (~> 7.0) + rails (~> 7.1.1) rails-controller-testing (~> 1.0) rails-i18n (~> 7.0) rails-settings-cached (~> 0.6)! @@ -931,4 +960,4 @@ RUBY VERSION ruby 3.2.2p53 BUNDLED WITH - 2.4.13 + 2.4.20 diff --git a/app/controllers/admin/instances_controller.rb b/app/controllers/admin/instances_controller.rb index e5a55de06d..a6997b62f7 100644 --- a/app/controllers/admin/instances_controller.rb +++ b/app/controllers/admin/instances_controller.rb @@ -49,7 +49,7 @@ module Admin private def set_instance - @instance = Instance.find(TagManager.instance.normalize_domain(params[:id]&.strip)) + @instance = Instance.find_or_initialize_by(domain: TagManager.instance.normalize_domain(params[:id]&.strip)) end def set_instances diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4d7805abad..bc876d1504 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -13,6 +13,7 @@ class ApplicationController < ActionController::Base include ThemingConcern include DatabaseHelper include AuthorizedFetchHelper + include SelfDestructHelper helper_method :current_account helper_method :current_session @@ -41,6 +42,8 @@ class ApplicationController < ActionController::Base service_unavailable end + before_action :check_self_destruct! + before_action :store_referrer, except: :raise_not_found, if: :devise_controller? before_action :require_functional!, if: :user_signed_in? @@ -169,6 +172,15 @@ class ApplicationController < ActionController::Base end end + def check_self_destruct! + return unless self_destruct? + + respond_to do |format| + format.any { render 'errors/self_destruct', layout: 'auth', status: 410, formats: [:html] } + format.json { render json: { error: Rack::Utils::HTTP_STATUS_CODES[410] }, status: code } + end + end + def set_cache_control_defaults response.cache_control.replace(private: true, no_store: true) end diff --git a/app/controllers/auth/challenges_controller.rb b/app/controllers/auth/challenges_controller.rb index 41827b21c1..1e585de189 100644 --- a/app/controllers/auth/challenges_controller.rb +++ b/app/controllers/auth/challenges_controller.rb @@ -8,6 +8,7 @@ class Auth::ChallengesController < ApplicationController before_action :set_pack before_action :authenticate_user! + skip_before_action :check_self_destruct! skip_before_action :require_functional! def create diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index 3283c5f362..544d99cc38 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -13,6 +13,7 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController before_action :extend_csp_for_captcha!, only: [:show, :confirm_captcha] before_action :require_captcha_if_needed!, only: [:show] + skip_before_action :check_self_destruct! skip_before_action :require_functional! def show diff --git a/app/controllers/auth/omniauth_callbacks_controller.rb b/app/controllers/auth/omniauth_callbacks_controller.rb index 4723806b92..707b50ef9e 100644 --- a/app/controllers/auth/omniauth_callbacks_controller.rb +++ b/app/controllers/auth/omniauth_callbacks_controller.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController + skip_before_action :check_self_destruct! skip_before_action :verify_authenticity_token def self.provides_callback_for(provider) diff --git a/app/controllers/auth/passwords_controller.rb b/app/controllers/auth/passwords_controller.rb index 576c3e7bcf..0c572d3b19 100644 --- a/app/controllers/auth/passwords_controller.rb +++ b/app/controllers/auth/passwords_controller.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class Auth::PasswordsController < Devise::PasswordsController + skip_before_action :check_self_destruct! before_action :check_validity_of_reset_password_token, only: :edit before_action :set_pack before_action :set_body_classes diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index 629d35cde2..1faa7099d8 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -18,6 +18,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController before_action :require_rules_acceptance!, only: :new before_action :set_registration_form_time, only: :new + skip_before_action :check_self_destruct!, only: [:edit, :update] skip_before_action :require_functional!, only: [:edit, :update] def new diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index 01758d1a3a..e387329cf5 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -3,6 +3,7 @@ class Auth::SessionsController < Devise::SessionsController layout 'auth' + skip_before_action :check_self_destruct! skip_before_action :require_no_authentication, only: [:create] skip_before_action :require_functional! skip_before_action :update_user_sign_in diff --git a/app/controllers/backups_controller.rb b/app/controllers/backups_controller.rb index db23fefbbc..5df1af5f2f 100644 --- a/app/controllers/backups_controller.rb +++ b/app/controllers/backups_controller.rb @@ -3,6 +3,7 @@ class BackupsController < ApplicationController include RoutingHelper + skip_before_action :check_self_destruct! skip_before_action :require_functional! before_action :authenticate_user! diff --git a/app/controllers/concerns/export_controller_concern.rb b/app/controllers/concerns/export_controller_concern.rb index 24cfc7a012..e1792fd6bf 100644 --- a/app/controllers/concerns/export_controller_concern.rb +++ b/app/controllers/concerns/export_controller_concern.rb @@ -7,6 +7,7 @@ module ExportControllerConcern before_action :authenticate_user! before_action :load_export + skip_before_action :check_self_destruct! skip_before_action :require_functional! end diff --git a/app/controllers/settings/exports_controller.rb b/app/controllers/settings/exports_controller.rb index 46a340aeb3..076ed5dadb 100644 --- a/app/controllers/settings/exports_controller.rb +++ b/app/controllers/settings/exports_controller.rb @@ -5,6 +5,7 @@ class Settings::ExportsController < Settings::BaseController include Redisable include Lockable + skip_before_action :check_self_destruct! skip_before_action :require_functional! def show diff --git a/app/controllers/settings/login_activities_controller.rb b/app/controllers/settings/login_activities_controller.rb index ee77524b13..018fc7e950 100644 --- a/app/controllers/settings/login_activities_controller.rb +++ b/app/controllers/settings/login_activities_controller.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true class Settings::LoginActivitiesController < Settings::BaseController + skip_before_action :check_self_destruct! + skip_before_action :require_functional! + def index @login_activities = LoginActivity.where(user: current_user).order(id: :desc).page(params[:page]) end diff --git a/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb b/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb index 3f9e713572..0128509dea 100644 --- a/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb +++ b/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb @@ -3,6 +3,7 @@ module Settings module TwoFactorAuthentication class WebauthnCredentialsController < BaseController + skip_before_action :check_self_destruct! skip_before_action :require_functional! before_action :require_otp_enabled diff --git a/app/controllers/settings/two_factor_authentication_methods_controller.rb b/app/controllers/settings/two_factor_authentication_methods_controller.rb index 205933ea81..a6d5c1fe2d 100644 --- a/app/controllers/settings/two_factor_authentication_methods_controller.rb +++ b/app/controllers/settings/two_factor_authentication_methods_controller.rb @@ -4,6 +4,7 @@ module Settings class TwoFactorAuthenticationMethodsController < BaseController include ChallengableConcern + skip_before_action :check_self_destruct! skip_before_action :require_functional! before_action :require_challenge!, only: :disable diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb index e007417fbb..ede95735f7 100644 --- a/app/helpers/formatting_helper.rb +++ b/app/helpers/formatting_helper.rb @@ -9,6 +9,10 @@ module FormattingHelper TextFormatter.new(text, options).to_s end + def url_for_preview_card(preview_card) + preview_card.url + end + def extract_status_plain_text(status) PlainTextFormatter.new(status.text, status.local?).to_s end diff --git a/app/helpers/self_destruct_helper.rb b/app/helpers/self_destruct_helper.rb new file mode 100644 index 0000000000..78557c25e5 --- /dev/null +++ b/app/helpers/self_destruct_helper.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module SelfDestructHelper + def self.self_destruct? + value = ENV.fetch('SELF_DESTRUCT', nil) + value.present? && Rails.application.message_verifier('self-destruct').verify(value) == ENV['LOCAL_DOMAIN'] + rescue ActiveSupport::MessageVerifier::InvalidSignature + false + end + + def self_destruct? + SelfDestructHelper.self_destruct? + end +end diff --git a/app/javascript/__mocks__/svg.js b/app/javascript/__mocks__/svg.js new file mode 100644 index 0000000000..e725dc2da6 --- /dev/null +++ b/app/javascript/__mocks__/svg.js @@ -0,0 +1,3 @@ +// eslint-disable-next-line import/no-anonymous-default-export +export default 'SvgrURL'; +export const ReactComponent = 'div'; diff --git a/app/javascript/core/admin.js b/app/javascript/core/admin.js index 97b2f4e309..d256d7ec9d 100644 --- a/app/javascript/core/admin.js +++ b/app/javascript/core/admin.js @@ -1,7 +1,7 @@ // This file will be loaded on admin pages, regardless of theme. import 'packs/public-path'; -import { delegate } from '@rails/ujs'; +import Rails from '@rails/ujs'; import ready from '../mastodon/ready'; @@ -19,7 +19,7 @@ const setAnnouncementEndsAttributes = (target) => { } }; -delegate(document, 'input[type="datetime-local"]#announcement_starts_at', 'change', ({ target }) => { +Rails.delegate(document, 'input[type="datetime-local"]#announcement_starts_at', 'change', ({ target }) => { setAnnouncementEndsAttributes(target); }); @@ -42,7 +42,7 @@ const hideSelectAll = () => { hiddenField.value = '0'; }; -delegate(document, '#batch_checkbox_all', 'change', ({ target }) => { +Rails.delegate(document, '#batch_checkbox_all', 'change', ({ target }) => { const selectAllMatchingElement = document.querySelector('.batch-table__select-all'); [].forEach.call(document.querySelectorAll(batchCheckboxClassName), (content) => { @@ -58,7 +58,7 @@ delegate(document, '#batch_checkbox_all', 'change', ({ target }) => { } }); -delegate(document, '.batch-table__select-all button', 'click', () => { +Rails.delegate(document, '.batch-table__select-all button', 'click', () => { const hiddenField = document.querySelector('#select_all_matching'); const active = hiddenField.value === '1'; const selectedMsg = document.querySelector('.batch-table__select-all .selected'); @@ -75,7 +75,7 @@ delegate(document, '.batch-table__select-all button', 'click', () => { } }); -delegate(document, batchCheckboxClassName, 'change', () => { +Rails.delegate(document, batchCheckboxClassName, 'change', () => { const checkAllElement = document.querySelector('#batch_checkbox_all'); const selectAllMatchingElement = document.querySelector('.batch-table__select-all'); @@ -93,19 +93,19 @@ delegate(document, batchCheckboxClassName, 'change', () => { } }); -delegate(document, '.media-spoiler-show-button', 'click', () => { +Rails.delegate(document, '.media-spoiler-show-button', 'click', () => { [].forEach.call(document.querySelectorAll('button.media-spoiler'), (element) => { element.click(); }); }); -delegate(document, '.media-spoiler-hide-button', 'click', () => { +Rails.delegate(document, '.media-spoiler-hide-button', 'click', () => { [].forEach.call(document.querySelectorAll('.spoiler-button.spoiler-button--visible button'), (element) => { element.click(); }); }); -delegate(document, '.filter-subset--with-select select', 'change', ({ target }) => { +Rails.delegate(document, '.filter-subset--with-select select', 'change', ({ target }) => { target.form.submit(); }); @@ -122,7 +122,7 @@ const onDomainBlockSeverityChange = (target) => { } }; -delegate(document, '#domain_block_severity', 'change', ({ target }) => onDomainBlockSeverityChange(target)); +Rails.delegate(document, '#domain_block_severity', 'change', ({ target }) => onDomainBlockSeverityChange(target)); const onEnableBootstrapTimelineAccountsChange = (target) => { const bootstrapTimelineAccountsField = document.querySelector('#form_admin_settings_bootstrap_timeline_accounts'); @@ -139,7 +139,7 @@ const onEnableBootstrapTimelineAccountsChange = (target) => { } }; -delegate(document, '#form_admin_settings_enable_bootstrap_timeline_accounts', 'change', ({ target }) => onEnableBootstrapTimelineAccountsChange(target)); +Rails.delegate(document, '#form_admin_settings_enable_bootstrap_timeline_accounts', 'change', ({ target }) => onEnableBootstrapTimelineAccountsChange(target)); const onChangeRegistrationMode = (target) => { const enabled = target.value === 'approved'; @@ -176,7 +176,7 @@ const convertLocalDatetimeToUTC = (value) => { return fullISO8601.slice(0, fullISO8601.indexOf('T') + 6); }; -delegate(document, '#form_admin_settings_registrations_mode', 'change', ({ target }) => onChangeRegistrationMode(target)); +Rails.delegate(document, '#form_admin_settings_registrations_mode', 'change', ({ target }) => onChangeRegistrationMode(target)); ready(() => { const domainBlockSeverityInput = document.getElementById('domain_block_severity'); @@ -213,7 +213,7 @@ ready(() => { } }); - delegate(document, 'form', 'submit', ({ target }) => { + Rails.delegate(document, 'form', 'submit', ({ target }) => { [].forEach.call(target.querySelectorAll('input[type="datetime-local"]'), element => { if (element.value && element.validity.valid) { element.value = convertLocalDatetimeToUTC(element.value); diff --git a/app/javascript/core/settings.js b/app/javascript/core/settings.js index d9a8ea4cfd..23367d2d31 100644 --- a/app/javascript/core/settings.js +++ b/app/javascript/core/settings.js @@ -1,9 +1,9 @@ // This file will be loaded on settings pages, regardless of theme. import 'packs/public-path'; -import { delegate } from '@rails/ujs'; +import Rails from '@rails/ujs'; -delegate(document, '#edit_profile input[type=file]', 'change', ({ target }) => { +Rails.delegate(document, '#edit_profile input[type=file]', 'change', ({ target }) => { const avatar = document.getElementById(target.id + '-preview'); const [file] = target.files || []; const url = file ? URL.createObjectURL(file) : avatar.dataset.originalSrc; @@ -11,13 +11,13 @@ delegate(document, '#edit_profile input[type=file]', 'change', ({ target }) => { avatar.src = url; }); -delegate(document, '.input-copy input', 'click', ({ target }) => { +Rails.delegate(document, '.input-copy input', 'click', ({ target }) => { target.focus(); target.select(); target.setSelectionRange(0, target.value.length); }); -delegate(document, '.input-copy button', 'click', ({ target }) => { +Rails.delegate(document, '.input-copy button', 'click', ({ target }) => { const input = target.parentNode.querySelector('.input-copy__wrapper input'); const oldReadOnly = input.readonly; diff --git a/app/javascript/flavours/glitch/actions/accounts.js b/app/javascript/flavours/glitch/actions/accounts.js index d4f18ff2d7..6d9544d651 100644 --- a/app/javascript/flavours/glitch/actions/accounts.js +++ b/app/javascript/flavours/glitch/actions/accounts.js @@ -106,7 +106,6 @@ export function fetchAccount(id) { api(getState).get(`/api/v1/accounts/${id}`).then(response => { dispatch(importFetchedAccount(response.data)); - }).then(() => { dispatch(fetchAccountSuccess()); }).catch(error => { dispatch(fetchAccountFail(id, error)); diff --git a/app/javascript/flavours/glitch/actions/identity_proofs.js b/app/javascript/flavours/glitch/actions/identity_proofs.js deleted file mode 100644 index 1039839566..0000000000 --- a/app/javascript/flavours/glitch/actions/identity_proofs.js +++ /dev/null @@ -1,31 +0,0 @@ -import api from '../api'; - -export const IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST = 'IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST'; -export const IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS = 'IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS'; -export const IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL = 'IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL'; - -export const fetchAccountIdentityProofs = accountId => (dispatch, getState) => { - dispatch(fetchAccountIdentityProofsRequest(accountId)); - - api(getState).get(`/api/v1/accounts/${accountId}/identity_proofs`) - .then(({ data }) => dispatch(fetchAccountIdentityProofsSuccess(accountId, data))) - .catch(err => dispatch(fetchAccountIdentityProofsFail(accountId, err))); -}; - -export const fetchAccountIdentityProofsRequest = id => ({ - type: IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST, - id, -}); - -export const fetchAccountIdentityProofsSuccess = (accountId, identity_proofs) => ({ - type: IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS, - accountId, - identity_proofs, -}); - -export const fetchAccountIdentityProofsFail = (accountId, err) => ({ - type: IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL, - accountId, - err, - skipNotFound: true, -}); diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js index 3ad8f72098..cba3503756 100644 --- a/app/javascript/flavours/glitch/actions/importer/normalizer.js +++ b/app/javascript/flavours/glitch/actions/importer/normalizer.js @@ -1,8 +1,8 @@ import escapeTextContentForBrowser from 'escape-html'; -import emojify from 'flavours/glitch/features/emoji/emoji'; -import { autoHideCW } from 'flavours/glitch/utils/content_warning'; -import { unescapeHTML } from 'flavours/glitch/utils/html'; +import emojify from '../../features/emoji/emoji'; +import { autoHideCW } from '../../utils/content_warning'; +import { unescapeHTML } from '../../utils/html'; const domParser = new DOMParser(); diff --git a/app/javascript/flavours/glitch/actions/interactions.js b/app/javascript/flavours/glitch/actions/interactions.js index 095fb3155e..7d0144438a 100644 --- a/app/javascript/flavours/glitch/actions/interactions.js +++ b/app/javascript/flavours/glitch/actions/interactions.js @@ -83,6 +83,7 @@ export function reblogRequest(status) { return { type: REBLOG_REQUEST, status: status, + skipLoading: true, }; } @@ -90,6 +91,7 @@ export function reblogSuccess(status) { return { type: REBLOG_SUCCESS, status: status, + skipLoading: true, }; } @@ -98,6 +100,7 @@ export function reblogFail(status, error) { type: REBLOG_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -105,6 +108,7 @@ export function unreblogRequest(status) { return { type: UNREBLOG_REQUEST, status: status, + skipLoading: true, }; } @@ -112,6 +116,7 @@ export function unreblogSuccess(status) { return { type: UNREBLOG_SUCCESS, status: status, + skipLoading: true, }; } @@ -120,6 +125,7 @@ export function unreblogFail(status, error) { type: UNREBLOG_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -153,6 +159,7 @@ export function favouriteRequest(status) { return { type: FAVOURITE_REQUEST, status: status, + skipLoading: true, }; } @@ -160,6 +167,7 @@ export function favouriteSuccess(status) { return { type: FAVOURITE_SUCCESS, status: status, + skipLoading: true, }; } @@ -168,6 +176,7 @@ export function favouriteFail(status, error) { type: FAVOURITE_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -175,6 +184,7 @@ export function unfavouriteRequest(status) { return { type: UNFAVOURITE_REQUEST, status: status, + skipLoading: true, }; } @@ -182,6 +192,7 @@ export function unfavouriteSuccess(status) { return { type: UNFAVOURITE_SUCCESS, status: status, + skipLoading: true, }; } @@ -190,6 +201,7 @@ export function unfavouriteFail(status, error) { type: UNFAVOURITE_FAIL, status: status, error: error, + skipLoading: true, }; } @@ -199,7 +211,7 @@ export function bookmark(status) { api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) { dispatch(importFetchedStatus(response.data)); - dispatch(bookmarkSuccess(status)); + dispatch(bookmarkSuccess(status, response.data)); }).catch(function (error) { dispatch(bookmarkFail(status, error)); }); @@ -212,7 +224,7 @@ export function unbookmark(status) { api(getState).post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => { dispatch(importFetchedStatus(response.data)); - dispatch(unbookmarkSuccess(status)); + dispatch(unbookmarkSuccess(status, response.data)); }).catch(error => { dispatch(unbookmarkFail(status, error)); }); @@ -226,10 +238,11 @@ export function bookmarkRequest(status) { }; } -export function bookmarkSuccess(status) { +export function bookmarkSuccess(status, response) { return { type: BOOKMARK_SUCCESS, status: status, + response: response, }; } @@ -248,10 +261,11 @@ export function unbookmarkRequest(status) { }; } -export function unbookmarkSuccess(status) { +export function unbookmarkSuccess(status, response) { return { type: UNBOOKMARK_SUCCESS, status: status, + response: response, }; } @@ -444,6 +458,7 @@ export function pinRequest(status) { return { type: PIN_REQUEST, status, + skipLoading: true, }; } @@ -451,6 +466,7 @@ export function pinSuccess(status) { return { type: PIN_SUCCESS, status, + skipLoading: true, }; } @@ -459,6 +475,7 @@ export function pinFail(status, error) { type: PIN_FAIL, status, error, + skipLoading: true, }; } @@ -479,6 +496,7 @@ export function unpinRequest(status) { return { type: UNPIN_REQUEST, status, + skipLoading: true, }; } @@ -486,6 +504,7 @@ export function unpinSuccess(status) { return { type: UNPIN_SUCCESS, status, + skipLoading: true, }; } @@ -494,5 +513,6 @@ export function unpinFail(status, error) { type: UNPIN_FAIL, status, error, + skipLoading: true, }; } diff --git a/app/javascript/flavours/glitch/actions/mutes.js b/app/javascript/flavours/glitch/actions/mutes.js index 4af927d932..fb041078b8 100644 --- a/app/javascript/flavours/glitch/actions/mutes.js +++ b/app/javascript/flavours/glitch/actions/mutes.js @@ -1,9 +1,8 @@ -import { openModal } from 'flavours/glitch/actions/modal'; - import api, { getLinks } from '../api'; import { fetchRelationships } from './accounts'; import { importFetchedAccounts } from './importer'; +import { openModal } from './modal'; export const MUTES_FETCH_REQUEST = 'MUTES_FETCH_REQUEST'; export const MUTES_FETCH_SUCCESS = 'MUTES_FETCH_SUCCESS'; diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index 81b8045d70..72d55d7bd0 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -5,10 +5,10 @@ import { List as ImmutableList } from 'immutable'; import { compareId } from 'flavours/glitch/compare_id'; import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state'; -import { unescapeHTML } from 'flavours/glitch/utils/html'; -import { requestNotificationPermission } from 'flavours/glitch/utils/notifications'; import api, { getLinks } from '../api'; +import { unescapeHTML } from '../utils/html'; +import { requestNotificationPermission } from '../utils/notifications'; import { fetchFollowRequests, fetchRelationships } from './accounts'; import { @@ -21,10 +21,7 @@ import { submitMarkers } from './markers'; import { register as registerPushNotifications } from './push_notifications'; import { saveSettings } from './settings'; - - - -export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; +export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP'; // tracking the notif cleaning request @@ -65,7 +62,7 @@ defineMessages({ const fetchRelatedRelationships = (dispatch, notifications) => { const accountIds = notifications.filter(item => ['follow', 'follow_request', 'admin.sign_up'].indexOf(item.type) !== -1).map(item => item.account.id); - if (accountIds > 0) { + if (accountIds.length > 0) { dispatch(fetchRelationships(accountIds)); } }; @@ -131,6 +128,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) { const body = (notification.status && notification.status.spoiler_text.length > 0) ? notification.status.spoiler_text : unescapeHTML(notification.status ? notification.status.content : ''); const notify = new Notification(title, { body, icon: notification.account.avatar, tag: notification.id }); + notify.addEventListener('click', () => { window.focus(); notify.close(); @@ -141,7 +139,6 @@ export function updateNotifications(notification, intlMessages, intlLocale) { const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); - const excludeTypesFromFilter = filter => { const allTypes = ImmutableList([ 'follow', diff --git a/app/javascript/flavours/glitch/actions/pin_statuses.js b/app/javascript/flavours/glitch/actions/pin_statuses.js index 8aca199e97..baa10d1562 100644 --- a/app/javascript/flavours/glitch/actions/pin_statuses.js +++ b/app/javascript/flavours/glitch/actions/pin_statuses.js @@ -1,10 +1,8 @@ -import { me } from 'flavours/glitch/initial_state'; - import api from '../api'; +import { me } from '../initial_state'; import { importFetchedStatuses } from './importer'; - export const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST'; export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS'; export const PINNED_STATUSES_FETCH_FAIL = 'PINNED_STATUSES_FETCH_FAIL'; diff --git a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js index 336bbc6869..b3d3850e31 100644 --- a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js +++ b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js @@ -1,5 +1,7 @@ import api from '../../api'; +import { me } from '../../initial_state'; import { pushNotificationsSetting } from '../../settings'; +import { decode as decodeBase64 } from '../../utils/base64'; import { setBrowserSupport, setSubscription, clearSubscription } from './setter'; @@ -10,13 +12,7 @@ const urlBase64ToUint8Array = (base64String) => { .replace(/-/g, '+') .replace(/_/g, '/'); - const rawData = window.atob(base64); - const outputArray = new Uint8Array(rawData.length); - - for (let i = 0; i < rawData.length; ++i) { - outputArray[i] = rawData.charCodeAt(i); - } - return outputArray; + return decodeBase64(base64); }; const getApplicationServerKey = () => document.querySelector('[name="applicationServerKey"]').getAttribute('content'); @@ -36,7 +32,7 @@ const subscribe = (registration) => const unsubscribe = ({ registration, subscription }) => subscription ? subscription.unsubscribe().then(() => registration) : registration; -const sendSubscriptionToBackend = (getState, subscription, me) => { +const sendSubscriptionToBackend = (subscription) => { const params = { subscription }; if (me) { @@ -46,7 +42,7 @@ const sendSubscriptionToBackend = (getState, subscription, me) => { } } - return api(getState).post('/api/web/push_subscriptions', params).then(response => response.data); + return api().post('/api/web/push_subscriptions', params).then(response => response.data); }; // Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload @@ -55,7 +51,6 @@ const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' export function register () { return (dispatch, getState) => { dispatch(setBrowserSupport(supportsPushNotifications)); - const me = getState().getIn(['meta', 'me']); if (supportsPushNotifications) { if (!getApplicationServerKey()) { @@ -79,13 +74,13 @@ export function register () { } else { // Something went wrong, try to subscribe again return unsubscribe({ registration, subscription }).then(subscribe).then( - subscription => sendSubscriptionToBackend(getState, subscription, me)); + subscription => sendSubscriptionToBackend(subscription)); } } // No subscription, try to subscribe return subscribe(registration).then( - subscription => sendSubscriptionToBackend(getState, subscription, me)); + subscription => sendSubscriptionToBackend(subscription)); }) .then(subscription => { // If we got a PushSubscription (and not a subscription object from the backend) @@ -128,10 +123,9 @@ export function saveSettings() { const alerts = state.get('alerts'); const data = { alerts }; - api(getState).put(`/api/web/push_subscriptions/${subscription.get('id')}`, { + api().put(`/api/web/push_subscriptions/${subscription.get('id')}`, { data, }).then(() => { - const me = getState().getIn(['meta', 'me']); if (me) { pushNotificationsSetting.set(me, data); } diff --git a/app/javascript/flavours/glitch/actions/settings.js b/app/javascript/flavours/glitch/actions/settings.js index 120ae133ed..3685b0684e 100644 --- a/app/javascript/flavours/glitch/actions/settings.js +++ b/app/javascript/flavours/glitch/actions/settings.js @@ -26,7 +26,7 @@ const debouncedSave = debounce((dispatch, getState) => { const data = getState().get('settings').filter((_, path) => path !== 'saved').toJS(); - api(getState).put('/api/web/settings', { data }) + api().put('/api/web/settings', { data }) .then(() => dispatch({ type: SETTING_SAVE })) .catch(error => dispatch(showAlertForError(error))); }, 5000, { trailing: true }); diff --git a/app/javascript/flavours/glitch/actions/streaming.js b/app/javascript/flavours/glitch/actions/streaming.js index f1c44d2e29..d8341a5c16 100644 --- a/app/javascript/flavours/glitch/actions/streaming.js +++ b/app/javascript/flavours/glitch/actions/streaming.js @@ -1,7 +1,6 @@ // @ts-check -import { getLocale } from 'flavours/glitch/locales'; - +import { getLocale } from '../locales'; import { connectStream } from '../stream'; import { @@ -68,8 +67,8 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti // @ts-expect-error if (pollingId) { - clearTimeout(pollingId); - pollingId = null; + // @ts-ignore + clearTimeout(pollingId); pollingId = null; } if (options.fillGaps) { @@ -86,8 +85,8 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti } }, - onReceive (data) { - switch(data.event) { + onReceive(data) { + switch (data.event) { case 'update': // @ts-expect-error dispatch(updateTimeline(timelineId, JSON.parse(data.payload), options.accept)); diff --git a/app/javascript/flavours/glitch/components/__tests__/hashtag_bar.tsx b/app/javascript/flavours/glitch/components/__tests__/hashtag_bar.tsx new file mode 100644 index 0000000000..b7225fc92e --- /dev/null +++ b/app/javascript/flavours/glitch/components/__tests__/hashtag_bar.tsx @@ -0,0 +1,214 @@ +import { fromJS } from 'immutable'; + +import type { StatusLike } from '../hashtag_bar'; +import { computeHashtagBarForStatus } from '../hashtag_bar'; + +function createStatus( + content: string, + hashtags: string[], + hasMedia = false, + spoilerText?: string, +) { + return fromJS({ + tags: hashtags.map((name) => ({ name })), + contentHtml: content, + media_attachments: hasMedia ? ['fakeMedia'] : [], + spoiler_text: spoilerText, + }) as unknown as StatusLike; // need to force the type here, as it is not properly defined +} + +describe('computeHashtagBarForStatus', () => { + it('does nothing when there are no tags', () => { + const status = createStatus('

Simple text

', []); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text

"`, + ); + }); + + it('displays out of band hashtags in the bar', () => { + const status = createStatus( + '

Simple text #hashtag

', + ['hashtag', 'test'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['test']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text #hashtag

"`, + ); + }); + + it('does not truncate the contents when the last child is a text node', () => { + const status = createStatus( + 'this is a #test. Some more text', + ['test'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"this is a #test. Some more text"`, + ); + }); + + it('extract tags from the last line', () => { + const status = createStatus( + '

Simple text

#hashtag

', + ['hashtag'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['hashtag']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text

"`, + ); + }); + + it('does not include tags from content', () => { + const status = createStatus( + '

Simple text with a #hashtag

#hashtag

', + ['hashtag'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Simple text with a #hashtag

"`, + ); + }); + + it('works with one line status and hashtags', () => { + const status = createStatus( + '

#test. And another #hashtag

', + ['hashtag', 'test'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

#test. And another #hashtag

"`, + ); + }); + + it('de-duplicate accentuated characters with case differences', () => { + const status = createStatus( + '

Text

#éaa #Éaa

', + ['éaa'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['Éaa']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Text

"`, + ); + }); + + it('handles server-side normalized tags with accentuated characters', () => { + const status = createStatus( + '

Text

#éaa #Éaa

', + ['eaa'], // The server may normalize the hashtags in the `tags` attribute + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['Éaa']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Text

"`, + ); + }); + + it('does not display in bar a hashtag in content with a case difference', () => { + const status = createStatus( + '

Text #Éaa

#éaa

', + ['éaa'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

Text #Éaa

"`, + ); + }); + + it('does not modify a status with a line of hashtags only', () => { + const status = createStatus( + '

#test #hashtag

', + ['test', 'hashtag'], + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

#test #hashtag

"`, + ); + }); + + it('puts the hashtags in the bar if a status content has hashtags in the only line and has a media', () => { + const status = createStatus( + '

This is my content! #hashtag

', + ['hashtag'], + true, + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

This is my content! #hashtag

"`, + ); + }); + + it('puts the hashtags in the bar if a status content is only hashtags and has a media', () => { + const status = createStatus( + '

#test #hashtag

', + ['test', 'hashtag'], + true, + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual(['test', 'hashtag']); + expect(statusContentProps.statusContent).toMatchInlineSnapshot(`""`); + }); + + it('does not use the hashtag bar if the status content is only hashtags, has a CW and a media', () => { + const status = createStatus( + '

#test #hashtag

', + ['test', 'hashtag'], + true, + 'My CW text', + ); + + const { hashtagsInBar, statusContentProps } = + computeHashtagBarForStatus(status); + + expect(hashtagsInBar).toEqual([]); + expect(statusContentProps.statusContent).toMatchInlineSnapshot( + `"

#test #hashtag

"`, + ); + }); +}); diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx index 518464b040..78cf59e345 100644 --- a/app/javascript/flavours/glitch/components/account.jsx +++ b/app/javascript/flavours/glitch/components/account.jsx @@ -6,7 +6,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Skeleton } from 'flavours/glitch/components/skeleton'; -import { me } from 'flavours/glitch/initial_state'; + +import { me } from '../initial_state'; import { Avatar } from './avatar'; import { DisplayName } from './display_name'; @@ -14,11 +15,10 @@ import { IconButton } from './icon_button'; import Permalink from './permalink'; import { RelativeTimestamp } from './relative_timestamp'; - const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, - requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' }, + requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' }, unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, @@ -38,7 +38,6 @@ class Account extends ImmutablePureComponent { onMuteNotifications: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, hidden: PropTypes.bool, - small: PropTypes.bool, actionIcon: PropTypes.string, actionTitle: PropTypes.string, defaultAction: PropTypes.string, @@ -74,17 +73,7 @@ class Account extends ImmutablePureComponent { }; render () { - const { - account, - hidden, - intl, - small, - onActionClick, - actionIcon, - actionTitle, - defaultAction, - size, - } = this.props; + const { account, intl, hidden, onActionClick, actionIcon, actionTitle, defaultAction, size } = this.props; if (!account) { return ( @@ -114,7 +103,7 @@ class Account extends ImmutablePureComponent { if (actionIcon) { buttons = ; } - } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { + } else if (account.get('id') !== me && account.get('relationship', null) !== null) { const following = account.getIn(['relationship', 'following']); const requested = account.getIn(['relationship', 'requested']); const blocking = account.getIn(['relationship', 'blocking']); @@ -151,24 +140,7 @@ class Account extends ImmutablePureComponent { mute_expires_at =
; } - return small ? ( - -
- -
- -
- ) : ( + return (
diff --git a/app/javascript/flavours/glitch/components/animated_number.tsx b/app/javascript/flavours/glitch/components/animated_number.tsx index 2beb6efbe4..05a7e01898 100644 --- a/app/javascript/flavours/glitch/components/animated_number.tsx +++ b/app/javascript/flavours/glitch/components/animated_number.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; import { TransitionMotion, spring } from 'react-motion'; diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx index 32a996fd7c..eb25f5a643 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx @@ -1,9 +1,10 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import unicodeMapping from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; import { assetHost } from 'flavours/glitch/utils/config'; +import { unicodeMapping } from '../features/emoji/emoji_unicode_mapping_light'; + export default class AutosuggestEmoji extends PureComponent { static propTypes = { @@ -27,7 +28,7 @@ export default class AutosuggestEmoji extends PureComponent { } return ( -
+
= ({ ); }; -const MemoizedBlurhash = React.memo(Blurhash); +const MemoizedBlurhash = memo(Blurhash); export { MemoizedBlurhash as Blurhash }; diff --git a/app/javascript/flavours/glitch/components/button.jsx b/app/javascript/flavours/glitch/components/button.jsx deleted file mode 100644 index bdeeeac999..0000000000 --- a/app/javascript/flavours/glitch/components/button.jsx +++ /dev/null @@ -1,53 +0,0 @@ -import PropTypes from 'prop-types'; -import { PureComponent } from 'react'; - -import classNames from 'classnames'; - -export default class Button extends PureComponent { - - static propTypes = { - text: PropTypes.node, - onClick: PropTypes.func, - disabled: PropTypes.bool, - block: PropTypes.bool, - secondary: PropTypes.bool, - className: PropTypes.string, - title: PropTypes.string, - children: PropTypes.node, - }; - - handleClick = (e) => { - if (!this.props.disabled) { - this.props.onClick(e); - } - }; - - setRef = (c) => { - this.node = c; - }; - - focus() { - this.node.focus(); - } - - render () { - let attrs = { - className: classNames('button', this.props.className, { - 'button-secondary': this.props.secondary, - 'button--block': this.props.block, - }), - disabled: this.props.disabled, - onClick: this.handleClick, - ref: this.setRef, - }; - - if (this.props.title) attrs.title = this.props.title; - - return ( - - ); - } - -} diff --git a/app/javascript/flavours/glitch/components/button.tsx b/app/javascript/flavours/glitch/components/button.tsx new file mode 100644 index 0000000000..0b6a0f267e --- /dev/null +++ b/app/javascript/flavours/glitch/components/button.tsx @@ -0,0 +1,58 @@ +import { useCallback } from 'react'; + +import classNames from 'classnames'; + +interface BaseProps extends React.ButtonHTMLAttributes { + block?: boolean; + secondary?: boolean; + text?: JSX.Element; +} + +interface PropsWithChildren extends BaseProps { + text?: never; +} + +interface PropsWithText extends BaseProps { + text: JSX.Element; + children: never; +} + +type Props = PropsWithText | PropsWithChildren; + +export const Button: React.FC = ({ + text, + type = 'button', + onClick, + disabled, + block, + secondary, + className, + title, + children, + ...props +}) => { + const handleClick = useCallback>( + (e) => { + if (!disabled && onClick) { + onClick(e); + } + }, + [disabled, onClick], + ); + + return ( + + ); +}; diff --git a/app/javascript/flavours/glitch/components/column.jsx b/app/javascript/flavours/glitch/components/column.jsx index 116d852168..e42a539052 100644 --- a/app/javascript/flavours/glitch/components/column.jsx +++ b/app/javascript/flavours/glitch/components/column.jsx @@ -24,12 +24,6 @@ export default class Column extends PureComponent { scrollable = document.scrollingElement; } else { scrollable = this.node.querySelector('.scrollable'); - - // Some columns have nested `.scrollable` containers, with the outer one - // being a wrapper while the actual scrollable content is deeper. - if (scrollable.classList.contains('scrollable--flex')) { - scrollable = scrollable?.querySelector('.scrollable') || scrollable; - } } if (!scrollable) { diff --git a/app/javascript/flavours/glitch/components/column_back_button.jsx b/app/javascript/flavours/glitch/components/column_back_button.jsx index 5a11a3d5ea..df623ab233 100644 --- a/app/javascript/flavours/glitch/components/column_back_button.jsx +++ b/app/javascript/flavours/glitch/components/column_back_button.jsx @@ -4,26 +4,25 @@ import { createPortal } from 'react-dom'; import { FormattedMessage } from 'react-intl'; -import { Icon } from 'flavours/glitch/components/icon'; +import { withRouter } from 'react-router-dom'; +import { Icon } from 'flavours/glitch/components/icon'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; -export default class ColumnBackButton extends PureComponent { - - static contextTypes = { - router: PropTypes.object, - }; +export class ColumnBackButton extends PureComponent { static propTypes = { multiColumn: PropTypes.bool, + ...WithRouterPropTypes, }; handleClick = () => { - const { router } = this.context; + const { history } = this.props; - if (router.history.location?.state?.fromMastodon) { - router.history.goBack(); + if (history.location?.state?.fromMastodon) { + history.goBack(); } else { - router.history.push('/'); + history.push('/'); } }; @@ -57,3 +56,5 @@ export default class ColumnBackButton extends PureComponent { } } + +export default withRouter(ColumnBackButton); diff --git a/app/javascript/flavours/glitch/components/column_back_button_slim.jsx b/app/javascript/flavours/glitch/components/column_back_button_slim.jsx index 7b3bac45f9..353a52cb30 100644 --- a/app/javascript/flavours/glitch/components/column_back_button_slim.jsx +++ b/app/javascript/flavours/glitch/components/column_back_button_slim.jsx @@ -1,25 +1,27 @@ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import { Icon } from 'flavours/glitch/components/icon'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; -export default class ColumnBackButtonSlim extends PureComponent { +class ColumnBackButtonSlim extends PureComponent { - static contextTypes = { - router: PropTypes.object, + static propTypes = { + ...WithRouterPropTypes, }; handleClick = () => { - const { router } = this.context; + const { location, history } = this.props; // Check if there is a previous page in the app to go back to per https://stackoverflow.com/a/70532858/9703201 // When upgrading to V6, check `location.key !== 'default'` instead per https://github.com/remix-run/history/blob/main/docs/api-reference.md#location - if (router.route.location.key) { - router.history.goBack(); + if (location.key) { + history.goBack(); } else { - router.history.push('/'); + history.push('/'); } }; @@ -33,5 +35,6 @@ export default class ColumnBackButtonSlim extends PureComponent {
); } - } + +export default withRouter(ColumnBackButtonSlim); diff --git a/app/javascript/flavours/glitch/components/column_header.jsx b/app/javascript/flavours/glitch/components/column_header.jsx index 8a68036e9c..fa13f181d0 100644 --- a/app/javascript/flavours/glitch/components/column_header.jsx +++ b/app/javascript/flavours/glitch/components/column_header.jsx @@ -5,8 +5,10 @@ import { createPortal } from 'react-dom'; import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const messages = defineMessages({ show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' }, @@ -18,7 +20,6 @@ const messages = defineMessages({ class ColumnHeader extends PureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -38,6 +39,7 @@ class ColumnHeader extends PureComponent { onClick: PropTypes.func, appendContent: PropTypes.node, collapseIssues: PropTypes.bool, + ...WithRouterPropTypes, }; state = { @@ -63,12 +65,12 @@ class ColumnHeader extends PureComponent { }; handleBackClick = () => { - const { router } = this.context; + const { history } = this.props; - if (router.history.location?.state?.fromMastodon) { - router.history.goBack(); + if (history.location?.state?.fromMastodon) { + history.goBack(); } else { - router.history.push('/'); + history.push('/'); } }; @@ -78,15 +80,14 @@ class ColumnHeader extends PureComponent { handlePin = () => { if (!this.props.pinned) { - this.context.router.history.replace('/'); + this.props.history.replace('/'); } this.props.onPin(); }; render () { - const { router } = this.context; - const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props; + const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues, history } = this.props; const { collapsed, animating } = this.state; const wrapperClassName = classNames('column-header__wrapper', { @@ -129,7 +130,7 @@ class ColumnHeader extends PureComponent { pinButton = ; } - if (!pinned && ((multiColumn && router.history.location?.state?.fromMastodon) || showBackButton)) { + if (!pinned && ((multiColumn && history.location?.state?.fromMastodon) || showBackButton)) { backButton = ( + )} +
+ ); +}; diff --git a/app/javascript/flavours/glitch/components/icon.tsx b/app/javascript/flavours/glitch/components/icon.tsx index 765aa89aec..3d091c7059 100644 --- a/app/javascript/flavours/glitch/components/icon.tsx +++ b/app/javascript/flavours/glitch/components/icon.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; interface Props extends React.HTMLAttributes { diff --git a/app/javascript/flavours/glitch/components/icon_button.tsx b/app/javascript/flavours/glitch/components/icon_button.tsx index ecc418773c..8bca60fa97 100644 --- a/app/javascript/flavours/glitch/components/icon_button.tsx +++ b/app/javascript/flavours/glitch/components/icon_button.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { PureComponent } from 'react'; import classNames from 'classnames'; @@ -33,7 +33,7 @@ interface States { activate: boolean; deactivate: boolean; } -export class IconButton extends React.PureComponent { +export class IconButton extends PureComponent { static defaultProps = { size: 18, active: false, diff --git a/app/javascript/flavours/glitch/components/icon_with_badge.tsx b/app/javascript/flavours/glitch/components/icon_with_badge.tsx index 319c0b2389..8898f41329 100644 --- a/app/javascript/flavours/glitch/components/icon_with_badge.tsx +++ b/app/javascript/flavours/glitch/components/icon_with_badge.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { Icon } from './icon'; const formatNumber = (num: number): number | string => (num > 40 ? '40+' : num); diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx index bef40c07fa..8efa969f9b 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx @@ -3,6 +3,7 @@ import { cloneElement, Component } from 'react'; import getRectFromEntry from '../features/ui/util/get_rect_from_entry'; import scheduleIdleTask from '../features/ui/util/schedule_idle_task'; + // Diff these props in the "unrendered" state const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight']; @@ -38,7 +39,6 @@ export default class IntersectionObserverArticle extends Component { return true; } - componentDidMount () { const { intersectionObserverWrapper, id } = this.props; @@ -106,24 +106,24 @@ export default class IntersectionObserverArticle extends Component { const { children, id, index, listLength, cachedHeight } = this.props; const { isIntersecting, isHidden } = this.state; - const style = {}; - if (!isIntersecting && (isHidden || cachedHeight)) { - style.height = `${this.height || cachedHeight || 150}px`; - style.opacity = 0; - style.overflow = 'hidden'; + return ( +
+ {children && cloneElement(children, { hidden: true })} +
+ ); } return ( -
- {children && cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} +
+ {children && cloneElement(children, { hidden: false })}
); } diff --git a/app/javascript/flavours/glitch/components/media_gallery.jsx b/app/javascript/flavours/glitch/components/media_gallery.jsx index 21fdc47416..5b17f10ba7 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.jsx +++ b/app/javascript/flavours/glitch/components/media_gallery.jsx @@ -11,7 +11,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; import { Blurhash } from 'flavours/glitch/components/blurhash'; -import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; + +import { autoPlayGif, displayMedia, useBlurhash } from '../initial_state'; import { IconButton } from './icon_button'; diff --git a/app/javascript/flavours/glitch/components/modal_root.jsx b/app/javascript/flavours/glitch/components/modal_root.jsx index a99c51f924..f338c4ec0e 100644 --- a/app/javascript/flavours/glitch/components/modal_root.jsx +++ b/app/javascript/flavours/glitch/components/modal_root.jsx @@ -2,14 +2,13 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import 'wicg-inert'; + import { multiply } from 'color-blend'; import { createBrowserHistory } from 'history'; -export default class ModalRoot extends PureComponent { +import { WithOptionalRouterPropTypes, withOptionalRouter } from 'flavours/glitch/utils/react_router'; - static contextTypes = { - router: PropTypes.object, - }; +class ModalRoot extends PureComponent { static propTypes = { children: PropTypes.node, @@ -21,6 +20,7 @@ export default class ModalRoot extends PureComponent { }), noEsc: PropTypes.bool, ignoreFocus: PropTypes.bool, + ...WithOptionalRouterPropTypes, }; activeElement = this.props.children ? document.activeElement : null; @@ -56,7 +56,7 @@ export default class ModalRoot extends PureComponent { componentDidMount () { window.addEventListener('keyup', this.handleKeyUp, false); window.addEventListener('keydown', this.handleKeyDown, false); - this.history = this.context.router ? this.context.router.history : createBrowserHistory(); + this.history = this.props.history || createBrowserHistory(); if (this.props.children) { this._handleModalOpen(); @@ -110,8 +110,9 @@ export default class ModalRoot extends PureComponent { } _handleModalClose () { - this.unlistenHistory(); - + if (this.unlistenHistory) { + this.unlistenHistory(); + } const { state } = this.history.location; if (state && state.mastodonModalKey === this._modalHistoryKey) { this.history.goBack(); @@ -160,3 +161,5 @@ export default class ModalRoot extends PureComponent { } } + +export default withOptionalRouter(ModalRoot); diff --git a/app/javascript/flavours/glitch/components/navigation_portal.jsx b/app/javascript/flavours/glitch/components/navigation_portal.jsx deleted file mode 100644 index e142a3ec60..0000000000 --- a/app/javascript/flavours/glitch/components/navigation_portal.jsx +++ /dev/null @@ -1,36 +0,0 @@ -import { PureComponent } from 'react'; - -import { Switch, Route, withRouter } from 'react-router-dom'; - -import AccountNavigation from 'flavours/glitch/features/account/navigation'; -import Trends from 'flavours/glitch/features/getting_started/containers/trends_container'; -import { showTrends } from 'flavours/glitch/initial_state'; - -const DefaultNavigation = () => ( - showTrends ? ( - <> -
- - - ) : null -); - -class NavigationPortal extends PureComponent { - - render () { - return ( - - - - - - - - - - ); - } - -} - -export default withRouter(NavigationPortal); diff --git a/app/javascript/flavours/glitch/components/navigation_portal.tsx b/app/javascript/flavours/glitch/components/navigation_portal.tsx new file mode 100644 index 0000000000..223cc24232 --- /dev/null +++ b/app/javascript/flavours/glitch/components/navigation_portal.tsx @@ -0,0 +1,25 @@ +import { Switch, Route } from 'react-router-dom'; + +import AccountNavigation from 'flavours/glitch/features/account/navigation'; +import Trends from 'flavours/glitch/features/getting_started/containers/trends_container'; +import { showTrends } from 'flavours/glitch/initial_state'; + +const DefaultNavigation: React.FC = () => + showTrends ? ( + <> +
+ + + ) : null; + +export const NavigationPortal: React.FC = () => ( + + + + + + + + + +); diff --git a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx index d0eedc6412..015f74dcae 100644 --- a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx +++ b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { FormattedMessage } from 'react-intl'; export const NotSignedInIndicator: React.FC = () => ( diff --git a/app/javascript/flavours/glitch/components/permalink.jsx b/app/javascript/flavours/glitch/components/permalink.jsx index fa33ce066a..5226895415 100644 --- a/app/javascript/flavours/glitch/components/permalink.jsx +++ b/app/javascript/flavours/glitch/components/permalink.jsx @@ -1,11 +1,9 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -export default class Permalink extends PureComponent { +import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router'; - static contextTypes = { - router: PropTypes.object, - }; +class Permalink extends PureComponent { static propTypes = { className: PropTypes.string, @@ -13,6 +11,7 @@ export default class Permalink extends PureComponent { to: PropTypes.string.isRequired, children: PropTypes.node, onInterceptClick: PropTypes.func, + ...WithOptionalRouterPropTypes, }; handleClick = (e) => { @@ -22,9 +21,9 @@ export default class Permalink extends PureComponent { return; } - if (this.context.router) { + if (this.props.history) { e.preventDefault(); - this.context.router.history.push(this.props.to); + this.props.history.push(this.props.to); } } }; @@ -47,3 +46,5 @@ export default class Permalink extends PureComponent { } } + +export default withOptionalRouter(Permalink); diff --git a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx index 1a290c91de..9a103bdb0c 100644 --- a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx +++ b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { removePictureInPicture } from 'flavours/glitch/actions/picture_in_picture'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; class PictureInPicturePlaceholder extends PureComponent { diff --git a/app/javascript/flavours/glitch/components/poll.jsx b/app/javascript/flavours/glitch/components/poll.jsx index 03dd6b576e..7b69d302a7 100644 --- a/app/javascript/flavours/glitch/components/poll.jsx +++ b/app/javascript/flavours/glitch/components/poll.jsx @@ -10,13 +10,12 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import escapeTextContentForBrowser from 'escape-html'; import spring from 'react-motion/lib/spring'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import emojify from 'flavours/glitch/features/emoji/emoji'; import Motion from 'flavours/glitch/features/ui/util/optional_motion'; import { RelativeTimestamp } from './relative_timestamp'; - const messages = defineMessages({ closed: { id: 'poll.closed', diff --git a/app/javascript/flavours/glitch/components/radio_button.tsx b/app/javascript/flavours/glitch/components/radio_button.tsx index fbd7859d80..d0a565b9e6 100644 --- a/app/javascript/flavours/glitch/components/radio_button.tsx +++ b/app/javascript/flavours/glitch/components/radio_button.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; interface Props { diff --git a/app/javascript/flavours/glitch/components/router.tsx b/app/javascript/flavours/glitch/components/router.tsx index f093716517..96cc049b1b 100644 --- a/app/javascript/flavours/glitch/components/router.tsx +++ b/app/javascript/flavours/glitch/components/router.tsx @@ -1,15 +1,22 @@ import type { PropsWithChildren } from 'react'; import React from 'react'; -import { createBrowserHistory } from 'history'; import { Router as OriginalRouter } from 'react-router'; +import type { + LocationDescriptor, + LocationDescriptorObject, + Path, +} from 'history'; +import { createBrowserHistory } from 'history'; + import { layoutFromWindow } from 'flavours/glitch/is_mobile'; interface MastodonLocationState { fromMastodon?: boolean; mastodonModalKey?: string; } +type HistoryPath = Path | LocationDescriptor; const browserHistory = createBrowserHistory< MastodonLocationState | undefined @@ -17,28 +24,55 @@ const browserHistory = createBrowserHistory< const originalPush = browserHistory.push.bind(browserHistory); const originalReplace = browserHistory.replace.bind(browserHistory); -browserHistory.push = (path: string, state?: MastodonLocationState) => { - state = state ?? {}; - state.fromMastodon = true; +function normalizePath( + path: HistoryPath, + state?: MastodonLocationState, +): LocationDescriptorObject { + const location = typeof path === 'string' ? { pathname: path } : { ...path }; - if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) { - originalPush(`/deck${path}`, state); - } else { - originalPush(path, state); + if (location.state === undefined && state !== undefined) { + location.state = state; + } else if ( + location.state !== undefined && + state !== undefined && + process.env.NODE_ENV === 'development' + ) { + // eslint-disable-next-line no-console + console.log( + 'You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored', + ); } + + if ( + layoutFromWindow() === 'multi-column' && + !location.pathname?.startsWith('/deck') + ) { + location.pathname = `/deck${location.pathname}`; + } + + return location; +} + +browserHistory.push = (path: HistoryPath, state?: MastodonLocationState) => { + const location = normalizePath(path, state); + + location.state = location.state ?? {}; + location.state.fromMastodon = true; + + originalPush(location); }; -browserHistory.replace = (path: string, state?: MastodonLocationState) => { +browserHistory.replace = (path: HistoryPath, state?: MastodonLocationState) => { + const location = normalizePath(path, state); + + if (!location.pathname) return; + if (browserHistory.location.state?.fromMastodon) { - state = state ?? {}; - state.fromMastodon = true; + location.state = location.state ?? {}; + location.state.fromMastodon = true; } - if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) { - originalReplace(`/deck${path}`, state); - } else { - originalReplace(path, state); - } + originalReplace(location); }; export const Router: React.FC = ({ children }) => { diff --git a/app/javascript/flavours/glitch/components/scrollable_list.jsx b/app/javascript/flavours/glitch/components/scrollable_list.jsx index 2a746c5bd1..82d32185e1 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.jsx +++ b/app/javascript/flavours/glitch/components/scrollable_list.jsx @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import { Children, cloneElement, PureComponent } from 'react'; import classNames from 'classnames'; +import { useLocation } from 'react-router-dom'; import { List as ImmutableList } from 'immutable'; import { connect } from 'react-redux'; @@ -9,11 +10,11 @@ import { connect } from 'react-redux'; import { supportsPassiveEvents } from 'detect-passive-events'; import { throttle } from 'lodash'; -import IntersectionObserverArticleContainer from 'flavours/glitch/containers/intersection_observer_article_container'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; -import IntersectionObserverWrapper from 'flavours/glitch/features/ui/util/intersection_observer_wrapper'; +import IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container'; import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../features/ui/util/fullscreen'; +import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'; import { LoadMore } from './load_more'; import { LoadPending } from './load_pending'; @@ -34,11 +35,32 @@ const mapStateToProps = (state, { scrollKey }) => { }; }; -class ScrollableList extends PureComponent { +// This component only exists to be able to call useLocation() +const IOArticleContainerWrapper = ({id, index, listLength, intersectionObserverWrapper, trackScroll, scrollKey, children}) => { + const location = useLocation(); - static contextTypes = { - router: PropTypes.object, - }; + return ( + {children} + ); +}; + +IOArticleContainerWrapper.propTypes = { + id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + listLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + scrollKey: PropTypes.string.isRequired, + intersectionObserverWrapper: PropTypes.object.isRequired, + trackScroll: PropTypes.bool.isRequired, + children: PropTypes.node, +}; + +class ScrollableList extends PureComponent { static propTypes = { scrollKey: PropTypes.string.isRequired, @@ -331,13 +353,14 @@ class ScrollableList extends PureComponent { {loadPending} {Children.map(this.props.children, (child, index) => ( - {cloneElement(child, { getScrollPosition: this.getScrollPosition, @@ -345,7 +368,7 @@ class ScrollableList extends PureComponent { cachedMediaWidth: this.state.cachedMediaWidth, cacheMediaWidth: this.cacheMediaWidth, })} - + ))} {loadMore} diff --git a/app/javascript/flavours/glitch/components/server_hero_image.tsx b/app/javascript/flavours/glitch/components/server_hero_image.tsx index be05059e49..68b7f03df3 100644 --- a/app/javascript/flavours/glitch/components/server_hero_image.tsx +++ b/app/javascript/flavours/glitch/components/server_hero_image.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/skeleton.tsx b/app/javascript/flavours/glitch/components/skeleton.tsx index 30ff0d8525..d6f1aed723 100644 --- a/app/javascript/flavours/glitch/components/skeleton.tsx +++ b/app/javascript/flavours/glitch/components/skeleton.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - interface Props { width?: number | string; height?: number | string; diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index bd7475d613..6fed2de6b2 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -12,14 +12,18 @@ import { HotKeys } from 'react-hotkeys'; import PictureInPicturePlaceholder from 'flavours/glitch/components/picture_in_picture_placeholder'; import PollContainer from 'flavours/glitch/containers/poll_container'; import NotificationOverlayContainer from 'flavours/glitch/features/notifications/containers/overlay_container'; -import { displayMedia } from 'flavours/glitch/initial_state'; import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning'; +import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router'; import Card from '../features/status/components/card'; +// We use the component (and not the container) since we do not want +// to use the progress bar to show download progress import Bundle from '../features/ui/components/bundle'; import { MediaGallery, Video, Audio } from '../features/ui/util/async-components'; +import { displayMedia } from '../initial_state'; import AttachmentList from './attachment_list'; +import { getHashtagBarForStatus } from './hashtag_bar'; import StatusActionBar from './status_action_bar'; import StatusContent from './status_content'; import StatusHeader from './status_header'; @@ -67,10 +71,6 @@ export const defaultMediaVisibility = (status, settings) => { class Status extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { containerId: PropTypes.string, id: PropTypes.string, @@ -118,6 +118,7 @@ class Status extends ImmutablePureComponent { inUse: PropTypes.bool, available: PropTypes.bool, }), + ...WithOptionalRouterPropTypes, }; state = { @@ -357,10 +358,9 @@ class Status extends ImmutablePureComponent { // Otherwise, we open the url handed to us in `destination`, if // applicable. parseClick = (e, destination) => { - const { router } = this.context; - const { status } = this.props; + const { status, history } = this.props; const { isCollapsed } = this.state; - if (!router) return; + if (!history) return; if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) { if (isCollapsed) this.setCollapsed(false); @@ -378,7 +378,7 @@ class Status extends ImmutablePureComponent { status.getIn(['reblog', 'id'], status.get('id')) }`; } - router.history.push(destination); + history.push(destination); } e.preventDefault(); } @@ -432,7 +432,7 @@ class Status extends ImmutablePureComponent { handleHotkeyReply = e => { e.preventDefault(); - this.props.onReply(this.props.status, this.context.router.history); + this.props.onReply(this.props.status, this.props.history); }; handleHotkeyFavourite = (e) => { @@ -449,16 +449,16 @@ class Status extends ImmutablePureComponent { handleHotkeyMention = e => { e.preventDefault(); - this.props.onMention(this.props.status.get('account'), this.context.router.history); + this.props.onMention(this.props.status.get('account'), this.props.history); }; handleHotkeyOpen = () => { const status = this.props.status; - this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); + this.props.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); }; handleHotkeyOpenProfile = () => { - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); }; handleHotkeyMoveUp = e => { @@ -515,7 +515,6 @@ class Status extends ImmutablePureComponent { parseClick, setCollapsed, } = this; - const { router } = this.context; const { intl, status, @@ -534,6 +533,7 @@ class Status extends ImmutablePureComponent { previousId, nextInReplyToId, rootId, + history, ...other } = this.props; const { isCollapsed } = this.state; @@ -783,6 +783,9 @@ class Status extends ImmutablePureComponent { muted, }, 'focusable'); + const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status); + contentMedia.push(hashtagBar); + return (
{!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? ( @@ -855,4 +859,4 @@ class Status extends ImmutablePureComponent { } -export default injectIntl(Status); +export default withOptionalRouter(injectIntl(Status)); diff --git a/app/javascript/flavours/glitch/components/status_action_bar.jsx b/app/javascript/flavours/glitch/components/status_action_bar.jsx index cc39fba357..3a5709aba9 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.jsx +++ b/app/javascript/flavours/glitch/components/status_action_bar.jsx @@ -3,14 +3,17 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container'; -import { me } from 'flavours/glitch/initial_state'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions'; import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; + +import DropdownMenuContainer from '../containers/dropdown_menu_container'; +import { me } from '../initial_state'; import { IconButton } from './icon_button'; import { RelativeTimestamp } from './relative_timestamp'; @@ -54,7 +57,6 @@ const messages = defineMessages({ class StatusActionBar extends ImmutablePureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -82,6 +84,7 @@ class StatusActionBar extends ImmutablePureComponent { showReplyCount: PropTypes.bool, scrollKey: PropTypes.string, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; // Avoid checking props that are functions (and whose equality will always @@ -97,12 +100,23 @@ class StatusActionBar extends ImmutablePureComponent { const { signedIn } = this.context.identity; if (signedIn) { - this.props.onReply(this.props.status, this.context.router.history); + this.props.onReply(this.props.status, this.props.history); } else { this.props.onInteractionModal('reply', this.props.status); } }; + handleQuoteClick = () => { + const { signedIn } = this.context.identity; + + if (signedIn) { + this.props.onQuote(this.props.status, this.props.history); + } else { + // TODO(ariadne): Add an interaction modal for quoting specifically. + this.props.onInteractionModal('reply', this.props.status); + } + }; + handleShareClick = () => { navigator.share({ url: this.props.status.get('url'), @@ -129,31 +143,20 @@ class StatusActionBar extends ImmutablePureComponent { } }; - handleQuoteClick = () => { - const { signedIn } = this.context.identity; - - if (signedIn) { - this.props.onQuote(this.props.status, this.context.router.history); - } else { - // TODO(ariadne): Add an interaction modal for quoting specifically. - this.props.onInteractionModal('reply', this.props.status); - } - } - handleBookmarkClick = (e) => { this.props.onBookmark(this.props.status, e); }; handleDeleteClick = () => { - this.props.onDelete(this.props.status, this.context.router.history); + this.props.onDelete(this.props.status, this.props.history); }; handleRedraftClick = () => { - this.props.onDelete(this.props.status, this.context.router.history, true); + this.props.onDelete(this.props.status, this.props.history, true); }; handleEditClick = () => { - this.props.onEdit(this.props.status, this.context.router.history); + this.props.onEdit(this.props.status, this.props.history); }; handlePinClick = () => { @@ -161,11 +164,11 @@ class StatusActionBar extends ImmutablePureComponent { }; handleMentionClick = () => { - this.props.onMention(this.props.status.get('account'), this.context.router.history); + this.props.onMention(this.props.status.get('account'), this.props.history); }; handleDirectClick = () => { - this.props.onDirect(this.props.status.get('account'), this.context.router.history); + this.props.onDirect(this.props.status.get('account'), this.props.history); }; handleMuteClick = () => { @@ -177,12 +180,7 @@ class StatusActionBar extends ImmutablePureComponent { }; handleOpen = () => { - let state = { ...this.context.router.history.location.state }; - if (state.mastodonModalKey) { - this.context.router.history.replace(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`); - } else { - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`); - } + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`); }; handleEmbed = () => { @@ -355,4 +353,4 @@ class StatusActionBar extends ImmutablePureComponent { } -export default injectIntl(StatusActionBar); +export default withRouter(injectIntl(StatusActionBar)); diff --git a/app/javascript/flavours/glitch/components/status_content.jsx b/app/javascript/flavours/glitch/components/status_content.jsx index 9a2a60dd51..05fd772cd0 100644 --- a/app/javascript/flavours/glitch/components/status_content.jsx +++ b/app/javascript/flavours/glitch/components/status_content.jsx @@ -4,6 +4,7 @@ import { PureComponent } from 'react'; import { FormattedMessage, injectIntl } from 'react-intl'; import classnames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; @@ -68,6 +69,15 @@ const isLinkMisleading = (link) => { return !(textMatchesTarget(text, origin, host) || textMatchesTarget(text.toLowerCase(), origin, host)); }; +/** + * + * @param {any} status + * @returns {string} + */ +export function getStatusContent(status) { + return status.getIn(['translation', 'contentHtml']) || status.get('contentHtml'); +} + class TranslateButton extends PureComponent { static propTypes = { @@ -117,6 +127,7 @@ class StatusContent extends PureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, + statusContent: PropTypes.string, expanded: PropTypes.bool, collapsed: PropTypes.bool, onExpandedToggle: PropTypes.func, @@ -131,6 +142,10 @@ class StatusContent extends PureComponent { rewriteMentions: PropTypes.string, languages: ImmutablePropTypes.map, intl: PropTypes.object, + // from react-router + match: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, + history: PropTypes.object.isRequired }; static defaultProps = { @@ -322,6 +337,7 @@ class StatusContent extends PureComponent { tagLinks, rewriteMentions, intl, + statusContent, } = this.props; const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; @@ -329,7 +345,7 @@ class StatusContent extends PureComponent { const targetLanguages = this.props.languages?.get(status.get('language') || 'und'); const renderTranslate = this.props.onTranslate && this.context.identity.signedIn && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('search_index').trim().length > 0 && targetLanguages?.includes(contentLocale); - const content = { __html: status.getIn(['translation', 'contentHtml']) || status.get('contentHtml') }; + const content = { __html: statusContent ?? getStatusContent(status) }; const spoilerContent = { __html: status.getIn(['translation', 'spoilerHtml']) || status.get('spoilerHtml') }; const language = status.getIn(['translation', 'language']) || status.get('language'); const classNames = classnames('status__content', { @@ -506,4 +522,4 @@ class StatusContent extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(StatusContent)); +export default withRouter(connect(mapStateToProps)(injectIntl(StatusContent))); diff --git a/app/javascript/flavours/glitch/components/status_list.jsx b/app/javascript/flavours/glitch/components/status_list.jsx index f28c42582c..87825839e5 100644 --- a/app/javascript/flavours/glitch/components/status_list.jsx +++ b/app/javascript/flavours/glitch/components/status_list.jsx @@ -6,7 +6,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { debounce } from 'lodash'; import RegenerationIndicator from 'flavours/glitch/components/regeneration_indicator'; -import StatusContainer from 'flavours/glitch/containers/status_container'; + +import StatusContainer from '../containers/status_container'; import { LoadGap } from './load_gap'; import ScrollableList from './scrollable_list'; diff --git a/app/javascript/flavours/glitch/components/timeline_hint.tsx b/app/javascript/flavours/glitch/components/timeline_hint.tsx index df7787bf67..bf2a2d8bba 100644 --- a/app/javascript/flavours/glitch/components/timeline_hint.tsx +++ b/app/javascript/flavours/glitch/components/timeline_hint.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { FormattedMessage } from 'react-intl'; interface Props { diff --git a/app/javascript/flavours/glitch/containers/account_container.jsx b/app/javascript/flavours/glitch/containers/account_container.jsx index f204545852..a134452e77 100644 --- a/app/javascript/flavours/glitch/containers/account_container.jsx +++ b/app/javascript/flavours/glitch/containers/account_container.jsx @@ -9,12 +9,12 @@ import { unblockAccount, muteAccount, unmuteAccount, -} from 'flavours/glitch/actions/accounts'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { initMuteModal } from 'flavours/glitch/actions/mutes'; -import Account from 'flavours/glitch/components/account'; -import { unfollowModal } from 'flavours/glitch/initial_state'; -import { makeGetAccount } from 'flavours/glitch/selectors'; +} from '../actions/accounts'; +import { openModal } from '../actions/modal'; +import { initMuteModal } from '../actions/mutes'; +import Account from '../components/account'; +import { unfollowModal } from '../initial_state'; +import { makeGetAccount } from '../selectors'; const messages = defineMessages({ unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' }, diff --git a/app/javascript/flavours/glitch/containers/compose_container.jsx b/app/javascript/flavours/glitch/containers/compose_container.jsx index f92bf9797b..f76550678e 100644 --- a/app/javascript/flavours/glitch/containers/compose_container.jsx +++ b/app/javascript/flavours/glitch/containers/compose_container.jsx @@ -2,12 +2,13 @@ import { PureComponent } from 'react'; import { Provider } from 'react-redux'; -import { fetchCustomEmojis } from 'flavours/glitch/actions/custom_emojis'; -import { hydrateStore } from 'flavours/glitch/actions/store'; -import Compose from 'flavours/glitch/features/standalone/compose'; -import initialState from 'flavours/glitch/initial_state'; -import { IntlProvider } from 'flavours/glitch/locales'; -import { store } from 'flavours/glitch/store'; +import { fetchCustomEmojis } from '../actions/custom_emojis'; +import { hydrateStore } from '../actions/store'; +import Compose from '../features/standalone/compose'; +import initialState from '../initial_state'; +import { IntlProvider } from '../locales'; +import { store } from '../store'; + if (initialState) { store.dispatch(hydrateStore(initialState)); diff --git a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js index e7958f4660..7550196742 100644 --- a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js +++ b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js @@ -1,9 +1,8 @@ import { connect } from 'react-redux'; -import { openDropdownMenu, closeDropdownMenu } from 'flavours/glitch/actions/dropdown_menu'; -import { openModal, closeModal } from 'flavours/glitch/actions/modal'; -import DropdownMenu from 'flavours/glitch/components/dropdown_menu'; - +import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown_menu'; +import { openModal, closeModal } from '../actions/modal'; +import DropdownMenu from '../components/dropdown_menu'; import { isUserTouching } from '../is_mobile'; /** diff --git a/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js b/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js index 11aedd5278..8d9bda6704 100644 --- a/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js +++ b/app/javascript/flavours/glitch/containers/intersection_observer_article_container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux'; -import { setHeight } from 'flavours/glitch/actions/height_cache'; -import IntersectionObserverArticle from 'flavours/glitch/components/intersection_observer_article'; +import { setHeight } from '../actions/height_cache'; +import IntersectionObserverArticle from '../components/intersection_observer_article'; const makeMapStateToProps = (state, props) => ({ cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]), diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js index 45aebd5c99..59c5aa6084 100644 --- a/app/javascript/flavours/glitch/containers/status_container.js +++ b/app/javascript/flavours/glitch/containers/status_container.js @@ -122,11 +122,14 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({ let state = getState(); if (state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0) { - dispatch(openModal('CONFIRM', { - message: intl.formatMessage(messages.quoteMessage), - confirm: intl.formatMessage(messages.quoteConfirm), - onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_before_clearing_draft'], false)), - onConfirm: () => dispatch(quoteCompose(status, router)), + dispatch(openModal({ + modalType: 'CONFIRM', + modalProps: { + message: intl.formatMessage(messages.quoteMessage), + confirm: intl.formatMessage(messages.quoteConfirm), + onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_before_clearing_draft'], false)), + onConfirm: () => dispatch(quoteCompose(status, router)), + }, })); } else { dispatch(quoteCompose(status, router)); diff --git a/app/javascript/flavours/glitch/features/about/index.jsx b/app/javascript/flavours/glitch/features/about/index.jsx index feecc2dd6f..79b5f8114e 100644 --- a/app/javascript/flavours/glitch/features/about/index.jsx +++ b/app/javascript/flavours/glitch/features/about/index.jsx @@ -10,9 +10,9 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'flavours/glitch/actions/server'; +import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'flavours/glitch/actions/server'; import Column from 'flavours/glitch/components/column'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { ServerHeroImage } from 'flavours/glitch/components/server_hero_image'; import { Skeleton } from 'flavours/glitch/components/skeleton'; import Account from 'flavours/glitch/containers/account_container'; diff --git a/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx b/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx index 87e88f2fa8..4ddf0dc524 100644 --- a/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx +++ b/app/javascript/flavours/glitch/features/account/components/featured_tags.jsx @@ -14,10 +14,6 @@ const messages = defineMessages({ class FeaturedTags extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { account: ImmutablePropTypes.map, featuredTags: ImmutablePropTypes.list, diff --git a/app/javascript/flavours/glitch/features/account/components/header.jsx b/app/javascript/flavours/glitch/features/account/components/header.jsx index acebd9f322..486d66c2a2 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.jsx +++ b/app/javascript/flavours/glitch/features/account/components/header.jsx @@ -4,18 +4,20 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import { Helmet } from 'react-helmet'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Avatar } from 'flavours/glitch/components/avatar'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container'; import { autoPlayGif, me, domain } from 'flavours/glitch/initial_state'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions'; import { preferencesLink, profileLink, accountAdminLink } from 'flavours/glitch/utils/backend_links'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import AccountNoteContainer from '../containers/account_note_container'; import FollowRequestNoteContainer from '../containers/follow_request_note_container'; @@ -81,10 +83,6 @@ const dateFormatOptions = { class Header extends ImmutablePureComponent { - static contextTypes = { - identity: PropTypes.object, - }; - static propTypes = { account: ImmutablePropTypes.map, identity_props: ImmutablePropTypes.list, @@ -107,6 +105,11 @@ class Header extends ImmutablePureComponent { intl: PropTypes.object.isRequired, domain: PropTypes.string.isRequired, hidden: PropTypes.bool, + ...WithRouterPropTypes, + }; + + static contextTypes = { + identity: PropTypes.object, }; openEditProfile = () => { @@ -406,4 +409,4 @@ class Header extends ImmutablePureComponent { } -export default injectIntl(Header); +export default withRouter(injectIntl(Header)); diff --git a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx index aa31468396..aaa872b0aa 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx @@ -6,11 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Blurhash } from 'flavours/glitch/components/blurhash'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; - - export default class MediaItem extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.jsx b/app/javascript/flavours/glitch/features/account_gallery/index.jsx index 2da679fc27..d3f845ddc4 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/index.jsx @@ -8,17 +8,18 @@ import { connect } from 'react-redux'; import { lookupAccount, fetchAccount } from 'flavours/glitch/actions/accounts'; import { openModal } from 'flavours/glitch/actions/modal'; -import { expandAccountMediaTimeline } from 'flavours/glitch/actions/timelines'; import { LoadMore } from 'flavours/glitch/components/load_more'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; -import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import Column from 'flavours/glitch/features/ui/components/column'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; import { getAccountGallery } from 'flavours/glitch/selectors'; +import { expandAccountMediaTimeline } from '../../actions/timelines'; +import HeaderContainer from '../account_timeline/containers/header_container'; +import Column from '../ui/components/column'; + import MediaItem from './components/media_item'; const mapStateToProps = (state, { params: { acct, id } }) => { diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx index 717114d5c6..c38c1efa1b 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx @@ -2,18 +2,20 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -import { NavLink } from 'react-router-dom'; +import { NavLink, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import ActionBar from 'flavours/glitch/features/account/components/action_bar'; -import InnerHeader from 'flavours/glitch/features/account/components/header'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; + +import ActionBar from '../../account/components/action_bar'; +import InnerHeader from '../../account/components/header'; import MemorialNote from './memorial_note'; import MovedNote from './moved_note'; -export default class Header extends ImmutablePureComponent { +class Header extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, @@ -34,10 +36,7 @@ export default class Header extends ImmutablePureComponent { hideTabs: PropTypes.bool, domain: PropTypes.string.isRequired, hidden: PropTypes.bool, - }; - - static contextTypes = { - router: PropTypes.object, + ...WithRouterPropTypes, }; handleFollow = () => { @@ -49,11 +48,11 @@ export default class Header extends ImmutablePureComponent { }; handleMention = () => { - this.props.onMention(this.props.account, this.context.router.history); + this.props.onMention(this.props.account, this.props.history); }; handleDirect = () => { - this.props.onDirect(this.props.account, this.context.router.history); + this.props.onDirect(this.props.account, this.props.history); }; handleReport = () => { @@ -162,3 +161,5 @@ export default class Header extends ImmutablePureComponent { } } + +export default withRouter(Header); diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx index 5ea37a5d31..d28ad77c55 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { revealAccount } from 'flavours/glitch/actions/accounts'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { domain } from 'flavours/glitch/initial_state'; const mapDispatchToProps = (dispatch, { accountId }) => ({ diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx index 2e10ea94af..5d32f5a90f 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx @@ -1,30 +1,28 @@ -import PropTypes from 'prop-types'; - import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Icon } from 'flavours/glitch/components/icon'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import AvatarOverlay from '../../../components/avatar_overlay'; import { DisplayName } from '../../../components/display_name'; -export default class MovedNote extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; +class MovedNote extends ImmutablePureComponent { static propTypes = { from: ImmutablePropTypes.map.isRequired, to: ImmutablePropTypes.map.isRequired, + ...WithRouterPropTypes, }; handleAccountClick = e => { if (e.button === 0) { e.preventDefault(); - this.context.router.history.push(`/@${this.props.to.get('acct')}`); + this.props.history.push(`/@${this.props.to.get('acct')}`); } e.stopPropagation(); @@ -50,3 +48,5 @@ export default class MovedNote extends ImmutablePureComponent { } } + +export default withRouter(MovedNote); diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx index 75b254b095..5bd0a23d3d 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx @@ -2,7 +2,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; -import { initEditAccountNote } from 'flavours/glitch/actions/account_notes'; +import { initEditAccountNote } from '../../../actions/account_notes'; import { followAccount, unfollowAccount, @@ -10,19 +10,18 @@ import { unmuteAccount, pinAccount, unpinAccount, -} from 'flavours/glitch/actions/accounts'; -import { initBlockModal } from 'flavours/glitch/actions/blocks'; +} from '../../../actions/accounts'; +import { initBlockModal } from '../../../actions/blocks'; import { mentionCompose, directCompose, -} from 'flavours/glitch/actions/compose'; -import { blockDomain, unblockDomain } from 'flavours/glitch/actions/domain_blocks'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { initMuteModal } from 'flavours/glitch/actions/mutes'; -import { initReport } from 'flavours/glitch/actions/reports'; -import { unfollowModal } from 'flavours/glitch/initial_state'; -import { makeGetAccount, getAccountHidden } from 'flavours/glitch/selectors'; - +} from '../../../actions/compose'; +import { blockDomain, unblockDomain } from '../../../actions/domain_blocks'; +import { openModal } from '../../../actions/modal'; +import { initMuteModal } from '../../../actions/mutes'; +import { initReport } from '../../../actions/reports'; +import { unfollowModal } from '../../../initial_state'; +import { makeGetAccount, getAccountHidden } from '../../../selectors'; import Header from '../components/header'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.jsx b/app/javascript/flavours/glitch/features/account_timeline/index.jsx index 03c989e969..45a599f24c 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/index.jsx @@ -7,13 +7,13 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; -import { lookupAccount, fetchAccount } from 'flavours/glitch/actions/accounts'; import { TimelineHint } from 'flavours/glitch/components/timeline_hint'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; import { getAccountHidden } from 'flavours/glitch/selectors'; +import { lookupAccount, fetchAccount } from '../../actions/accounts'; import { fetchFeaturedTags } from '../../actions/featured_tags'; import { expandAccountFeaturedTimeline, expandAccountTimeline } from '../../actions/timelines'; import { LoadingIndicator } from '../../components/loading_indicator'; @@ -23,13 +23,6 @@ import Column from '../ui/components/column'; import LimitedAccountHint from './components/limited_account_hint'; import HeaderContainer from './containers/header_container'; - - - - - - - const emptyList = ImmutableList(); const mapStateToProps = (state, { params: { acct, id, tagged }, withReplies = false }) => { diff --git a/app/javascript/flavours/glitch/features/audio/index.jsx b/app/javascript/flavours/glitch/features/audio/index.jsx index 80c8af134a..5b9f38ecb1 100644 --- a/app/javascript/flavours/glitch/features/audio/index.jsx +++ b/app/javascript/flavours/glitch/features/audio/index.jsx @@ -9,15 +9,14 @@ import { is } from 'immutable'; import { throttle, debounce } from 'lodash'; -import { Blurhash } from 'flavours/glitch/components/blurhash'; import { Icon } from 'flavours/glitch/components/icon'; import { formatTime, getPointerPosition, fileNameFromURL } from 'flavours/glitch/features/video'; -import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; + +import { Blurhash } from '../../components/blurhash'; +import { displayMedia, useBlurhash } from '../../initial_state'; import Visualizer from './visualizer'; - - const messages = defineMessages({ play: { id: 'video.play', defaultMessage: 'Play' }, pause: { id: 'video.pause', defaultMessage: 'Pause' }, diff --git a/app/javascript/flavours/glitch/features/blocks/index.jsx b/app/javascript/flavours/glitch/features/blocks/index.jsx index aa5479b208..ac5ebfd46e 100644 --- a/app/javascript/flavours/glitch/features/blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/blocks/index.jsx @@ -8,13 +8,12 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchBlocks, expandBlocks } from 'flavours/glitch/actions/blocks'; -import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import Column from 'flavours/glitch/features/ui/components/column'; - +import { fetchBlocks, expandBlocks } from '../../actions/blocks'; +import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { LoadingIndicator } from '../../components/loading_indicator'; import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.blocks', defaultMessage: 'Blocked users' }, diff --git a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js index dbfc4594e1..1e9f121394 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { changeColumnParams } from 'flavours/glitch/actions/columns'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { changeColumnParams } from '../../../actions/columns'; +import { changeSetting } from '../../../actions/settings'; import ColumnSettings from '../components/column_settings'; const mapStateToProps = (state, { columnId }) => { diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.jsx b/app/javascript/flavours/glitch/features/community_timeline/index.jsx index b65e41637c..e894cb932f 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/community_timeline/index.jsx @@ -7,15 +7,16 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; -import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; -import { connectCommunityStream } from 'flavours/glitch/actions/streaming'; -import { expandCommunityTimeline } from 'flavours/glitch/actions/timelines'; -import Column from 'flavours/glitch/components/column'; -import ColumnHeader from 'flavours/glitch/components/column_header'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; -import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import { domain } from 'flavours/glitch/initial_state'; +import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; +import { connectCommunityStream } from '../../actions/streaming'; +import { expandCommunityTimeline } from '../../actions/timelines'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import StatusListContainer from '../ui/containers/status_list_container'; + import ColumnSettingsContainer from './containers/column_settings_container'; const messages = defineMessages({ @@ -44,7 +45,6 @@ class CommunityTimeline extends PureComponent { }; static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; diff --git a/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx b/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx index 5f00da52c4..3efa2edf0a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx @@ -1,8 +1,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; export default class AutosuggestAccount extends ImmutablePureComponent { @@ -14,8 +14,8 @@ export default class AutosuggestAccount extends ImmutablePureComponent { const { account } = this.props; return ( -
-
+
+
); diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx index 73a060ef7f..38b8d48c1a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx @@ -9,6 +9,7 @@ import { length } from 'stringz'; import { maxChars } from 'flavours/glitch/initial_state'; import { isMobile } from 'flavours/glitch/is_mobile'; +import { WithOptionalRouterPropTypes, withOptionalRouter } from 'flavours/glitch/utils/react_router'; import AutosuggestInput from '../../../components/autosuggest_input'; import AutosuggestTextarea from '../../../components/autosuggest_textarea'; @@ -39,14 +40,9 @@ const messages = defineMessages({ }); class ComposeForm extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { intl: PropTypes.object.isRequired, - text: PropTypes.string, + text: PropTypes.string.isRequired, suggestions: ImmutablePropTypes.list, spoiler: PropTypes.bool, privacy: PropTypes.string, @@ -71,7 +67,6 @@ class ComposeForm extends ImmutablePureComponent { isInReply: PropTypes.bool, singleColumn: PropTypes.bool, lang: PropTypes.string, - advancedOptions: ImmutablePropTypes.map, layout: PropTypes.string, media: ImmutablePropTypes.list, @@ -83,6 +78,7 @@ class ComposeForm extends ImmutablePureComponent { onChangeSpoilerness: PropTypes.func, onChangeVisibility: PropTypes.func, onMediaDescriptionConfirm: PropTypes.func, + ...WithOptionalRouterPropTypes }; static defaultProps = { @@ -130,12 +126,12 @@ class ComposeForm extends ImmutablePureComponent { // Submit unless there are media with missing descriptions if (mediaDescriptionConfirmation && onMediaDescriptionConfirm && media && media.some(item => !item.get('description'))) { const firstWithoutDescription = media.find(item => !item.get('description')); - onMediaDescriptionConfirm(this.context.router ? this.context.router.history : null, firstWithoutDescription.get('id'), overriddenVisibility); + onMediaDescriptionConfirm(this.props.history || null, firstWithoutDescription.get('id'), overriddenVisibility); } else if (onSubmit) { if (onChangeVisibility && overriddenVisibility) { onChangeVisibility(overriddenVisibility); } - onSubmit(this.context.router ? this.context.router.history : null); + onSubmit(this.props.history || null); } }; @@ -392,4 +388,4 @@ class ComposeForm extends ImmutablePureComponent { } -export default injectIntl(ComposeForm); +export default withOptionalRouter(injectIntl(ComposeForm)); diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx index d60ce0f216..2683aeb472 100644 --- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx @@ -105,12 +105,12 @@ class ModifierPickerMenu extends PureComponent { return (
- - - - - - + + + + + +
); } diff --git a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx index 383a9db528..059c3fd6e4 100644 --- a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx @@ -5,10 +5,11 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; import Permalink from 'flavours/glitch/components/permalink'; import { profileLink } from 'flavours/glitch/utils/backend_links'; +import { Avatar } from '../../../components/avatar'; + import ActionBar from './action_bar'; export default class NavigationBar extends ImmutablePureComponent { diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx index 2ba9f6db64..9f35e13941 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx @@ -9,7 +9,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AutosuggestInput from 'flavours/glitch/components/autosuggest_input'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import { pollLimits } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx index d0f13cc33c..06775230fe 100644 --- a/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { defineMessages, injectIntl } from 'react-intl'; +import { injectIntl, defineMessages } from 'react-intl'; import Dropdown from './dropdown'; diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.jsx b/app/javascript/flavours/glitch/features/compose/components/publisher.jsx index b509ed3473..67e17401d2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.jsx @@ -8,7 +8,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { length } from 'stringz'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { Icon } from 'flavours/glitch/components/icon'; import { maxChars } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx index 83ceb7779d..64242c3a4b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx @@ -1,4 +1,3 @@ -// Package imports. import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; @@ -6,37 +5,38 @@ import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -// Components. import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { Icon } from 'flavours/glitch/components/icon'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import AccountContainer from 'flavours/glitch/containers/account_container'; +import { WithOptionalRouterPropTypes, withOptionalRouter } from 'flavours/glitch/utils/react_router'; + +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import { Icon } from '../../../components/icon'; +import { IconButton } from '../../../components/icon_button'; -// Messages. const messages = defineMessages({ - cancel: { - defaultMessage: 'Cancel', - id: 'reply_indicator.cancel', - }, + cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, }); - class ReplyIndicator extends ImmutablePureComponent { static propTypes = { status: ImmutablePropTypes.map, + onCancel: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, - onCancel: PropTypes.func, + ...WithOptionalRouterPropTypes, }; handleClick = () => { - const { onCancel } = this.props; - if (onCancel) { - onCancel(); + this.props.onCancel(); + }; + + handleAccountClick = (e) => { + if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { + e.preventDefault(); + this.props.history?.push(`/@${this.props.status.getIn(['account', 'acct'])}`); } }; - // Rendering. render () { const { status, intl } = this.props; @@ -44,45 +44,36 @@ class ReplyIndicator extends ImmutablePureComponent { return null; } - const account = status.get('account'); - const content = status.get('content'); - const attachments = status.get('media_attachments'); + const content = { __html: status.get('contentHtml') }; - // The result. return ( -
+
); } } -export default injectIntl(ReplyIndicator); +export default withOptionalRouter(injectIntl(ReplyIndicator)); diff --git a/app/javascript/flavours/glitch/features/compose/components/search.jsx b/app/javascript/flavours/glitch/features/compose/components/search.jsx index a06b83f6f2..ed717f215b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/search.jsx @@ -4,14 +4,14 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage, FormattedList } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; - -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { domain, searchEnabled } from 'flavours/glitch/initial_state'; -import { focusRoot } from 'flavours/glitch/utils/dom_helpers'; import { HASHTAG_REGEX } from 'flavours/glitch/utils/hashtags'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const messages = defineMessages({ placeholder: { id: 'search.placeholder', defaultMessage: 'Search' }, @@ -32,7 +32,6 @@ const labelForRecentSearch = search => { class Search extends PureComponent { static contextTypes = { - router: PropTypes.object.isRequired, identity: PropTypes.object.isRequired, }; @@ -50,6 +49,7 @@ class Search extends PureComponent { openInRoute: PropTypes.bool, intl: PropTypes.object.isRequired, singleColumn: PropTypes.bool, + ...WithRouterPropTypes, }; state = { @@ -82,13 +82,9 @@ class Search extends PureComponent { }; handleClear = e => { - const { - onClear, - submitted, - value, - } = this.props; + const { value, submitted, onClear } = this.props; - e.preventDefault(); // Prevents focus change ?? + e.preventDefault(); if (value.length > 0 || submitted) { onClear(); @@ -122,8 +118,7 @@ class Search extends PureComponent { switch(e.key) { case 'Escape': e.preventDefault(); - - focusRoot(); + this._unfocus(); break; case 'ArrowDown': @@ -161,6 +156,7 @@ class Search extends PureComponent { search.forget(e); } } + break; } }; @@ -170,32 +166,29 @@ class Search extends PureComponent { }; handleHashtagClick = () => { - const { router } = this.context; - const { value, onClickSearchResult } = this.props; + const { value, onClickSearchResult, history } = this.props; const query = value.trim().replace(/^#/, ''); - router.history.push(`/tags/${query}`); + history.push(`/tags/${query}`); onClickSearchResult(query, 'hashtag'); this._unfocus(); }; handleAccountClick = () => { - const { router } = this.context; - const { value, onClickSearchResult } = this.props; + const { value, onClickSearchResult, history } = this.props; const query = value.trim().replace(/^@/, ''); - router.history.push(`/@${query}`); + history.push(`/@${query}`); onClickSearchResult(query, 'account'); this._unfocus(); }; handleURLClick = () => { - const { router } = this.context; - const { onOpenURL } = this.props; + const { onOpenURL, history } = this.props; - onOpenURL(router.history); + onOpenURL(history); this._unfocus(); }; @@ -208,13 +201,12 @@ class Search extends PureComponent { }; handleRecentSearchClick = search => { - const { onChange } = this.props; - const { router } = this.context; + const { onChange, history } = this.props; if (search.get('type') === 'account') { - router.history.push(`/@${search.get('q')}`); + history.push(`/@${search.get('q')}`); } else if (search.get('type') === 'hashtag') { - router.history.push(`/tags/${search.get('q')}`); + history.push(`/tags/${search.get('q')}`); } else { onChange(search.get('q')); this._submit(search.get('type')); @@ -246,8 +238,7 @@ class Search extends PureComponent { } _submit (type) { - const { onSubmit, openInRoute, value, onClickSearchResult } = this.props; - const { router } = this.context; + const { onSubmit, openInRoute, value, onClickSearchResult, history } = this.props; onSubmit(type); @@ -256,7 +247,7 @@ class Search extends PureComponent { } if (openInRoute) { - router.history.push('/search'); + history.push('/search'); } this._unfocus(); @@ -348,6 +339,7 @@ class Search extends PureComponent {
+
{options.length === 0 && ( <> @@ -367,6 +359,7 @@ class Search extends PureComponent {
)} + {options.length > 0 && ( <>

@@ -403,4 +396,4 @@ class Search extends PureComponent { } -export default injectIntl(Search); +export default withRouter(injectIntl(Search)); diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.jsx b/app/javascript/flavours/glitch/features/compose/components/search_results.jsx index a9687ffef5..e8379a9326 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.jsx @@ -5,13 +5,14 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { ImmutableHashtag as Hashtag } from 'flavours/glitch/components/hashtag'; import { Icon } from 'flavours/glitch/components/icon'; import { LoadMore } from 'flavours/glitch/components/load_more'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import StatusContainer from 'flavours/glitch/containers/status_container'; import { SearchSection } from 'flavours/glitch/features/explore/components/search_section'; +import { ImmutableHashtag as Hashtag } from '../../../components/hashtag'; +import AccountContainer from '../../../containers/account_container'; +import StatusContainer from '../../../containers/status_container'; + const INITIAL_PAGE_LIMIT = 10; const withoutLastResult = list => { diff --git a/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx b/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx index 780e063b2e..166d022b88 100644 --- a/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx @@ -22,13 +22,13 @@ export default class TextIconButton extends PureComponent { return ( diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.jsx b/app/javascript/flavours/glitch/features/compose/components/upload.jsx index 5685759f8d..ca0b32e526 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/upload.jsx @@ -7,16 +7,12 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import spring from 'react-motion/lib/spring'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import Motion from '../../ui/util/optional_motion'; export default class Upload extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { media: ImmutablePropTypes.map.isRequired, onUndo: PropTypes.func.isRequired, diff --git a/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx b/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx index 928446c728..cda57d2d85 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx @@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl'; import spring from 'react-motion/lib/spring'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import Motion from '../../ui/util/optional_motion'; diff --git a/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js b/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js index 87362a4af4..f86f01bd97 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/autosuggest_account_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { makeGetAccount } from 'flavours/glitch/selectors'; - +import { makeGetAccount } from '../../../selectors'; import AutosuggestAccount from '../components/autosuggest_account'; const makeMapStateToProps = () => { diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index e9724568cd..adc68840b3 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -2,24 +2,24 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; +import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; + import { changeCompose, + submitCompose, + clearComposeSuggestions, + fetchComposeSuggestions, + selectComposeSuggestion, changeComposeSpoilerText, changeComposeSpoilerness, changeComposeVisibility, - clearComposeSuggestions, - fetchComposeSuggestions, insertEmojiCompose, - selectComposeSuggestion, - submitCompose, uploadCompose, -} from 'flavours/glitch/actions/compose'; -import { changeLocalSetting } from 'flavours/glitch/actions/local_settings'; +} from '../../../actions/compose'; +import { changeLocalSetting } from '../../../actions/local_settings'; import { openModal, -} from 'flavours/glitch/actions/modal'; -import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; - +} from '../../../actions/modal'; import ComposeForm from '../components/compose_form'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js b/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js index c06c52c14e..a0e50029df 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/emoji_picker_dropdown_container.js @@ -2,9 +2,8 @@ import { Map as ImmutableMap } from 'immutable'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { useEmoji } from 'flavours/glitch/actions/emojis'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { useEmoji } from '../../../actions/emojis'; +import { changeSetting } from '../../../actions/settings'; import EmojiPickerDropdown from '../components/emoji_picker_dropdown'; const perLine = 8; diff --git a/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js b/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js index 541365aa99..459fffd910 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/navigation_container.js @@ -3,9 +3,9 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { openModal } from 'flavours/glitch/actions/modal'; -import { me } from 'flavours/glitch/initial_state'; import { logOut } from 'flavours/glitch/utils/log_out'; +import { me } from '../../../initial_state'; import NavigationBar from '../components/navigation_bar'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js index cc8f341a3a..177ffcea6a 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js @@ -8,8 +8,7 @@ import { clearComposeSuggestions, fetchComposeSuggestions, selectComposeSuggestion, -} from 'flavours/glitch/actions/compose'; - +} from '../../../actions/compose'; import PollForm from '../components/poll_form'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js b/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js index dcbd977dae..6d26abf4f6 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/privacy_dropdown_container.js @@ -1,9 +1,8 @@ import { connect } from 'react-redux'; -import { changeComposeVisibility } from 'flavours/glitch/actions/compose'; -import { openModal, closeModal } from 'flavours/glitch/actions/modal'; -import { isUserTouching } from 'flavours/glitch/is_mobile'; - +import { changeComposeVisibility } from '../../../actions/compose'; +import { openModal, closeModal } from '../../../actions/modal'; +import { isUserTouching } from '../../../is_mobile'; import PrivacyDropdown from '../components/privacy_dropdown'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js b/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js index 61012bcb1e..1147e448af 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js @@ -1,10 +1,12 @@ import { connect } from 'react-redux'; -import { cancelReplyCompose } from 'flavours/glitch/actions/compose'; - +import { cancelReplyCompose } from '../../../actions/compose'; +import { makeGetStatus } from '../../../selectors'; import ReplyIndicator from '../components/reply_indicator'; const makeMapStateToProps = () => { + const getStatus = makeGetStatus(); + const mapStateToProps = state => { let statusId = state.getIn(['compose', 'id'], null); let editing = true; @@ -15,7 +17,7 @@ const makeMapStateToProps = () => { } return { - status: state.getIn(['statuses', statusId]), + status: getStatus(state, { id: statusId }), editing, }; }; diff --git a/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx index 931f396b35..5a57332dd9 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx +++ b/app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx @@ -62,8 +62,6 @@ class SensitiveButton extends PureComponent { disabled={disabled} /> - - ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx index 16916ba9c0..f339ccdfbf 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx +++ b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx @@ -10,7 +10,6 @@ import { HASHTAG_PATTERN_REGEX } from 'flavours/glitch/utils/hashtags'; import Warning from '../components/warning'; - const mapStateToProps = state => ({ needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']), hashtagWarning: state.getIn(['compose', 'privacy']) !== 'public' && HASHTAG_PATTERN_REGEX.test(state.getIn(['compose', 'text'])), diff --git a/app/javascript/flavours/glitch/features/compose/index.jsx b/app/javascript/flavours/glitch/features/compose/index.jsx index 39ef19ef59..86d5f31485 100644 --- a/app/javascript/flavours/glitch/features/compose/index.jsx +++ b/app/javascript/flavours/glitch/features/compose/index.jsx @@ -12,8 +12,8 @@ import spring from 'react-motion/lib/spring'; import { mountCompose, unmountCompose, cycleElefriendCompose } from 'flavours/glitch/actions/compose'; import Column from 'flavours/glitch/components/column'; -import { mascot } from 'flavours/glitch/initial_state'; +import { mascot } from '../../initial_state'; import Motion from '../ui/util/optional_motion'; import ComposeFormContainer from './containers/compose_form_container'; diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx index 0a2262f281..0fdd175560 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -17,6 +18,7 @@ import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp import StatusContent from 'flavours/glitch/components/status_content'; import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container'; import { autoPlayGif } from 'flavours/glitch/initial_state'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const messages = defineMessages({ more: { id: 'status.more', defaultMessage: 'More' }, @@ -30,10 +32,6 @@ const messages = defineMessages({ class Conversation extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { conversationId: PropTypes.string.isRequired, accounts: ImmutablePropTypes.list.isRequired, @@ -45,6 +43,7 @@ class Conversation extends ImmutablePureComponent { markRead: PropTypes.func.isRequired, delete: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; state = { @@ -52,9 +51,8 @@ class Conversation extends ImmutablePureComponent { }; parseClick = (e, destination) => { - const { router } = this.context; - const { lastStatus, unread, markRead } = this.props; - if (!router) return; + const { history, lastStatus, unread, markRead } = this.props; + if (!history) return; if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) { if (destination === undefined) { @@ -63,7 +61,7 @@ class Conversation extends ImmutablePureComponent { } destination = `/statuses/${lastStatus.get('id')}`; } - router.history.push(destination); + history.push(destination); e.preventDefault(); } }; @@ -95,7 +93,7 @@ class Conversation extends ImmutablePureComponent { }; handleClick = () => { - if (!this.context.router) { + if (!this.props.history) { return; } @@ -105,7 +103,7 @@ class Conversation extends ImmutablePureComponent { markRead(); } - this.context.router.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`); + this.props.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`); }; handleMarkAsRead = () => { @@ -113,7 +111,7 @@ class Conversation extends ImmutablePureComponent { }; handleReply = () => { - this.props.reply(this.props.lastStatus, this.context.router.history); + this.props.reply(this.props.lastStatus, this.props.history); }; handleDelete = () => { @@ -232,4 +230,4 @@ class Conversation extends ImmutablePureComponent { } -export default injectIntl(Conversation); +export default withRouter(injectIntl(Conversation)); diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx index 03e523bfd6..8c12ea9e5f 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx @@ -5,8 +5,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { debounce } from 'lodash'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; - +import ScrollableList from '../../../components/scrollable_list'; import ConversationContainer from '../containers/conversation_container'; export default class ConversationsList extends ImmutablePureComponent { diff --git a/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js b/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js index d0298c7233..1dcd3ec1bd 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { expandConversations } from 'flavours/glitch/actions/conversations'; - +import { expandConversations } from '../../../actions/conversations'; import ConversationsList from '../components/conversations_list'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/directory/components/account_card.jsx b/app/javascript/flavours/glitch/features/directory/components/account_card.jsx index 10dc7b6262..92fa84201e 100644 --- a/app/javascript/flavours/glitch/features/directory/components/account_card.jsx +++ b/app/javascript/flavours/glitch/features/directory/components/account_card.jsx @@ -16,7 +16,7 @@ import { } from 'flavours/glitch/actions/accounts'; import { openModal } from 'flavours/glitch/actions/modal'; import { Avatar } from 'flavours/glitch/components/avatar'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { DisplayName } from 'flavours/glitch/components/display_name'; import { IconButton } from 'flavours/glitch/components/icon_button'; import Permalink from 'flavours/glitch/components/permalink'; diff --git a/app/javascript/flavours/glitch/features/directory/index.jsx b/app/javascript/flavours/glitch/features/directory/index.jsx index e1db3180fa..92e80bf956 100644 --- a/app/javascript/flavours/glitch/features/directory/index.jsx +++ b/app/javascript/flavours/glitch/features/directory/index.jsx @@ -36,10 +36,6 @@ const mapStateToProps = state => ({ class Directory extends PureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { isLoading: PropTypes.bool, accountIds: ImmutablePropTypes.list.isRequired, diff --git a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx index c492552c02..9e63b2f817 100644 --- a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx @@ -10,18 +10,13 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; - import { fetchDomainBlocks, expandDomainBlocks } from '../../actions/domain_blocks'; import ColumnBackButtonSlim from '../../components/column_back_button_slim'; import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; import DomainContainer from '../../containers/domain_container'; import Column from '../ui/components/column'; - - - - const messages = defineMessages({ heading: { id: 'column.domain_blocks', defaultMessage: 'Blocked domains' }, unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' }, @@ -38,7 +33,7 @@ class Blocks extends ImmutablePureComponent { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, hasMore: PropTypes.bool, - domains: ImmutablePropTypes.list, + domains: ImmutablePropTypes.orderedSet, intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, }; diff --git a/app/javascript/flavours/glitch/features/emoji/emoji.js b/app/javascript/flavours/glitch/features/emoji/emoji.js index 465966f87c..1e6aae2394 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji.js @@ -1,9 +1,10 @@ import Trie from 'substring-trie'; -import { autoPlayGif, useSystemEmojiFont } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; -import unicodeMapping from './emoji_unicode_mapping_light'; +import { autoPlayGif, useSystemEmojiFont } from '../../initial_state'; + +import { unicodeMapping } from './emoji_unicode_mapping_light'; const trie = new Trie(Object.keys(unicodeMapping)); @@ -137,7 +138,6 @@ const emojify = (str, customEmojis = {}) => { }; export default emojify; -export { unicodeMapping }; export const buildCustomEmojis = (customEmojis) => { const emojis = []; diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.d.ts b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.d.ts index 96e0cc5eaf..dc009b26b0 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.d.ts +++ b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.d.ts @@ -13,15 +13,20 @@ export type Search = string; * This could be a potential area of refactoring or error handling. * The non-existence of 'skins' property is evident at [this location]{@link app/javascript/flavours/glitch/features/emoji/emoji_compressed.js:121}. */ -export type Skins = null; +type Skins = null; -export type FilenameData = string[] | string[][]; +type Filename = string; +type UnicodeFilename = string; +export type FilenameData = [ + filename: Filename, + unicodeFilename?: UnicodeFilename, +][]; export type ShortCodesToEmojiDataKey = | EmojiData['id'] | BaseEmoji['native'] | keyof NimbleEmojiIndex['emojis']; -export type SearchData = [ +type SearchData = [ BaseEmoji['native'], Emoji['short_names'], Search, @@ -32,9 +37,9 @@ export type ShortCodesToEmojiData = Record< ShortCodesToEmojiDataKey, [FilenameData, SearchData] >; -export type EmojisWithoutShortCodes = FilenameData[]; +type EmojisWithoutShortCodes = FilenameData; -export type EmojiCompressed = [ +type EmojiCompressed = [ ShortCodesToEmojiData, Skins, Category[], diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js index 6af8a93e54..70ac5e176f 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js @@ -93,7 +93,7 @@ Object.keys(emojiIndex.emojis).forEach(key => { let { short_names, search, unified } = emojiMartData.emojis[key]; if (short_names[0] !== key) { - throw new Error('The compresser expects the first short_code to be the ' + + throw new Error('The compressor expects the first short_code to be the ' + 'key. It may need to be rewritten if the emoji change such that this ' + 'is no longer the case.'); } diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_mart_data_light.ts b/app/javascript/flavours/glitch/features/emoji/emoji_mart_data_light.ts index 142605b4bc..ffca1f8b06 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_mart_data_light.ts +++ b/app/javascript/flavours/glitch/features/emoji/emoji_mart_data_light.ts @@ -30,22 +30,13 @@ const emojis: Emojis = {}; // decompress Object.keys(shortCodesToEmojiData).forEach((shortCode) => { const [_filenameData, searchData] = shortCodesToEmojiData[shortCode]; - const native = searchData[0]; - let short_names = searchData[1]; - const search = searchData[2]; - let unified = searchData[3]; + const [native, short_names, search, unified] = searchData; - if (!unified) { - // unified name can be derived from unicodeToUnifiedName - unified = unicodeToUnifiedName(native); - } - - if (short_names) short_names = [shortCode].concat(short_names); emojis[shortCode] = { native, search, - short_names, - unified, + short_names: short_names ? [shortCode].concat(short_names) : undefined, + unified: unified ?? unicodeToUnifiedName(native), }; }); diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.js b/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.js deleted file mode 100644 index 3e3834580d..0000000000 --- a/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.js +++ /dev/null @@ -1,37 +0,0 @@ -// A mapping of unicode strings to an object containing the filename -// (i.e. the svg filename) and a shortCode intended to be shown -// as a "title" attribute in an HTML element (aka tooltip). - -import emojiCompressed from './emoji_compressed'; -import { unicodeToFilename } from './unicode_to_filename'; - -const [ - shortCodesToEmojiData, - _skins, - _categories, - _short_names, - emojisWithoutShortCodes, -] = emojiCompressed; - -// decompress -const unicodeMapping = {}; - -function processEmojiMapData(emojiMapData, shortCode) { - let [ native, filename ] = emojiMapData; - if (!filename) { - // filename name can be derived from unicodeToFilename - filename = unicodeToFilename(native); - } - unicodeMapping[native] = { - shortCode: shortCode, - filename: filename, - }; -} - -Object.keys(shortCodesToEmojiData).forEach((shortCode) => { - let [ filenameData ] = shortCodesToEmojiData[shortCode]; - filenameData.forEach(emojiMapData => processEmojiMapData(emojiMapData, shortCode)); -}); -emojisWithoutShortCodes.forEach(emojiMapData => processEmojiMapData(emojiMapData)); - -export default unicodeMapping; diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts b/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts new file mode 100644 index 0000000000..191419496f --- /dev/null +++ b/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts @@ -0,0 +1,60 @@ +// A mapping of unicode strings to an object containing the filename +// (i.e. the svg filename) and a shortCode intended to be shown +// as a "title" attribute in an HTML element (aka tooltip). + +import type { + FilenameData, + ShortCodesToEmojiDataKey, +} from './emoji_compressed'; +import emojiCompressed from './emoji_compressed'; +import { unicodeToFilename } from './unicode_to_filename'; + +type UnicodeMapping = { + [key in FilenameData[number][0]]: { + shortCode: ShortCodesToEmojiDataKey; + filename: FilenameData[number][number]; + }; +}; + +const [ + shortCodesToEmojiData, + _skins, + _categories, + _short_names, + emojisWithoutShortCodes, +] = emojiCompressed; + +// decompress +const unicodeMapping: UnicodeMapping = {}; + +function processEmojiMapData( + emojiMapData: FilenameData[number], + shortCode?: ShortCodesToEmojiDataKey, +) { + const [native, _filename] = emojiMapData; + let filename = emojiMapData[1]; + if (!filename) { + // filename name can be derived from unicodeToFilename + filename = unicodeToFilename(native); + } + unicodeMapping[native] = { + shortCode, + filename, + }; +} + +Object.keys(shortCodesToEmojiData).forEach( + (shortCode: ShortCodesToEmojiDataKey) => { + if (shortCode === undefined) return; + const [filenameData, _searchData] = shortCodesToEmojiData[shortCode]; + filenameData.forEach((emojiMapData) => { + processEmojiMapData(emojiMapData, shortCode); + }); + }, +); + +emojisWithoutShortCodes.forEach((emojiMapData) => { + processEmojiMapData(emojiMapData); +}); + +export { unicodeMapping }; diff --git a/app/javascript/flavours/glitch/features/explore/components/story.jsx b/app/javascript/flavours/glitch/features/explore/components/story.jsx index 8dc92a4d91..0e5ab92122 100644 --- a/app/javascript/flavours/glitch/features/explore/components/story.jsx +++ b/app/javascript/flavours/glitch/features/explore/components/story.jsx @@ -11,7 +11,6 @@ import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp import { ShortNumber } from 'flavours/glitch/components/short_number'; import { Skeleton } from 'flavours/glitch/components/skeleton'; - export default class Story extends PureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/explore/index.jsx b/app/javascript/flavours/glitch/features/explore/index.jsx index 4a916c9958..27c544af0f 100644 --- a/app/javascript/flavours/glitch/features/explore/index.jsx +++ b/app/javascript/flavours/glitch/features/explore/index.jsx @@ -19,8 +19,6 @@ import Statuses from './statuses'; import Suggestions from './suggestions'; import Tags from './tags'; - - const messages = defineMessages({ title: { id: 'explore.title', defaultMessage: 'Explore' }, searchResults: { id: 'explore.search_results', defaultMessage: 'Search results' }, @@ -34,7 +32,6 @@ const mapStateToProps = state => ({ class Explore extends PureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -69,47 +66,45 @@ class Explore extends PureComponent {
-
- {isSearching ? ( - - ) : ( - <> -
- - + {isSearching ? ( + + ) : ( + <> +
+ + + + + + + + + {signedIn && ( + + + )} - - - + + + +
- {signedIn && ( - - - - )} + + + + + + + + - - - -
- - - - - - - - - - - - {intl.formatMessage(messages.title)} - - - - )} -
+ + {intl.formatMessage(messages.title)} + + + + )} ); } diff --git a/app/javascript/flavours/glitch/features/explore/links.jsx b/app/javascript/flavours/glitch/features/explore/links.jsx index 9124285f4f..5dee66d183 100644 --- a/app/javascript/flavours/glitch/features/explore/links.jsx +++ b/app/javascript/flavours/glitch/features/explore/links.jsx @@ -3,12 +3,15 @@ import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { fetchTrendingLinks } from 'flavours/glitch/actions/trends'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import Story from './components/story'; @@ -23,10 +26,17 @@ class Links extends PureComponent { links: ImmutablePropTypes.list, isLoading: PropTypes.bool, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, links, history } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && links.size > 0) { + return; + } + dispatch(fetchTrendingLinks()); } @@ -52,7 +62,7 @@ class Links extends PureComponent { } return ( -
+
{banner} {isLoading ? () : links.map((link, i) => ( @@ -77,4 +87,4 @@ class Links extends PureComponent { } -export default connect(mapStateToProps)(Links); +export default connect(mapStateToProps)(withRouter(Links)); diff --git a/app/javascript/flavours/glitch/features/explore/results.jsx b/app/javascript/flavours/glitch/features/explore/results.jsx index b7e9d22ee7..ccdd50c1e9 100644 --- a/app/javascript/flavours/glitch/features/explore/results.jsx +++ b/app/javascript/flavours/glitch/features/explore/results.jsx @@ -204,7 +204,7 @@ class Results extends PureComponent {
-
+
({ statusIds: getStatusList(state, 'trending'), @@ -27,10 +31,17 @@ class Statuses extends PureComponent { hasMore: PropTypes.bool, multiColumn: PropTypes.bool, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, statusIds, history } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && statusIds.size > 0) { + return; + } + dispatch(fetchTrendingStatuses()); } @@ -45,27 +56,23 @@ class Statuses extends PureComponent { const emptyMessage = ; return ( - <> - - - - - - + } + alwaysPrepend + timelineId='explore' + statusIds={statusIds} + scrollKey='explore-statuses' + hasMore={hasMore} + isLoading={isLoading} + onLoadMore={this.handleLoadMore} + emptyMessage={emptyMessage} + bindToDocument={!multiColumn} + withCounters + /> ); } } -export default connect(mapStateToProps)(Statuses); +export default connect(mapStateToProps)(withRouter(Statuses)); diff --git a/app/javascript/flavours/glitch/features/explore/suggestions.jsx b/app/javascript/flavours/glitch/features/explore/suggestions.jsx index dbe135920d..1590e19aba 100644 --- a/app/javascript/flavours/glitch/features/explore/suggestions.jsx +++ b/app/javascript/flavours/glitch/features/explore/suggestions.jsx @@ -3,12 +3,15 @@ import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { fetchSuggestions, dismissSuggestion } from 'flavours/glitch/actions/suggestions'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import AccountCard from 'flavours/glitch/features/directory/components/account_card'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const mapStateToProps = state => ({ suggestions: state.getIn(['suggestions', 'items']), @@ -21,10 +24,17 @@ class Suggestions extends PureComponent { isLoading: PropTypes.bool, suggestions: ImmutablePropTypes.list, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, suggestions, history } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && suggestions.size > 0) { + return; + } + dispatch(fetchSuggestions(true)); } @@ -47,7 +57,7 @@ class Suggestions extends PureComponent { } return ( -
+
{isLoading ? : suggestions.map(suggestion => ( ))} @@ -57,4 +67,4 @@ class Suggestions extends PureComponent { } -export default connect(mapStateToProps)(Suggestions); +export default connect(mapStateToProps)(withRouter(Suggestions)); diff --git a/app/javascript/flavours/glitch/features/explore/tags.jsx b/app/javascript/flavours/glitch/features/explore/tags.jsx index 043cb6c796..5f88a79eb6 100644 --- a/app/javascript/flavours/glitch/features/explore/tags.jsx +++ b/app/javascript/flavours/glitch/features/explore/tags.jsx @@ -3,6 +3,8 @@ import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; @@ -10,8 +12,7 @@ import { fetchTrendingHashtags } from 'flavours/glitch/actions/trends'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; import { ImmutableHashtag as Hashtag } from 'flavours/glitch/components/hashtag'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; - - +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const mapStateToProps = state => ({ hashtags: state.getIn(['trends', 'tags', 'items']), @@ -24,10 +25,17 @@ class Tags extends PureComponent { hashtags: ImmutablePropTypes.list, isLoading: PropTypes.bool, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, history, hashtags } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && hashtags.size > 0) { + return; + } + dispatch(fetchTrendingHashtags()); } @@ -53,7 +61,7 @@ class Tags extends PureComponent { } return ( -
+
{banner} {isLoading ? () : hashtags.map(hashtag => ( @@ -65,4 +73,4 @@ class Tags extends PureComponent { } -export default connect(mapStateToProps)(Tags); +export default connect(mapStateToProps)(withRouter(Tags)); diff --git a/app/javascript/flavours/glitch/features/favourites/index.jsx b/app/javascript/flavours/glitch/features/favourites/index.jsx index 49fd62b966..ef24b7c79f 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.jsx +++ b/app/javascript/flavours/glitch/features/favourites/index.jsx @@ -12,13 +12,12 @@ import { debounce } from 'lodash'; import { fetchFavourites, expandFavourites } from 'flavours/glitch/actions/interactions'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import ScrollableList from 'flavours/glitch/components/scrollable_list'; import AccountContainer from 'flavours/glitch/containers/account_container'; import Column from 'flavours/glitch/features/ui/components/column'; - const messages = defineMessages({ heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' }, refresh: { id: 'refresh', defaultMessage: 'Refresh' }, diff --git a/app/javascript/flavours/glitch/features/filters/added_to_filter.jsx b/app/javascript/flavours/glitch/features/filters/added_to_filter.jsx index 743d379474..25615b662a 100644 --- a/app/javascript/flavours/glitch/features/filters/added_to_filter.jsx +++ b/app/javascript/flavours/glitch/features/filters/added_to_filter.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { toServerSideType } from 'flavours/glitch/utils/filters'; const mapStateToProps = (state, { filterId }) => ({ diff --git a/app/javascript/flavours/glitch/features/filters/select_filter.jsx b/app/javascript/flavours/glitch/features/filters/select_filter.jsx index bae1d9ef95..de74fb240b 100644 --- a/app/javascript/flavours/glitch/features/filters/select_filter.jsx +++ b/app/javascript/flavours/glitch/features/filters/select_filter.jsx @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import fuzzysort from 'fuzzysort'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { toServerSideType } from 'flavours/glitch/utils/filters'; import { loupeIcon, deleteIcon } from 'flavours/glitch/utils/icons'; diff --git a/app/javascript/flavours/glitch/features/firehose/index.jsx b/app/javascript/flavours/glitch/features/firehose/index.jsx index 3cdeda97c1..c01c767b86 100644 --- a/app/javascript/flavours/glitch/features/firehose/index.jsx +++ b/app/javascript/flavours/glitch/features/firehose/index.jsx @@ -188,33 +188,31 @@ const Firehose = ({ feedType, multiColumn }) => { -
-
- - - +
+ + + - - - + + + - - - -
- - + + +
+ + {intl.formatMessage(messages.title)} diff --git a/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx b/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx index 194784a7a5..04fc2b06bc 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx +++ b/app/javascript/flavours/glitch/features/follow_recommendations/index.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { Helmet } from 'react-helmet'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -12,8 +13,9 @@ import { requestBrowserPermission } from 'flavours/glitch/actions/notifications' import { changeSetting, saveSettings } from 'flavours/glitch/actions/settings'; import { fetchSuggestions } from 'flavours/glitch/actions/suggestions'; import { markAsPartial } from 'flavours/glitch/actions/timelines'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import Column from 'flavours/glitch/features/ui/components/column'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import imageGreeting from 'mastodon/../images/elephant_ui_greeting.svg'; import Account from './components/account'; @@ -25,14 +27,11 @@ const mapStateToProps = state => ({ class FollowRecommendations extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object.isRequired, - }; - static propTypes = { dispatch: PropTypes.func.isRequired, suggestions: ImmutablePropTypes.list, isLoading: PropTypes.bool, + ...WithRouterPropTypes, }; componentDidMount () { @@ -56,8 +55,7 @@ class FollowRecommendations extends ImmutablePureComponent { } handleDone = () => { - const { dispatch } = this.props; - const { router } = this.context; + const { history, dispatch } = this.props; dispatch(requestBrowserPermission((permission) => { if (permission === 'granted') { @@ -71,7 +69,7 @@ class FollowRecommendations extends ImmutablePureComponent { } })); - router.history.push('/home'); + history.push('/home'); }; render () { @@ -118,4 +116,4 @@ class FollowRecommendations extends ImmutablePureComponent { } -export default connect(mapStateToProps)(FollowRecommendations); +export default withRouter(connect(mapStateToProps)(FollowRecommendations)); diff --git a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx index 1f665c0496..54a75dca70 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx +++ b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx @@ -5,10 +5,10 @@ import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import Permalink from 'flavours/glitch/components/permalink'; +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import { IconButton } from '../../../components/icon_button'; +import Permalink from '../../../components/permalink'; const messages = defineMessages({ authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' }, diff --git a/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js b/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js index 854ebaecb8..c9c8dd7d87 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js +++ b/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { authorizeFollowRequest, rejectFollowRequest } from 'flavours/glitch/actions/accounts'; -import { makeGetAccount } from 'flavours/glitch/selectors'; - +import { authorizeFollowRequest, rejectFollowRequest } from '../../../actions/accounts'; +import { makeGetAccount } from '../../../selectors'; import AccountAuthorize from '../components/account_authorize'; const makeMapStateToProps = () => { diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.jsx b/app/javascript/flavours/glitch/features/follow_requests/index.jsx index 70a2ac1e42..f5ff56d98e 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.jsx +++ b/app/javascript/flavours/glitch/features/follow_requests/index.jsx @@ -10,19 +10,14 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchFollowRequests, expandFollowRequests } from 'flavours/glitch/actions/accounts'; -import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import Column from 'flavours/glitch/features/ui/components/column'; -import { me } from 'flavours/glitch/initial_state'; +import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts'; +import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import ScrollableList from '../../components/scrollable_list'; +import { me } from '../../initial_state'; +import Column from '../ui/components/column'; import AccountAuthorizeContainer from './containers/account_authorize_container'; - - - - - const messages = defineMessages({ heading: { id: 'column.follow_requests', defaultMessage: 'Follow requests' }, }); @@ -74,7 +69,6 @@ class FollowRequests extends ImmutablePureComponent { return ( - { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); diff --git a/app/javascript/flavours/glitch/features/following/index.jsx b/app/javascript/flavours/glitch/features/following/index.jsx index 498aa4fbe5..4ff59f6358 100644 --- a/app/javascript/flavours/glitch/features/following/index.jsx +++ b/app/javascript/flavours/glitch/features/following/index.jsx @@ -8,24 +8,24 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; +import { TimelineHint } from 'flavours/glitch/components/timeline_hint'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; +import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; +import { getAccountHidden } from 'flavours/glitch/selectors'; + import { lookupAccount, fetchAccount, fetchFollowing, expandFollowing, -} from 'flavours/glitch/actions/accounts'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import { TimelineHint } from 'flavours/glitch/components/timeline_hint'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; -import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; -import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import Column from 'flavours/glitch/features/ui/components/column'; -import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; -import { getAccountHidden } from 'flavours/glitch/selectors'; - +} from '../../actions/accounts'; +import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import ProfileColumnHeader from '../account/components/profile_column_header'; import LimitedAccountHint from '../account_timeline/components/limited_account_hint'; +import HeaderContainer from '../account_timeline/containers/header_container'; +import Column from '../ui/components/column'; const mapStateToProps = (state, { params: { acct, id } }) => { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); diff --git a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx index fd17f8c9d7..5d1a518ccb 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx +++ b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx @@ -4,6 +4,7 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage, FormattedDate } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -13,30 +14,25 @@ import spring from 'react-motion/lib/spring'; import ReactSwipeableViews from 'react-swipeable-views'; import { AnimatedNumber } from 'flavours/glitch/components/animated_number'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import EmojiPickerDropdown from 'flavours/glitch/features/compose/containers/emoji_picker_dropdown_container'; -import unicodeMapping from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; +import { unicodeMapping } from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; import { autoPlayGif, reduceMotion, disableSwiping, mascot } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import elephantUIPlane from 'mastodon/../images/elephant_ui_plane.svg'; - - const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, previous: { id: 'lightbox.previous', defaultMessage: 'Previous' }, next: { id: 'lightbox.next', defaultMessage: 'Next' }, }); -class Content extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - +class ContentWithRouter extends ImmutablePureComponent { static propTypes = { announcement: ImmutablePropTypes.map.isRequired, + ...WithRouterPropTypes, }; setRef = c => { @@ -91,25 +87,25 @@ class Content extends ImmutablePureComponent { } onMentionClick = (mention, e) => { - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/@${mention.get('acct')}`); + this.props.history.push(`/@${mention.get('acct')}`); } }; onHashtagClick = (hashtag, e) => { hashtag = hashtag.replace(/^#/, ''); - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.props.history&& e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/tags/${hashtag}`); + this.props.history.push(`/tags/${hashtag}`); } }; onStatusClick = (status, e) => { - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); + this.props.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); } }; @@ -155,6 +151,8 @@ class Content extends ImmutablePureComponent { } +const Content = withRouter(ContentWithRouter); + class Emoji extends PureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/getting_started/index.jsx b/app/javascript/flavours/glitch/features/getting_started/index.jsx index 9a8ee3f091..e803c4949c 100644 --- a/app/javascript/flavours/glitch/features/getting_started/index.jsx +++ b/app/javascript/flavours/glitch/features/getting_started/index.jsx @@ -14,17 +14,16 @@ import { fetchFollowRequests } from 'flavours/glitch/actions/accounts'; import { fetchLists } from 'flavours/glitch/actions/lists'; import { openModal } from 'flavours/glitch/actions/modal'; import Column from 'flavours/glitch/features/ui/components/column'; -import ColumnLink from 'flavours/glitch/features/ui/components/column_link'; -import ColumnSubheading from 'flavours/glitch/features/ui/components/column_subheading'; import LinkFooter from 'flavours/glitch/features/ui/components/link_footer'; -import { me, showTrends } from 'flavours/glitch/initial_state'; import { preferencesLink } from 'flavours/glitch/utils/backend_links'; +import { me, showTrends } from '../../initial_state'; import NavigationBar from '../compose/components/navigation_bar'; +import ColumnLink from '../ui/components/column_link'; +import ColumnSubheading from '../ui/components/column_subheading'; import TrendsContainer from './containers/trends_container'; - const messages = defineMessages({ heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, @@ -88,7 +87,6 @@ const badgeDisplay = (number, limit) => { class GettingStarted extends ImmutablePureComponent { static contextTypes = { - router: PropTypes.object.isRequired, identity: PropTypes.object, }; diff --git a/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx b/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx index d7500fd822..2c2fbc05c0 100644 --- a/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx +++ b/app/javascript/flavours/glitch/features/getting_started_misc/index.jsx @@ -28,7 +28,6 @@ const messages = defineMessages({ class GettingStartedMisc extends ImmutablePureComponent { static contextTypes = { - router: PropTypes.object.isRequired, identity: PropTypes.object, }; diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx b/app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx index 986bf80b51..47854d72be 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx @@ -4,7 +4,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { ShortNumber } from 'flavours/glitch/components/short_number'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js index 6e67d1fce4..be95004cc7 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { changeColumnParams } from 'flavours/glitch/actions/columns'; -import api from 'flavours/glitch/api'; - +import { changeColumnParams } from '../../../actions/columns'; +import api from '../../../api'; import ColumnSettings from '../components/column_settings'; const mapStateToProps = (state, { columnId }) => { diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx b/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx index 675c4cc022..b2bf169da8 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx @@ -16,7 +16,8 @@ import { fetchHashtag, followHashtag, unfollowHashtag } from 'flavours/glitch/ac import { expandHashtagTimeline, clearTimeline } from 'flavours/glitch/actions/timelines'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; + +import StatusListContainer from '../ui/containers/status_list_container'; import { HashtagHeader } from './components/hashtag_header'; import ColumnSettingsContainer from './containers/column_settings_container'; diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx index 1afa852cfb..7cdd58a12a 100644 --- a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx +++ b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx @@ -11,8 +11,8 @@ import { throttle, escapeRegExp } from 'lodash'; import { openModal, closeModal } from 'flavours/glitch/actions/modal'; import api from 'flavours/glitch/api'; -import Button from 'flavours/glitch/components/button'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Button } from 'flavours/glitch/components/button'; +import { Icon } from 'flavours/glitch/components/icon'; import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state'; const messages = defineMessages({ @@ -34,7 +34,7 @@ const mapDispatchToProps = (dispatch) => ({ }, }); -const PERSISTENCE_KEY = 'flavours/glitch_home'; +const PERSISTENCE_KEY = 'mastodon_home'; const isValidDomain = value => { const url = new URL('https:///path'); diff --git a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx index c12368ac09..da5d334245 100644 --- a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx @@ -10,7 +10,6 @@ import { connect } from 'react-redux'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; - const messages = defineMessages({ heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' }, }); diff --git a/app/javascript/flavours/glitch/features/list_adder/components/account.jsx b/app/javascript/flavours/glitch/features/list_adder/components/account.jsx index 4dc9c1f893..31a2e96379 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/account.jsx +++ b/app/javascript/flavours/glitch/features/list_adder/components/account.jsx @@ -8,7 +8,6 @@ import { Avatar } from '../../../components/avatar'; import { DisplayName } from '../../../components/display_name'; import { makeGetAccount } from '../../../selectors'; - const makeMapStateToProps = () => { const getAccount = makeGetAccount(); @@ -19,7 +18,6 @@ const makeMapStateToProps = () => { return mapStateToProps; }; - class Account extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx index 83a5ecb91f..f99958fd27 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx +++ b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx @@ -6,10 +6,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { removeFromListAdder, addToListAdder } from '../../../actions/lists'; -import { IconButton } from '../../../components/icon_button'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/components/account.jsx b/app/javascript/flavours/glitch/features/list_editor/components/account.jsx index 01c0444153..91a2bdb79d 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/account.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/account.jsx @@ -5,10 +5,9 @@ import { defineMessages } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; -import { IconButton } from 'flavours/glitch/components/icon_button'; - +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx index 5c4fff27b5..9e087a97d7 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx @@ -5,8 +5,8 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { changeListEditorTitle, submitListEditor } from 'flavours/glitch/actions/lists'; -import { IconButton } from 'flavours/glitch/components/icon_button'; +import { changeListEditorTitle, submitListEditor } from '../../../actions/lists'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ title: { id: 'lists.edit.submit', defaultMessage: 'Change title' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx index a43b3b969e..43c0358ba6 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx @@ -5,7 +5,7 @@ import { defineMessages } from 'react-intl'; import classNames from 'classnames'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; const messages = defineMessages({ search: { id: 'lists.search', defaultMessage: 'Search among people you follow' }, diff --git a/app/javascript/flavours/glitch/features/list_editor/index.jsx b/app/javascript/flavours/glitch/features/list_editor/index.jsx index 134d5ff074..dca690a3ec 100644 --- a/app/javascript/flavours/glitch/features/list_editor/index.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/index.jsx @@ -8,8 +8,7 @@ import { connect } from 'react-redux'; import spring from 'react-motion/lib/spring'; -import { setupListEditor, clearListSuggestions, resetListEditor } from 'flavours/glitch/actions/lists'; - +import { setupListEditor, clearListSuggestions, resetListEditor } from '../../actions/lists'; import Motion from '../ui/util/optional_motion'; import EditListForm from './components/edit_list_form'; diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.jsx b/app/javascript/flavours/glitch/features/list_timeline/index.jsx index d407e8a6ea..b7c80b1671 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/list_timeline/index.jsx @@ -4,6 +4,7 @@ import { PureComponent } from 'react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Helmet } from 'react-helmet'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; @@ -17,11 +18,12 @@ import { connectListStream } from 'flavours/glitch/actions/streaming'; import { expandListTimeline } from 'flavours/glitch/actions/timelines'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import { RadioButton } from 'flavours/glitch/components/radio_button'; import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const messages = defineMessages({ deleteMessage: { id: 'confirmations.delete_list.message', defaultMessage: 'Are you sure you want to permanently delete this list?' }, @@ -38,10 +40,6 @@ const mapStateToProps = (state, props) => ({ class ListTimeline extends PureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, @@ -50,6 +48,7 @@ class ListTimeline extends PureComponent { multiColumn: PropTypes.bool, list: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]), intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; handlePin = () => { @@ -59,7 +58,7 @@ class ListTimeline extends PureComponent { dispatch(removeColumn(columnId)); } else { dispatch(addColumn('LIST', { id: this.props.params.id })); - this.context.router.history.push('/'); + this.props.history.push('/'); } }; @@ -137,7 +136,7 @@ class ListTimeline extends PureComponent { if (columnId) { dispatch(removeColumn(columnId)); } else { - this.context.router.history.push('/lists'); + this.props.history.push('/lists'); } }, }, @@ -242,4 +241,4 @@ class ListTimeline extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(ListTimeline)); +export default withRouter(connect(mapStateToProps)(injectIntl(ListTimeline))); diff --git a/app/javascript/flavours/glitch/features/mutes/index.jsx b/app/javascript/flavours/glitch/features/mutes/index.jsx index b3c2ed38b0..f9c42378a5 100644 --- a/app/javascript/flavours/glitch/features/mutes/index.jsx +++ b/app/javascript/flavours/glitch/features/mutes/index.jsx @@ -10,15 +10,12 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchMutes, expandMutes } from 'flavours/glitch/actions/mutes'; -import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import Column from 'flavours/glitch/features/ui/components/column'; - - - +import { fetchMutes, expandMutes } from '../../actions/mutes'; +import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.mutes', defaultMessage: 'Muted users' }, @@ -51,7 +48,7 @@ class Mutes extends ImmutablePureComponent { }, 300, { leading: true }); render () { - const { intl, accountIds, hasMore, multiColumn, isLoading } = this.props; + const { intl, hasMore, accountIds, multiColumn, isLoading } = this.props; if (!accountIds) { return ( diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx b/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx index 9f63b3ce79..213f319fc9 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx @@ -1,25 +1,24 @@ -// Package imports. import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { HotKeys } from 'react-hotkeys'; - -// Our imports. import { Icon } from 'flavours/glitch/components/icon'; import Permalink from 'flavours/glitch/components/permalink'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import NotificationOverlayContainer from '../containers/overlay_container'; import Report from './report'; -export default class AdminReport extends ImmutablePureComponent { +class AdminReport extends ImmutablePureComponent { static propTypes = { hidden: PropTypes.bool, @@ -28,6 +27,7 @@ export default class AdminReport extends ImmutablePureComponent { notification: ImmutablePropTypes.map.isRequired, unread: PropTypes.bool, report: ImmutablePropTypes.map.isRequired, + ...WithRouterPropTypes, }; handleMoveUp = () => { @@ -45,15 +45,15 @@ export default class AdminReport extends ImmutablePureComponent { }; handleOpenProfile = () => { - const { notification } = this.props; - this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); + const { history, notification } = this.props; + history.push(`/@${notification.getIn(['account', 'acct'])}`); }; handleMention = e => { e.preventDefault(); - const { notification, onMention } = this.props; - onMention(notification.get('account'), this.context.router.history); + const { history, notification, onMention } = this.props; + onMention(notification.get('account'), history); }; getHandlers () { @@ -111,3 +111,5 @@ export default class AdminReport extends ImmutablePureComponent { } } + +export default withRouter(AdminReport); diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx index 8036f783a7..9d9a5f0c06 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx @@ -1,24 +1,23 @@ -// Package imports. import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { HotKeys } from 'react-hotkeys'; - -// Our imports. import { Icon } from 'flavours/glitch/components/icon'; import Permalink from 'flavours/glitch/components/permalink'; import AccountContainer from 'flavours/glitch/containers/account_container'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import NotificationOverlayContainer from '../containers/overlay_container'; -export default class NotificationFollow extends ImmutablePureComponent { +class NotificationAdminSignup extends ImmutablePureComponent { static propTypes = { hidden: PropTypes.bool, @@ -26,6 +25,7 @@ export default class NotificationFollow extends ImmutablePureComponent { account: ImmutablePropTypes.map.isRequired, notification: ImmutablePropTypes.map.isRequired, unread: PropTypes.bool, + ...WithRouterPropTypes, }; handleMoveUp = () => { @@ -43,15 +43,15 @@ export default class NotificationFollow extends ImmutablePureComponent { }; handleOpenProfile = () => { - const { notification } = this.props; - this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); + const { history, notification } = this.props; + history.push(`/@${notification.getIn(['account', 'acct'])}`); }; handleMention = e => { e.preventDefault(); - const { notification, onMention } = this.props; - onMention(notification.get('account'), this.context.router.history); + const { history, notification, onMention } = this.props; + onMention(notification.get('account'), history); }; getHandlers () { @@ -104,3 +104,5 @@ export default class NotificationFollow extends ImmutablePureComponent { } } + +export default withRouter(NotificationAdminSignup); diff --git a/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx b/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx index 0833ac29d7..c75bdf8ad4 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx @@ -3,7 +3,7 @@ import { Component } from 'react'; import { FormattedMessage } from 'react-intl'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; export default class ClearColumnButton extends Component { diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx index 7f4df1d92d..04247226ac 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; const tooltips = defineMessages({ mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' }, diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow.jsx b/app/javascript/flavours/glitch/features/notifications/components/follow.jsx index 7e2749d66d..06603d8e3e 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/follow.jsx @@ -1,24 +1,23 @@ -// Package imports. import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { HotKeys } from 'react-hotkeys'; - -// Our imports. import { Icon } from 'flavours/glitch/components/icon'; import Permalink from 'flavours/glitch/components/permalink'; import AccountContainer from 'flavours/glitch/containers/account_container'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import NotificationOverlayContainer from '../containers/overlay_container'; -export default class NotificationFollow extends ImmutablePureComponent { +class NotificationFollow extends ImmutablePureComponent { static propTypes = { hidden: PropTypes.bool, @@ -26,6 +25,7 @@ export default class NotificationFollow extends ImmutablePureComponent { account: ImmutablePropTypes.map.isRequired, notification: ImmutablePropTypes.map.isRequired, unread: PropTypes.bool, + ...WithRouterPropTypes, }; handleMoveUp = () => { @@ -43,15 +43,15 @@ export default class NotificationFollow extends ImmutablePureComponent { }; handleOpenProfile = () => { - const { notification } = this.props; - this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); + const { history, notification } = this.props; + history.push(`/@${notification.getIn(['account', 'acct'])}`); }; handleMention = e => { e.preventDefault(); - const { notification, onMention } = this.props; - onMention(notification.get('account'), this.context.router.history); + const { history, notification, onMention } = this.props; + onMention(notification.get('account'), history); }; getHandlers () { @@ -104,3 +104,5 @@ export default class NotificationFollow extends ImmutablePureComponent { } } + +export default withRouter(NotificationFollow); diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx b/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx index d5ae9dd3f3..831095200a 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -14,6 +15,7 @@ import { DisplayName } from 'flavours/glitch/components/display_name'; import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import Permalink from 'flavours/glitch/components/permalink'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import NotificationOverlayContainer from '../containers/overlay_container'; @@ -31,6 +33,7 @@ class FollowRequest extends ImmutablePureComponent { intl: PropTypes.object.isRequired, notification: ImmutablePropTypes.map.isRequired, unread: PropTypes.bool, + ...WithRouterPropTypes, }; handleMoveUp = () => { @@ -48,15 +51,15 @@ class FollowRequest extends ImmutablePureComponent { }; handleOpenProfile = () => { - const { notification } = this.props; - this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); + const { history, notification } = this.props; + history.push(`/@${notification.getIn(['account', 'acct'])}`); }; handleMention = e => { e.preventDefault(); - const { notification, onMention } = this.props; - onMention(notification.get('account'), this.context.router.history); + const { history, notification, onMention } = this.props; + onMention(notification.get('account'), history); }; getHandlers () { @@ -135,4 +138,4 @@ class FollowRequest extends ImmutablePureComponent { } -export default injectIntl(FollowRequest); +export default withRouter(injectIntl(FollowRequest)); diff --git a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx index b088935285..53bf1747a1 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx @@ -7,12 +7,10 @@ import { connect } from 'react-redux'; import { requestBrowserPermission } from 'flavours/glitch/actions/notifications'; import { changeSetting } from 'flavours/glitch/actions/settings'; -import Button from 'flavours/glitch/components/button'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Button } from 'flavours/glitch/components/button'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; - - const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); diff --git a/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js index cc3793fccc..b63796a8b2 100644 --- a/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js @@ -2,12 +2,11 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { showAlert } from 'flavours/glitch/actions/alerts'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { setFilter, clearNotifications, requestBrowserPermission } from 'flavours/glitch/actions/notifications'; -import { changeAlerts as changePushNotifications } from 'flavours/glitch/actions/push_notifications'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { showAlert } from '../../../actions/alerts'; +import { openModal } from '../../../actions/modal'; +import { setFilter, clearNotifications, requestBrowserPermission } from '../../../actions/notifications'; +import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications'; +import { changeSetting } from '../../../actions/settings'; import ColumnSettings from '../components/column_settings'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/notifications/containers/notification_container.js b/app/javascript/flavours/glitch/features/notifications/containers/notification_container.js index b39d1169f2..2fda4ac3a2 100644 --- a/app/javascript/flavours/glitch/features/notifications/containers/notification_container.js +++ b/app/javascript/flavours/glitch/features/notifications/containers/notification_container.js @@ -1,7 +1,5 @@ -// Package imports. import { connect } from 'react-redux'; -// Our imports. import { mentionCompose } from 'flavours/glitch/actions/compose'; import { makeGetNotification } from 'flavours/glitch/selectors'; @@ -19,8 +17,8 @@ const makeMapStateToProps = () => { }; const mapDispatchToProps = dispatch => ({ - onMention: (account, router) => { - dispatch(mentionCompose(account, router)); + onMention: (account, history) => { + dispatch(mentionCompose(account, history)); }, }); diff --git a/app/javascript/flavours/glitch/features/notifications/index.jsx b/app/javascript/flavours/glitch/features/notifications/index.jsx index d84d29f112..6d42f27697 100644 --- a/app/javascript/flavours/glitch/features/notifications/index.jsx +++ b/app/javascript/flavours/glitch/features/notifications/index.jsx @@ -13,8 +13,12 @@ import { createSelector } from 'reselect'; import { debounce } from 'lodash'; -import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; -import { submitMarkers } from 'flavours/glitch/actions/markers'; +import { compareId } from 'flavours/glitch/compare_id'; +import { Icon } from 'flavours/glitch/components/icon'; +import { NotSignedInIndicator } from 'flavours/glitch/components/not_signed_in_indicator'; + +import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; +import { submitMarkers } from '../../actions/markers'; import { enterNotificationClearingMode, expandNotifications, @@ -23,26 +27,18 @@ import { mountNotifications, unmountNotifications, markNotificationsAsRead, -} from 'flavours/glitch/actions/notifications'; -import { compareId } from 'flavours/glitch/compare_id'; -import Column from 'flavours/glitch/components/column'; -import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; -import { LoadGap } from 'flavours/glitch/components/load_gap'; -import { NotSignedInIndicator } from 'flavours/glitch/components/not_signed_in_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import NotificationPurgeButtonsContainer from 'flavours/glitch/containers/notification_purge_buttons_container'; +} from '../../actions/notifications'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import { LoadGap } from '../../components/load_gap'; +import ScrollableList from '../../components/scrollable_list'; +import NotificationPurgeButtonsContainer from '../../containers/notification_purge_buttons_container'; import NotificationsPermissionBanner from './components/notifications_permission_banner'; import ColumnSettingsContainer from './containers/column_settings_container'; import FilterBarContainer from './containers/filter_bar_container'; import NotificationContainer from './containers/notification_container'; - - - - - const messages = defineMessages({ title: { id: 'column.notifications', defaultMessage: 'Notifications' }, enterNotifCleaning : { id: 'notification_purge.start', defaultMessage: 'Enter notification cleaning mode' }, diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx index 77574dea09..51d7c10668 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -15,6 +16,7 @@ import { openModal } from 'flavours/glitch/actions/modal'; import { IconButton } from 'flavours/glitch/components/icon_button'; import { me, boostModal } from 'flavours/glitch/initial_state'; import { makeGetStatus } from 'flavours/glitch/selectors'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const messages = defineMessages({ reply: { id: 'status.reply', defaultMessage: 'Reply' }, @@ -44,7 +46,6 @@ const makeMapStateToProps = () => { class Footer extends ImmutablePureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -57,17 +58,17 @@ class Footer extends ImmutablePureComponent { showReplyCount: PropTypes.bool, withOpenButton: PropTypes.bool, onClose: PropTypes.func, + ...WithRouterPropTypes, }; _performReply = () => { - const { dispatch, status, onClose } = this.props; - const { router } = this.context; + const { dispatch, status, onClose, history } = this.props; if (onClose) { onClose(true); } - dispatch(replyCompose(status, router.history)); + dispatch(replyCompose(status, history)); }; handleReplyClick = () => { @@ -151,9 +152,7 @@ class Footer extends ImmutablePureComponent { }; handleOpenClick = e => { - const { router } = this.context; - - if (e.button !== 0 || !router) { + if (e.button !== 0 || !history) { return; } @@ -163,7 +162,7 @@ class Footer extends ImmutablePureComponent { onClose(); } - router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); + history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); }; render () { @@ -229,4 +228,4 @@ class Footer extends ImmutablePureComponent { } -export default connect(makeMapStateToProps)(injectIntl(Footer)); +export default withRouter(connect(makeMapStateToProps)(injectIntl(Footer))); diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx index d58d77d7ab..7a2902bbf0 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx @@ -12,8 +12,6 @@ import { Avatar } from 'flavours/glitch/components/avatar'; import { DisplayName } from 'flavours/glitch/components/display_name'; import { IconButton } from 'flavours/glitch/components/icon_button'; - - const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); diff --git a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx index 2d083a90ec..82684c8368 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx +++ b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx @@ -5,8 +5,8 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import SettingText from 'flavours/glitch/components/setting_text'; -import SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle'; +import SettingText from '../../../components/setting_text'; +import SettingToggle from '../../notifications/components/setting_toggle'; const messages = defineMessages({ filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }, diff --git a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js index b884f15f5f..6476d51ffb 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js @@ -1,8 +1,7 @@ import { connect } from 'react-redux'; -import { changeColumnParams } from 'flavours/glitch/actions/columns'; -import { changeSetting } from 'flavours/glitch/actions/settings'; - +import { changeColumnParams } from '../../../actions/columns'; +import { changeSetting } from '../../../actions/settings'; import ColumnSettings from '../components/column_settings'; const mapStateToProps = (state, { columnId }) => { diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.jsx b/app/javascript/flavours/glitch/features/public_timeline/index.jsx index 83ada8d3c0..8c373d99ab 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/public_timeline/index.jsx @@ -7,15 +7,16 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; -import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; -import { connectPublicStream } from 'flavours/glitch/actions/streaming'; -import { expandPublicTimeline } from 'flavours/glitch/actions/timelines'; -import Column from 'flavours/glitch/components/column'; -import ColumnHeader from 'flavours/glitch/components/column_header'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; -import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import { domain } from 'flavours/glitch/initial_state'; +import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; +import { connectPublicStream } from '../../actions/streaming'; +import { expandPublicTimeline } from '../../actions/timelines'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import StatusListContainer from '../ui/containers/status_list_container'; + import ColumnSettingsContainer from './containers/column_settings_container'; const messages = defineMessages({ @@ -43,13 +44,12 @@ const mapStateToProps = (state, { columnId }) => { class PublicTimeline extends PureComponent { - static defaultProps = { - onlyMedia: false, + static contextTypes = { + identity: PropTypes.object, }; - static contextTypes = { - router: PropTypes.object, - identity: PropTypes.object, + static defaultProps = { + onlyMedia: false, }; static propTypes = { diff --git a/app/javascript/flavours/glitch/features/reblogs/index.jsx b/app/javascript/flavours/glitch/features/reblogs/index.jsx index 8cc4c004f0..9e656f4852 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.jsx +++ b/app/javascript/flavours/glitch/features/reblogs/index.jsx @@ -10,13 +10,14 @@ import { connect } from 'react-redux'; import { debounce } from 'lodash'; -import { fetchReblogs, expandReblogs } from 'flavours/glitch/actions/interactions'; -import ColumnHeader from 'flavours/glitch/components/column_header'; -import { Icon } from 'flavours/glitch/components/icon'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import ScrollableList from 'flavours/glitch/components/scrollable_list'; -import AccountContainer from 'flavours/glitch/containers/account_container'; -import Column from 'flavours/glitch/features/ui/components/column'; +import { Icon } from 'flavours/glitch/components/icon'; + +import { fetchReblogs, expandReblogs } from '../../actions/interactions'; +import ColumnHeader from '../../components/column_header'; +import { LoadingIndicator } from '../../components/loading_indicator'; +import ScrollableList from '../../components/scrollable_list'; +import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.reblogged_by', defaultMessage: 'Boosted by' }, diff --git a/app/javascript/flavours/glitch/features/report/category.jsx b/app/javascript/flavours/glitch/features/report/category.jsx index e734058fac..9a3cc549e1 100644 --- a/app/javascript/flavours/glitch/features/report/category.jsx +++ b/app/javascript/flavours/glitch/features/report/category.jsx @@ -7,7 +7,7 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import Option from './components/option'; diff --git a/app/javascript/flavours/glitch/features/report/comment.jsx b/app/javascript/flavours/glitch/features/report/comment.jsx index a7305e8f3e..81efa7b5f7 100644 --- a/app/javascript/flavours/glitch/features/report/comment.jsx +++ b/app/javascript/flavours/glitch/features/report/comment.jsx @@ -11,7 +11,7 @@ import { createSelector } from 'reselect'; import Toggle from 'react-toggle'; import { fetchAccount } from 'flavours/glitch/actions/accounts'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { useAppDispatch, useAppSelector } from 'flavours/glitch/store'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/report/rules.jsx b/app/javascript/flavours/glitch/features/report/rules.jsx index 7a2aa59bd8..96903f1dec 100644 --- a/app/javascript/flavours/glitch/features/report/rules.jsx +++ b/app/javascript/flavours/glitch/features/report/rules.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import Option from './components/option'; diff --git a/app/javascript/flavours/glitch/features/report/statuses.jsx b/app/javascript/flavours/glitch/features/report/statuses.jsx index c1650c8dce..192f6b216b 100644 --- a/app/javascript/flavours/glitch/features/report/statuses.jsx +++ b/app/javascript/flavours/glitch/features/report/statuses.jsx @@ -7,11 +7,10 @@ import { OrderedSet } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; import StatusCheckBox from 'flavours/glitch/features/report/containers/status_check_box_container'; - const mapStateToProps = (state, { accountId }) => ({ availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])), isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']), diff --git a/app/javascript/flavours/glitch/features/report/thanks.jsx b/app/javascript/flavours/glitch/features/report/thanks.jsx index fb16e6c80a..7782022b77 100644 --- a/app/javascript/flavours/glitch/features/report/thanks.jsx +++ b/app/javascript/flavours/glitch/features/report/thanks.jsx @@ -11,7 +11,7 @@ import { muteAccount, blockAccount, } from 'flavours/glitch/actions/accounts'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; const mapStateToProps = () => ({}); diff --git a/app/javascript/flavours/glitch/features/standalone/compose/index.jsx b/app/javascript/flavours/glitch/features/standalone/compose/index.jsx index 8ffd98d4ec..c36e843f5a 100644 --- a/app/javascript/flavours/glitch/features/standalone/compose/index.jsx +++ b/app/javascript/flavours/glitch/features/standalone/compose/index.jsx @@ -1,9 +1,9 @@ import { PureComponent } from 'react'; -import ComposeFormContainer from 'flavours/glitch/features/compose/containers/compose_form_container'; -import LoadingBarContainer from 'flavours/glitch/features/ui/containers/loading_bar_container'; -import ModalContainer from 'flavours/glitch/features/ui/containers/modal_container'; -import NotificationsContainer from 'flavours/glitch/features/ui/containers/notifications_container'; +import ComposeFormContainer from '../../compose/containers/compose_form_container'; +import LoadingBarContainer from '../../ui/containers/loading_bar_container'; +import ModalContainer from '../../ui/containers/modal_container'; +import NotificationsContainer from '../../ui/containers/notifications_container'; export default class Compose extends PureComponent { diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.jsx b/app/javascript/flavours/glitch/features/status/components/action_bar.jsx index 750c371a6b..b42d5c21c2 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.jsx @@ -4,14 +4,17 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container'; -import { me } from 'flavours/glitch/initial_state'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions'; import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; + +import { IconButton } from '../../../components/icon_button'; +import DropdownMenuContainer from '../../../containers/dropdown_menu_container'; +import { me } from '../../../initial_state'; const messages = defineMessages({ delete: { id: 'status.delete', defaultMessage: 'Delete' }, @@ -47,7 +50,6 @@ const messages = defineMessages({ class ActionBar extends PureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -69,6 +71,7 @@ class ActionBar extends PureComponent { onPin: PropTypes.func, onEmbed: PropTypes.func, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; handleReplyClick = () => { @@ -92,23 +95,23 @@ class ActionBar extends PureComponent { } handleDeleteClick = () => { - this.props.onDelete(this.props.status, this.context.router.history); + this.props.onDelete(this.props.status, this.props.history); }; handleRedraftClick = () => { - this.props.onDelete(this.props.status, this.context.router.history, true); + this.props.onDelete(this.props.status, this.props.history, true); }; handleEditClick = () => { - this.props.onEdit(this.props.status, this.context.router.history); + this.props.onEdit(this.props.status, this.props.history); }; handleDirectClick = () => { - this.props.onDirect(this.props.status.get('account'), this.context.router.history); + this.props.onDirect(this.props.status.get('account'), this.props.history); }; handleMentionClick = () => { - this.props.onMention(this.props.status.get('account'), this.context.router.history); + this.props.onMention(this.props.status.get('account'), this.props.history); }; handleMuteClick = () => { @@ -241,4 +244,4 @@ class ActionBar extends PureComponent { } -export default injectIntl(ActionBar); +export default withRouter(injectIntl(ActionBar)); diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx index b8690e33d3..8519ff18ac 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx @@ -3,38 +3,33 @@ import PropTypes from 'prop-types'; import { injectIntl, FormattedDate } from 'react-intl'; import classNames from 'classnames'; -import { Link } from 'react-router-dom'; +import { Link, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { AnimatedNumber } from 'flavours/glitch/components/animated_number'; import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import { DisplayName } from 'flavours/glitch/components/display_name'; import EditedTimestamp from 'flavours/glitch/components/edited_timestamp'; +import { getHashtagBarForStatus } from 'flavours/glitch/components/hashtag_bar'; import { Icon } from 'flavours/glitch/components/icon'; -import MediaGallery from 'flavours/glitch/components/media_gallery'; import PictureInPicturePlaceholder from 'flavours/glitch/components/picture_in_picture_placeholder'; -import StatusContent from 'flavours/glitch/components/status_content'; import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; import PollContainer from 'flavours/glitch/containers/poll_container'; -import Audio from 'flavours/glitch/features/audio'; -import Video from 'flavours/glitch/features/video'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { Avatar } from '../../../components/avatar'; +import { DisplayName } from '../../../components/display_name'; +import MediaGallery from '../../../components/media_gallery'; +import StatusContent from '../../../components/status_content'; +import Audio from '../../audio'; import scheduleIdleTask from '../../ui/util/schedule_idle_task'; +import Video from '../../video'; import Card from './card'; - - - class DetailedStatus extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { status: ImmutablePropTypes.map, settings: ImmutablePropTypes.map.isRequired, @@ -54,6 +49,7 @@ class DetailedStatus extends ImmutablePureComponent { }), onToggleMediaVisibility: PropTypes.func, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; state = { @@ -61,18 +57,18 @@ class DetailedStatus extends ImmutablePureComponent { }; handleAccountClick = (e) => { - if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) { + if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.props.history) { e.preventDefault(); - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); } e.stopPropagation(); }; parseClick = (e, destination) => { - if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) { + if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.props.history) { e.preventDefault(); - this.context.router.history.push(destination); + this.props.history.push(destination); } e.stopPropagation(); @@ -253,7 +249,7 @@ class DetailedStatus extends ImmutablePureComponent { if (!['unlisted', 'public'].includes(status.get('visibility'))) { reblogLink = null; - } else if (this.context.router) { + } else if (this.props.history) { reblogLink = ( <> {' · '} @@ -279,7 +275,7 @@ class DetailedStatus extends ImmutablePureComponent { ); } - if (this.context.router) { + if (this.props.history) { favouriteLink = ( @@ -308,6 +304,9 @@ class DetailedStatus extends ImmutablePureComponent { ); } + const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status); + contentMedia.push(hashtagBar); + return (
@@ -330,6 +329,7 @@ class DetailedStatus extends ImmutablePureComponent { tagLinks={settings.get('tag_misleading_links')} rewriteMentions={settings.get('rewrite_mentions')} disabled + {...statusContentProps} />
@@ -344,4 +344,4 @@ class DetailedStatus extends ImmutablePureComponent { } -export default injectIntl(DetailedStatus); +export default withRouter(injectIntl(DetailedStatus)); diff --git a/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js b/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js index adaf543e91..d7742cbbfa 100644 --- a/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js +++ b/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js @@ -2,15 +2,15 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { showAlertForError } from 'flavours/glitch/actions/alerts'; -import { initBlockModal } from 'flavours/glitch/actions/blocks'; -import { initBoostModal } from 'flavours/glitch/actions/boosts'; +import { showAlertForError } from '../../../actions/alerts'; +import { initBlockModal } from '../../../actions/blocks'; +import { initBoostModal } from '../../../actions/boosts'; import { replyCompose, quoteCompose, mentionCompose, directCompose, -} from 'flavours/glitch/actions/compose'; +} from '../../../actions/compose'; import { reblog, favourite, @@ -18,18 +18,17 @@ import { unfavourite, pin, unpin, -} from 'flavours/glitch/actions/interactions'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { initMuteModal } from 'flavours/glitch/actions/mutes'; -import { initReport } from 'flavours/glitch/actions/reports'; +} from '../../../actions/interactions'; +import { openModal } from '../../../actions/modal'; +import { initMuteModal } from '../../../actions/mutes'; +import { initReport } from '../../../actions/reports'; import { muteStatus, unmuteStatus, deleteStatus, -} from 'flavours/glitch/actions/statuses'; -import { boostModal, deleteModal } from 'flavours/glitch/initial_state'; -import { makeGetStatus } from 'flavours/glitch/selectors'; - +} from '../../../actions/statuses'; +import { boostModal, deleteModal } from '../../../initial_state'; +import { makeGetStatus } from '../../../selectors'; import DetailedStatus from '../components/detailed_status'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/status/index.jsx b/app/javascript/flavours/glitch/features/status/index.jsx index 90174312c3..1f7629624a 100644 --- a/app/javascript/flavours/glitch/features/status/index.jsx +++ b/app/javascript/flavours/glitch/features/status/index.jsx @@ -4,6 +4,7 @@ import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; import { Helmet } from 'react-helmet'; +import { withRouter } from 'react-router-dom'; import Immutable from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; @@ -13,14 +14,21 @@ import { createSelector } from 'reselect'; import { HotKeys } from 'react-hotkeys'; -import { initBlockModal } from 'flavours/glitch/actions/blocks'; -import { initBoostModal } from 'flavours/glitch/actions/boosts'; +import { Icon } from 'flavours/glitch/components/icon'; +import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; +import ScrollContainer from 'flavours/glitch/containers/scroll_container'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; +import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; + +import { initBlockModal } from '../../actions/blocks'; +import { initBoostModal } from '../../actions/boosts'; import { replyCompose, quoteCompose, mentionCompose, directCompose, -} from 'flavours/glitch/actions/compose'; +} from '../../actions/compose'; import { favourite, unfavourite, @@ -30,11 +38,11 @@ import { unreblog, pin, unpin, -} from 'flavours/glitch/actions/interactions'; -import { changeLocalSetting } from 'flavours/glitch/actions/local_settings'; -import { openModal } from 'flavours/glitch/actions/modal'; -import { initMuteModal } from 'flavours/glitch/actions/mutes'; -import { initReport } from 'flavours/glitch/actions/reports'; +} from '../../actions/interactions'; +import { changeLocalSetting } from '../../actions/local_settings'; +import { openModal } from '../../actions/modal'; +import { initMuteModal } from '../../actions/mutes'; +import { initReport } from '../../actions/reports'; import { fetchStatus, muteStatus, @@ -45,24 +53,19 @@ import { revealStatus, translateStatus, undoStatusTranslation, -} from 'flavours/glitch/actions/statuses'; -import { Icon } from 'flavours/glitch/components/icon'; -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; -import { textForScreenReader, defaultMediaVisibility } from 'flavours/glitch/components/status'; -import ScrollContainer from 'flavours/glitch/containers/scroll_container'; -import StatusContainer from 'flavours/glitch/containers/status_container'; -import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import Column from 'flavours/glitch/features/ui/components/column'; -import { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/initial_state'; -import { makeGetStatus, makeGetPictureInPicture } from 'flavours/glitch/selectors'; -import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning'; - +} from '../../actions/statuses'; import ColumnHeader from '../../components/column_header'; +import { textForScreenReader, defaultMediaVisibility } from '../../components/status'; +import StatusContainer from '../../containers/status_container'; +import { boostModal, favouriteModal, deleteModal } from '../../initial_state'; +import { makeGetStatus, makeGetPictureInPicture } from '../../selectors'; +import Column from '../ui/components/column'; import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../ui/util/fullscreen'; import ActionBar from './components/action_bar'; import DetailedStatus from './components/detailed_status'; + const messages = defineMessages({ deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' }, deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' }, @@ -183,7 +186,6 @@ const titleFromStatus = (intl, status) => { class Status extends ImmutablePureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -203,6 +205,7 @@ class Status extends ImmutablePureComponent { inUse: PropTypes.bool, available: PropTypes.bool, }), + ...WithRouterPropTypes }; state = { @@ -323,11 +326,11 @@ class Status extends ImmutablePureComponent { message: intl.formatMessage(messages.replyMessage), confirm: intl.formatMessage(messages.replyConfirm), onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_before_clearing_draft'], false)), - onConfirm: () => dispatch(replyCompose(status, this.context.router.history)), + onConfirm: () => dispatch(replyCompose(status, this.props.history)), }, })); } else { - dispatch(replyCompose(status, this.context.router.history)); + dispatch(replyCompose(status, this.props.history)); } } else { dispatch(openModal({ @@ -419,12 +422,12 @@ class Status extends ImmutablePureComponent { this.props.dispatch(editStatus(status.get('id'), history)); }; - handleDirectClick = (account, router) => { - this.props.dispatch(directCompose(account, router)); + handleDirectClick = (account, history) => { + this.props.dispatch(directCompose(account, history)); }; - handleMentionClick = (account, router) => { - this.props.dispatch(mentionCompose(account, router)); + handleMentionClick = (account, history) => { + this.props.dispatch(mentionCompose(account, history)); }; handleOpenMedia = (media, index, lang) => { @@ -546,7 +549,7 @@ class Status extends ImmutablePureComponent { }; handleHotkeyOpenProfile = () => { - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); }; handleMoveUp = id => { @@ -800,4 +803,4 @@ class Status extends ImmutablePureComponent { } -export default injectIntl(connect(makeMapStateToProps)(Status)); +export default withRouter(injectIntl(connect(makeMapStateToProps)(Status))); diff --git a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx index 9905301e79..c0268fbeb8 100644 --- a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx +++ b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx @@ -9,7 +9,7 @@ import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { followAccount } from 'flavours/glitch/actions/accounts'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { IconButton } from 'flavours/glitch/components/icon_button'; import Option from 'flavours/glitch/features/report/components/option'; import { languages as preloadedLanguages } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx index 5fe914d932..42be4be11a 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx @@ -7,10 +7,11 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { Avatar } from 'flavours/glitch/components/avatar'; import { DisplayName } from 'flavours/glitch/components/display_name'; -import { IconButton } from 'flavours/glitch/components/icon_button'; import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp'; import StatusContent from 'flavours/glitch/components/status_content'; +import { IconButton } from '../../../components/icon_button'; + export default class ActionsModal extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx index a6e15e5439..09897c1634 100644 --- a/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx @@ -26,10 +26,6 @@ class AudioModal extends ImmutablePureComponent { onChangeBackgroundColor: PropTypes.func.isRequired, }; - static contextTypes = { - router: PropTypes.object, - }; - render () { const { media, status, accountStaticAvatar, onClose } = this.props; const options = this.props.options || {}; diff --git a/app/javascript/flavours/glitch/features/ui/components/block_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/block_modal.jsx index c2965d6173..cfac692324 100644 --- a/app/javascript/flavours/glitch/features/ui/components/block_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/block_modal.jsx @@ -8,10 +8,9 @@ import { connect } from 'react-redux'; import { blockAccount } from '../../../actions/accounts'; import { closeModal } from '../../../actions/modal'; import { initReport } from '../../../actions/reports'; -import Button from '../../../components/button'; +import { Button } from '../../../components/button'; import { makeGetAccount } from '../../../selectors'; - const makeMapStateToProps = () => { const getAccount = makeGetAccount(); @@ -52,10 +51,6 @@ class BlockModal extends PureComponent { intl: PropTypes.object.isRequired, }; - componentDidMount() { - this.button.focus(); - } - handleClick = () => { this.props.onClose(); this.props.onConfirm(this.props.account); @@ -70,10 +65,6 @@ class BlockModal extends PureComponent { this.props.onClose(); }; - setRef = (c) => { - this.button = c; - }; - render () { const { account } = this.props; @@ -96,7 +87,7 @@ class BlockModal extends PureComponent { -
diff --git a/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx index b1c424ce34..db02e52690 100644 --- a/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -10,14 +11,16 @@ import { connect } from 'react-redux'; import { changeBoostPrivacy } from 'flavours/glitch/actions/boosts'; import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { Avatar } from 'flavours/glitch/components/avatar'; -import Button from 'flavours/glitch/components/button'; -import { DisplayName } from 'flavours/glitch/components/display_name'; -import { Icon } from 'flavours/glitch/components/icon'; -import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp'; -import StatusContent from 'flavours/glitch/components/status_content'; +import { Icon } from 'flavours/glitch/components/icon'; import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; import PrivacyDropdown from 'flavours/glitch/features/compose/components/privacy_dropdown'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; + +import { Avatar } from '../../../components/avatar'; +import { Button } from '../../../components/button'; +import { DisplayName } from '../../../components/display_name'; +import { RelativeTimestamp } from '../../../components/relative_timestamp'; +import StatusContent from '../../../components/status_content'; const messages = defineMessages({ cancel_reblog: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' }, @@ -39,23 +42,15 @@ const mapDispatchToProps = dispatch => { }; class BoostModal extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { status: ImmutablePropTypes.map.isRequired, onReblog: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, missingMediaDescription: PropTypes.bool, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; - componentDidMount() { - this.button.focus(); - } - handleReblog = () => { this.props.onReblog(this.props.status, this.props.privacy); this.props.onClose(); @@ -65,7 +60,7 @@ class BoostModal extends ImmutablePureComponent { if (e.button === 0) { e.preventDefault(); this.props.onClose(); - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); } }; @@ -73,10 +68,6 @@ class BoostModal extends ImmutablePureComponent { return document.getElementsByClassName('modal-root__container')[0]; }; - setRef = (c) => { - this.button = c; - }; - render () { const { status, missingMediaDescription, privacy, intl } = this.props; const buttonText = status.get('reblogged') ? messages.cancel_reblog : messages.reblog; @@ -129,7 +120,7 @@ class BoostModal extends ImmutablePureComponent { onChange={this.props.onChangeBoostPrivacy} /> )} -
); @@ -137,4 +128,4 @@ class BoostModal extends ImmutablePureComponent { } -export default connect(mapStateToProps, mapDispatchToProps)(injectIntl(BoostModal)); +export default withRouter(connect(mapStateToProps, mapDispatchToProps)(injectIntl(BoostModal))); diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.jsx b/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.jsx index cd971f9f2d..e717960d3b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.jsx @@ -7,7 +7,7 @@ import classNames from 'classnames'; import { Helmet } from 'react-helmet'; import { Link } from 'react-router-dom'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import Column from 'flavours/glitch/components/column'; import { autoPlayGif } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx index de43206481..1d792a2cfe 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx @@ -3,7 +3,7 @@ import { Component } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; -import { IconButton } from 'flavours/glitch/components/icon_button'; +import { IconButton } from '../../../components/icon_button'; const messages = defineMessages({ error: { id: 'bundle_modal_error.message', defaultMessage: 'Something went wrong while loading this component.' }, diff --git a/app/javascript/flavours/glitch/features/ui/components/column.jsx b/app/javascript/flavours/glitch/features/ui/components/column.jsx index 8f6259e5b7..6e8ff93e19 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/column.jsx @@ -3,8 +3,8 @@ import { PureComponent } from 'react'; import { debounce } from 'lodash'; -import { isMobile } from 'flavours/glitch/is_mobile'; -import { scrollTop } from 'flavours/glitch/scroll'; +import { isMobile } from '../../../is_mobile'; +import { scrollTop } from '../../../scroll'; import ColumnHeader from './column_header'; diff --git a/app/javascript/flavours/glitch/features/ui/components/column_header.jsx b/app/javascript/flavours/glitch/features/ui/components/column_header.jsx index a2934e60f1..c24ab898c9 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_header.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/column_header.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import classNames from 'classnames'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; export default class ColumnHeader extends PureComponent { diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx b/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx index 6eb5ee0e52..f1e7baf8dd 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.jsx @@ -6,8 +6,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { supportsPassiveEvents } from 'detect-passive-events'; -import { scrollRight } from 'flavours/glitch/scroll'; - +import { scrollRight } from '../../../scroll'; import BundleContainer from '../containers/bundle_container'; import { Compose, @@ -45,11 +44,6 @@ const componentMap = { }; export default class ColumnsArea extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object.isRequired, - }; - static propTypes = { columns: ImmutablePropTypes.list.isRequired, singleColumn: PropTypes.bool, diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx b/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx index 1b92ac398f..3f9ba99e4f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx @@ -11,7 +11,6 @@ import SearchContainer from 'flavours/glitch/features/compose/containers/search_ import LinkFooter from './link_footer'; - class ComposePanel extends PureComponent { static contextTypes = { diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx index 2fc7e3f3e0..59913b4bdb 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { injectIntl, FormattedMessage } from 'react-intl'; -import Button from 'flavours/glitch/components/button'; +import { Button } from '../../../components/button'; class ConfirmationModal extends PureComponent { @@ -23,10 +23,6 @@ class ConfirmationModal extends PureComponent { closeWhenConfirm: true, }; - componentDidMount() { - this.button.focus(); - } - handleClick = () => { if (this.props.closeWhenConfirm) { this.props.onClose(); @@ -46,10 +42,6 @@ class ConfirmationModal extends PureComponent { this.props.onClose(); }; - setRef = (c) => { - this.button = c; - }; - setDoNotAskRef = (c) => { this.doNotAskCheckbox = c; }; @@ -79,7 +71,7 @@ class ConfirmationModal extends PureComponent { {secondary !== undefined && (
diff --git a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx index ba77feb6a5..1d1cd3d70a 100644 --- a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx @@ -5,7 +5,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { Icon } from 'flavours/glitch/components/icon'; import illustration from 'flavours/glitch/images/logo_warn_glitch.svg'; import { preferenceLink } from 'flavours/glitch/utils/backend_links'; @@ -25,19 +25,11 @@ class DeprecatedSettingsModal extends PureComponent { intl: PropTypes.object.isRequired, }; - componentDidMount() { - this.button.focus(); - } - handleClick = () => { this.props.onConfirm(); this.props.onClose(); }; - setRef = (c) => { - this.button = c; - }; - render () { const { settings, intl } = this.props; @@ -78,7 +70,7 @@ class DeprecatedSettingsModal extends PureComponent {
-
diff --git a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx index b790eaebab..d682ef161d 100644 --- a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx @@ -10,7 +10,7 @@ import Atrament from 'atrament'; // the doodling library import { debounce, mapValues } from 'lodash'; import { doodleSet, uploadCompose } from 'flavours/glitch/actions/compose'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { IconButton } from 'flavours/glitch/components/icon_button'; // palette nicked from MyPaint, CC0 const palette = [ diff --git a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.jsx index fa955b0483..d81dee22d1 100644 --- a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.jsx @@ -3,18 +3,20 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AttachmentList from 'flavours/glitch/components/attachment_list'; import { Avatar } from 'flavours/glitch/components/avatar'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { DisplayName } from 'flavours/glitch/components/display_name'; import { Icon } from 'flavours/glitch/components/icon'; import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp'; import StatusContent from 'flavours/glitch/components/status_content'; import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; const messages = defineMessages({ favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, @@ -22,21 +24,14 @@ const messages = defineMessages({ class FavouriteModal extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { status: ImmutablePropTypes.map.isRequired, onFavourite: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; - componentDidMount() { - this.button.focus(); - } - handleFavourite = () => { this.props.onFavourite(this.props.status); this.props.onClose(); @@ -46,14 +41,10 @@ class FavouriteModal extends ImmutablePureComponent { if (e.button === 0) { e.preventDefault(); this.props.onClose(); - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); } }; - setRef = (c) => { - this.button = c; - }; - render () { const { status, intl } = this.props; @@ -92,7 +83,7 @@ class FavouriteModal extends ImmutablePureComponent {
Shift + }} />
-
); @@ -100,4 +91,4 @@ class FavouriteModal extends ImmutablePureComponent { } -export default injectIntl(FavouriteModal); +export default withRouter(injectIntl(FavouriteModal)); diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx index eeef422779..be7266d746 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx @@ -16,18 +16,18 @@ import tesseractWorkerPath from 'tesseract.js/dist/worker.min.js'; // eslint-disable-next-line import/no-extraneous-dependencies import tesseractCorePath from 'tesseract.js-core/tesseract-core.wasm.js'; -import Button from 'flavours/glitch/components/button'; +import { Button } from 'flavours/glitch/components/button'; import { GIFV } from 'flavours/glitch/components/gifv'; import { IconButton } from 'flavours/glitch/components/icon_button'; import Audio from 'flavours/glitch/features/audio'; import CharacterCounter from 'flavours/glitch/features/compose/components/character_counter'; import UploadProgress from 'flavours/glitch/features/compose/components/upload_progress'; import { Tesseract as fetchTesseract } from 'flavours/glitch/features/ui/util/async-components'; -import Video, { getPointerPosition } from 'flavours/glitch/features/video'; import { me } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; import { changeUploadCompose, uploadThumbnail, onChangeMediaDescription, onChangeMediaFocus } from '../../../actions/compose'; +import Video, { getPointerPosition } from '../../video'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, diff --git a/app/javascript/flavours/glitch/features/ui/components/list_panel.jsx b/app/javascript/flavours/glitch/features/ui/components/list_panel.jsx index e6830e544a..9210bb4f39 100644 --- a/app/javascript/flavours/glitch/features/ui/components/list_panel.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/list_panel.jsx @@ -1,7 +1,5 @@ import PropTypes from 'prop-types'; -import { withRouter } from 'react-router-dom'; - import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; @@ -55,4 +53,4 @@ class ListPanel extends ImmutablePureComponent { } -export default withRouter(connect(mapStateToProps)(ListPanel)); +export default connect(mapStateToProps)(ListPanel); diff --git a/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx index 344f97fc00..d3d74136f1 100644 --- a/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx @@ -11,7 +11,7 @@ import ReactSwipeableViews from 'react-swipeable-views'; import { getAverageFromBlurhash } from 'flavours/glitch/blurhash'; import { GIFV } from 'flavours/glitch/components/gifv'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import { IconButton } from 'flavours/glitch/components/icon_button'; import Footer from 'flavours/glitch/features/picture_in_picture/components/footer'; import Video from 'flavours/glitch/features/video'; @@ -27,10 +27,6 @@ const messages = defineMessages({ class MediaModal extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { media: ImmutablePropTypes.list.isRequired, statusId: PropTypes.string, diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx b/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx index 3206e06c6a..7d19e73513 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx @@ -1,4 +1,4 @@ -import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator'; +import { LoadingIndicator } from '../../../components/loading_indicator'; // Keep the markup in sync with // (make sure they have the same dimensions) diff --git a/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx index 23f842f090..2d95cabef8 100644 --- a/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx @@ -7,10 +7,10 @@ import { connect } from 'react-redux'; import Toggle from 'react-toggle'; -import { muteAccount } from 'flavours/glitch/actions/accounts'; -import { closeModal } from 'flavours/glitch/actions/modal'; -import { toggleHideNotifications, changeMuteDuration } from 'flavours/glitch/actions/mutes'; -import Button from 'flavours/glitch/components/button'; +import { muteAccount } from '../../../actions/accounts'; +import { closeModal } from '../../../actions/modal'; +import { toggleHideNotifications, changeMuteDuration } from '../../../actions/mutes'; +import { Button } from '../../../components/button'; const messages = defineMessages({ minutes: { id: 'intervals.full.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}}' }, @@ -63,10 +63,6 @@ class MuteModal extends PureComponent { onChangeMuteDuration: PropTypes.func.isRequired, }; - componentDidMount() { - this.button.focus(); - } - handleClick = () => { this.props.onClose(); this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration); @@ -76,10 +72,6 @@ class MuteModal extends PureComponent { this.props.onClose(); }; - setRef = (c) => { - this.button = c; - }; - toggleNotifications = () => { this.props.onToggleNotifications(); }; @@ -134,7 +126,7 @@ class MuteModal extends PureComponent { -
diff --git a/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx b/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx index 601732b8bb..7b47e08234 100644 --- a/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx @@ -3,7 +3,7 @@ import { Component } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; -import NavigationPortal from 'flavours/glitch/components/navigation_portal'; +import { NavigationPortal } from 'flavours/glitch/components/navigation_portal'; import { timelinePreview, trendsEnabled } from 'flavours/glitch/initial_state'; import { transientSingleColumn } from 'flavours/glitch/is_mobile'; import { preferencesLink } from 'flavours/glitch/utils/backend_links'; @@ -36,7 +36,6 @@ const messages = defineMessages({ class NavigationPanel extends Component { static contextTypes = { - router: PropTypes.object.isRequired, identity: PropTypes.object.isRequired, }; @@ -66,7 +65,11 @@ class NavigationPanel extends Component { return (
- {banner} + {banner && + + } {signedIn && ( <> diff --git a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx index 184a8d103f..5db3cb492b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; + import { openModal } from 'flavours/glitch/actions/modal'; import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state'; import { useAppDispatch, useAppSelector } from 'flavours/glitch/store'; diff --git a/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx b/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx index 621f8c2277..9aa8e359f8 100644 --- a/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/upload_area.jsx @@ -7,8 +7,6 @@ import spring from 'react-motion/lib/spring'; import Motion from '../util/optional_motion'; - - export default class UploadArea extends PureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js b/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js index ff5a35319e..6a476fe248 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/bundle_container.js @@ -1,10 +1,8 @@ import { connect } from 'react-redux'; -import { fetchBundleRequest, fetchBundleSuccess, fetchBundleFail } from 'flavours/glitch/actions/bundles'; - +import { fetchBundleRequest, fetchBundleSuccess, fetchBundleFail } from '../../../actions/bundles'; import Bundle from '../components/bundle'; - const mapDispatchToProps = dispatch => ({ onFetch () { dispatch(fetchBundleRequest()); diff --git a/app/javascript/flavours/glitch/features/ui/containers/modal_container.js b/app/javascript/flavours/glitch/features/ui/containers/modal_container.js index 0d07d68a5d..1c3872cd50 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/modal_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/modal_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { openModal, closeModal } from 'flavours/glitch/actions/modal'; - +import { openModal, closeModal } from '../../../actions/modal'; import ModalRoot from '../components/modal_root'; const mapStateToProps = state => ({ diff --git a/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js b/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js index 42a55a4b80..c1d19f7100 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/notifications_container.js @@ -4,8 +4,8 @@ import { connect } from 'react-redux'; import { NotificationStack } from 'react-notification'; -import { dismissAlert } from 'flavours/glitch/actions/alerts'; -import { getAlerts } from 'flavours/glitch/selectors'; +import { dismissAlert } from '../../../actions/alerts'; +import { getAlerts } from '../../../selectors'; const mapStateToProps = (state, { intl }) => { const notifications = getAlerts(state); diff --git a/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js b/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js index 5f34f5cd2e..f34d099b24 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js @@ -4,9 +4,9 @@ import { createSelector } from 'reselect'; import { debounce } from 'lodash'; -import { scrollTopTimeline, loadPending } from 'flavours/glitch/actions/timelines'; -import StatusList from 'flavours/glitch/components/status_list'; -import { me } from 'flavours/glitch/initial_state'; +import { scrollTopTimeline, loadPending } from '../../../actions/timelines'; +import StatusList from '../../../components/status_list'; +import { me } from '../../../initial_state'; const getRegex = createSelector([ (state, { regex }) => regex, diff --git a/app/javascript/flavours/glitch/features/ui/index.jsx b/app/javascript/flavours/glitch/features/ui/index.jsx index 44f394657a..566421e65c 100644 --- a/app/javascript/flavours/glitch/features/ui/index.jsx +++ b/app/javascript/flavours/glitch/features/ui/index.jsx @@ -13,16 +13,17 @@ import { debounce } from 'lodash'; import { HotKeys } from 'react-hotkeys'; import { changeLayout } from 'flavours/glitch/actions/app'; -import { uploadCompose, resetCompose, changeComposeSpoilerness } from 'flavours/glitch/actions/compose'; -import { clearHeight } from 'flavours/glitch/actions/height_cache'; import { synchronouslySubmitMarkers, submitMarkers, fetchMarkers } from 'flavours/glitch/actions/markers'; -import { expandNotifications, notificationsSetVisibility } from 'flavours/glitch/actions/notifications'; -import { fetchServer, fetchServerTranslationLanguages } from 'flavours/glitch/actions/server'; -import { expandHomeTimeline } from 'flavours/glitch/actions/timelines'; import PermaLink from 'flavours/glitch/components/permalink'; import PictureInPicture from 'flavours/glitch/features/picture_in_picture'; import { layoutFromWindow } from 'flavours/glitch/is_mobile'; +import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; +import { uploadCompose, resetCompose, changeComposeSpoilerness } from '../../actions/compose'; +import { clearHeight } from '../../actions/height_cache'; +import { expandNotifications, notificationsSetVisibility } from '../../actions/notifications'; +import { fetchServer, fetchServerTranslationLanguages } from '../../actions/server'; +import { expandHomeTimeline } from '../../actions/timelines'; import initialState, { me, owner, singleUserMode, trendsEnabled, trendsAsLanding } from '../../initial_state'; import BundleColumnError from './components/bundle_column_error'; @@ -269,8 +270,6 @@ class UI extends Component { hasMediaAttachments: PropTypes.bool, canUploadMore: PropTypes.bool, match: PropTypes.object.isRequired, - location: PropTypes.object.isRequired, - history: PropTypes.object.isRequired, intl: PropTypes.object.isRequired, dropdownMenuIsOpen: PropTypes.bool, unreadNotifications: PropTypes.number, @@ -280,6 +279,7 @@ class UI extends Component { layout: PropTypes.string.isRequired, firstLaunch: PropTypes.bool, username: PropTypes.string, + ...WithRouterPropTypes, }; state = { @@ -416,7 +416,7 @@ class UI extends Component { // On first launch, redirect to the follow recommendations page if (signedIn && this.props.firstLaunch) { - this.context.router.history.replace('/start'); + this.props.history.replace('/start'); // TODO: this.props.dispatch(closeOnboarding()); } diff --git a/app/javascript/flavours/glitch/features/ui/util/optional_motion.js b/app/javascript/flavours/glitch/features/ui/util/optional_motion.js index 4ec6877384..0b6d4d97f7 100644 --- a/app/javascript/flavours/glitch/features/ui/util/optional_motion.js +++ b/app/javascript/flavours/glitch/features/ui/util/optional_motion.js @@ -1,6 +1,6 @@ import Motion from 'react-motion/lib/Motion'; -import { reduceMotion } from 'flavours/glitch/initial_state'; +import { reduceMotion } from '../../../initial_state'; import ReducedMotion from './reduced_motion'; diff --git a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx index d0d034cbd4..c0ee31bf68 100644 --- a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx +++ b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx @@ -1,43 +1,36 @@ import PropTypes from 'prop-types'; -import { Component, PureComponent, cloneElement, Children } from 'react'; +import { Component, cloneElement, Children } from 'react'; -import { Switch, Route } from 'react-router-dom'; +import { Switch, Route, useLocation } from 'react-router-dom'; import StackTrace from 'stacktrace-js'; -import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; -import ColumnLoading from 'flavours/glitch/features/ui/components/column_loading'; -import BundleContainer from 'flavours/glitch/features/ui/containers/bundle_container'; +import BundleColumnError from '../components/bundle_column_error'; +import ColumnLoading from '../components/column_loading'; +import BundleContainer from '../containers/bundle_container'; // Small wrapper to pass multiColumn to the route components -export class WrappedSwitch extends PureComponent { - static contextTypes = { - router: PropTypes.object, - }; +export const WrappedSwitch = ({ multiColumn, children }) => { + const location = useLocation(); - render () { - const { multiColumn, children } = this.props; - const { location } = this.context.router.route; + const decklessLocation = multiColumn && location.pathname.startsWith('/deck') + ? {...location, pathname: location.pathname.slice(5)} + : location; - const decklessLocation = multiColumn && location.pathname.startsWith('/deck') - ? {...location, pathname: location.pathname.slice(5)} - : location; + return ( + + {Children.map(children, child => child ? cloneElement(child, { multiColumn }) : null)} + + ); +}; - return ( - - {Children.map(children, child => child ? cloneElement(child, { multiColumn }) : null)} - - ); - } - -} WrappedSwitch.propTypes = { multiColumn: PropTypes.bool, children: PropTypes.node, }; -// Small Wraper to extract the params from the route and pass +// Small Wrapper to extract the params from the route and pass // them to the rendered component, together with the content to // be rendered inside (the children) export class WrappedRoute extends Component { diff --git a/app/javascript/flavours/glitch/features/video/index.jsx b/app/javascript/flavours/glitch/features/video/index.jsx index 022f662699..2d50f3d8eb 100644 --- a/app/javascript/flavours/glitch/features/video/index.jsx +++ b/app/javascript/flavours/glitch/features/video/index.jsx @@ -10,9 +10,9 @@ import { is } from 'immutable'; import { throttle } from 'lodash'; import { Blurhash } from 'flavours/glitch/components/blurhash'; -import { Icon } from 'flavours/glitch/components/icon'; -import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; +import { Icon } from 'flavours/glitch/components/icon'; +import { displayMedia, useBlurhash } from '../../initial_state'; import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/locales/cy.json b/app/javascript/flavours/glitch/locales/cy.json index f7b668e4e6..487d2c08eb 100644 --- a/app/javascript/flavours/glitch/locales/cy.json +++ b/app/javascript/flavours/glitch/locales/cy.json @@ -1,4 +1,46 @@ { + "about.fork_disclaimer": "Mae Glitch-Soc yn feddalwedd di-dal a ffynhonnell agored wedi'i fforchio o Mastodon.", + "account.add_account_note": "Ychwanegu nodyn ar @{name}", + "account.disclaimer_full": "Mae'n bosib nad yw'r gwybodaeth isod yn rhoi darlun cyfan o broffil y defnyddiwr.", + "account.follows": "Yn dilyn", + "account.joined": "Ymunodd ar {date}", + "account.mute_notifications": "Diffodd hysbysiadau o @{name}", + "account.suspended_disclaimer_full": "Mae'r defnyddiwr yma wedi'i atal gan gymedrolwr.", + "account.unmute_notifications": "Dad-dawelu hysbysiadau o @{name}", + "account.view_full_profile": "Dangos proffil cyfan", + "account_note.cancel": "Canslo", + "account_note.edit": "Golygu", + "account_note.glitch_placeholder": "Dim sylw wedi'i roi", + "account_note.save": "Cadw", + "advanced_options.icon_title": "Dewisiadau uwch", + "advanced_options.local-only.short": "Lleol yn unig", + "advanced_options.local-only.tooltip": "Mae'r post yma'n lleol yn unig", + "advanced_options.threaded_mode.short": "Modd edafau", + "advanced_options.threaded_mode.tooltip": "Modd edafau wedi'i alluogi", + "boost_modal.missing_description": "Mae'r tŵt yma'n cynnwys ychydig gyfryngau heb ddisgrifiad", + "column.favourited_by": "Wedi'i hoffi gan", + "column.heading": "Misg", + "column.reblogged_by": "Wedi'i bŵstio gan", + "column.subheading": "Opsiynnau arall", + "column_header.profile": "Proffil", + "column_subheading.lists": "Rhestri", + "column_subheading.navigation": "Llywio", + "community.column_settings.allow_local_only": "Dangos tŵtiau lleol yn unig", + "compose.attach": "Atodi...", + "compose.attach.doodle": "Darlinio rhywbeth", + "compose.attach.upload": "Uwchlwythio ffeil", + "compose.content-type.html": "HTML", + "compose.content-type.markdown": "Markdown", + "compose.content-type.plain": "Testun plaen", + "compose_form.poll.multiple_choices": "Caniatau sawl dewis", + "compose_form.poll.single_choice": "Caniatau un dewis", + "compose_form.spoiler": "Cuddio testun tu ôl rhybydd", + "confirmations.missing_media_description.confirm": "Anfon beth bynnag", + "confirmations.missing_media_description.edit": "Golygu cyfryngau", + "confirmations.unfilter.author": "Awdur", + "confirmations.unfilter.confirm": "Dangos", + "confirmations.unfilter.edit_filter": "Golygi hidlydd", + "content-type.change": "Math cynnwys", "empty_column.follow_recommendations": "Does dim awgrymiadau yma i chi. Gallwch geisio chwilio am bobl rydych yn eu hadnabod neu edrych drwy hashnodau sy'n trendio.", "follow_recommendations.done": "Wedi gorffen", "follow_recommendations.heading": "Dilynwch y bobl yr hoffech chi weld eu postiadau! Dyma ambell i awgrymiad.", diff --git a/app/javascript/flavours/glitch/locales/de.json b/app/javascript/flavours/glitch/locales/de.json index d0bb329ad3..a9ca2e9316 100644 --- a/app/javascript/flavours/glitch/locales/de.json +++ b/app/javascript/flavours/glitch/locales/de.json @@ -4,7 +4,9 @@ "account.disclaimer_full": "Die folgenden Informationen könnten das Profil des Nutzers unvollständig wiedergeben.", "account.follows": "Folgt", "account.joined": "Beigetreten am {date}", + "account.mute_notifications": "Benachrichtigungen von @{name} stummschalten", "account.suspended_disclaimer_full": "Dieser Nutzer wurde durch einen Moderator gesperrt.", + "account.unmute_notifications": "Benachrichtigungen von @{name} nicht mehr stummschalten", "account.view_full_profile": "Vollständiges Profil anzeigen", "account_note.cancel": "Abbrechen", "account_note.edit": "Bearbeiten", @@ -47,9 +49,10 @@ "confirmations.unfilter.filters": "Passende{count, plural, one {r} other {}} Filter", "content-type.change": "Inhaltstyp", "direct.group_by_conversations": "Nach Unterhaltung gruppieren", - "empty_column.follow_recommendations": "Es sieht so aus, als könnten keine Vorschläge für dich generiert werden. Du kannst versuchen, nach Leuten zu suchen, die du vielleicht kennst, oder du kannst angesagte Hashtags erkunden.", + "empty_column.follow_recommendations": "Es sieht so aus, als könnten keine Vorschläge für dich generiert werden. Du kannst versuchen, nach Leuten, die du vielleicht kennst, oder du kannst angesagte Hashtags erkunden.", "endorsed_accounts_editor.endorsed_accounts": "Empfohlene Konten", "favourite_modal.combo": "Mit {combo} wird dieses Fenster beim nächsten Mal nicht mehr angezeigt", + "firehose.column_settings.allow_local_only": "Zeige \"nur Lokal\"-Beiträge in \"Alle\"", "follow_recommendations.done": "Fertig", "follow_recommendations.heading": "Folge Leuten, deren Beiträge du sehen möchtest! Hier sind einige Vorschläge.", "follow_recommendations.lead": "Beiträge von Leuten, denen du folgst, werden in chronologischer Reihenfolge auf deiner Startseite angezeigt. Sei unbesorgt, mal Fehler zu begehen. Du kannst Leuten jederzeit ganz einfach wieder entfolgen!", diff --git a/app/javascript/flavours/glitch/locales/es-MX.json b/app/javascript/flavours/glitch/locales/es-MX.json index 306a55c2df..7a8af6bed3 100644 --- a/app/javascript/flavours/glitch/locales/es-MX.json +++ b/app/javascript/flavours/glitch/locales/es-MX.json @@ -4,7 +4,9 @@ "account.disclaimer_full": "La información aquí presentada puede reflejar de manera incompleta el perfil del usuario.", "account.follows": "Seguir", "account.joined": "Unido {date}", + "account.mute_notifications": "Silenciar notificaciones de @{name}", "account.suspended_disclaimer_full": "Este usuario ha sido suspendido por un moderador.", + "account.unmute_notifications": "Dejar de silenciar notificaciones de @{name}", "account.view_full_profile": "Ver perfil completo", "account_note.cancel": "Cancelar", "account_note.edit": "Editar", @@ -50,6 +52,7 @@ "empty_column.follow_recommendations": "Parece que no se ha podido generar ninguna sugerencia para ti. Puedes probar a buscar a gente que quizá conozcas o explorar los hashtags que están en tendencia.", "endorsed_accounts_editor.endorsed_accounts": "Cuentas destacadas", "favourite_modal.combo": "Puedes presionar {combo} para omitir esto la próxima vez", + "firehose.column_settings.allow_local_only": "Mostrar mensajes solo-locales en \"Todo\"", "follow_recommendations.done": "Hecho", "follow_recommendations.heading": "¡Sigue a gente que publique cosas que te gusten! Aquí tienes algunas sugerencias.", "follow_recommendations.lead": "Las publicaciones de la gente a la que sigas aparecerán ordenadas cronológicamente en Inicio. No tengas miedo de cometer errores, ¡puedes dejarles de seguir en cualquier momento con la misma facilidad!", diff --git a/app/javascript/flavours/glitch/locales/es.json b/app/javascript/flavours/glitch/locales/es.json index 0dddbcb99d..690747d305 100644 --- a/app/javascript/flavours/glitch/locales/es.json +++ b/app/javascript/flavours/glitch/locales/es.json @@ -1,10 +1,12 @@ { "about.fork_disclaimer": "Glitch-soc es software gratuito, de código abierto, bifurcado de Mastodon.", "account.add_account_note": "Añadir nota para @{name}", - "account.disclaimer_full": "La información aquí presentada puede reflejar de manera incompleta el perfil del usuario.", + "account.disclaimer_full": "La información que figura a continuación puede reflejar el perfil de la cuenta de forma incompleta.", "account.follows": "Sigue", - "account.joined": "Unido el {date}", + "account.joined": "Se unió el {date}", + "account.mute_notifications": "Silenciar notificaciones de @{name}", "account.suspended_disclaimer_full": "Este usuario ha sido suspendido por un moderador.", + "account.unmute_notifications": "Dejar de silenciar notificaciones de @{name}", "account.view_full_profile": "Ver perfil completo", "account_note.cancel": "Cancelar", "account_note.edit": "Editar", @@ -25,7 +27,7 @@ "column_header.profile": "Perfil", "column_subheading.lists": "Listas", "column_subheading.navigation": "Navegación", - "community.column_settings.allow_local_only": "Mostrar sólo toots locales", + "community.column_settings.allow_local_only": "Mostrar toots solo-locales", "compose.attach": "Adjuntar...", "compose.attach.doodle": "Dibujar algo", "compose.attach.upload": "Subir un archivo", @@ -50,6 +52,7 @@ "empty_column.follow_recommendations": "Parece que no se ha podido generar ninguna sugerencia para ti. Puedes probar a buscar a gente que quizá conozcas o explorar los hashtags que están en tendencia.", "endorsed_accounts_editor.endorsed_accounts": "Cuentas destacadas", "favourite_modal.combo": "Puedes presionar {combo} para omitir esto la próxima vez", + "firehose.column_settings.allow_local_only": "Mostrar mensajes solo-locales en \"Todo\"", "follow_recommendations.done": "Hecho", "follow_recommendations.heading": "¡Sigue a gente que publique cosas que te gusten! Aquí tienes algunas sugerencias.", "follow_recommendations.lead": "Las publicaciones de la gente a la que sigas aparecerán ordenadas cronológicamente en Inicio. No tengas miedo de cometer errores, ¡puedes dejarles de seguir en cualquier momento con la misma facilidad!", diff --git a/app/javascript/flavours/glitch/locales/nl.json b/app/javascript/flavours/glitch/locales/nl.json index 51a96814da..fb3ca80e4e 100644 --- a/app/javascript/flavours/glitch/locales/nl.json +++ b/app/javascript/flavours/glitch/locales/nl.json @@ -1,10 +1,74 @@ { + "account.follows": "Volgers", + "account.joined": "Lid sinds {date}", + "account.mute_notifications": "Meldingen dempen van @{name}", + "account.unmute_notifications": "Meldingen van @{name} niet langer dempen", + "account.view_full_profile": "Volledig profiel weergeven", + "account_note.cancel": "Annuleer", + "account_note.edit": "Bewerk", + "account_note.glitch_placeholder": "Geen notitie toegevoegd", + "account_note.save": "Opslaan", + "advanced_options.icon_title": "Geavanceerde opties", + "advanced_options.local-only.long": "Niet naar andere instanties sturen", + "advanced_options.local-only.short": "Alleen lokaal", + "advanced_options.local-only.tooltip": "Dit bericht alleen lokaal", + "advanced_options.threaded_mode.short": "Thread modus", + "advanced_options.threaded_mode.tooltip": "Thread modus ingeschakeld", + "boost_modal.missing_description": "Deze toot bevat media zonder beschrijving", + "column.favourited_by": "Favoriet door", + "column.heading": "Overige", + "column.reblogged_by": "Geboost door", + "column.subheading": "Diverse opties", + "column_header.profile": "Profiel", + "column_subheading.lists": "Lijsten", + "column_subheading.navigation": "Navigatie", + "community.column_settings.allow_local_only": "Toon alleen lokale toots", + "compose.attach.doodle": "Teken iets", + "compose.attach.upload": "Bestand uploaden", + "compose.content-type.html": "HTML", + "compose.content-type.markdown": "Markdown", + "compose.content-type.plain": "Onopgemaakte tekst", + "compose_form.poll.multiple_choices": "Meerdere keuzes toestaan", + "compose_form.poll.single_choice": "Eén keuze toestaan", + "compose_form.spoiler": "Verberg tekst achter waarschuwing", + "confirmation_modal.do_not_ask_again": "Vraag niet meer om bevestiging", + "confirmations.deprecated_settings.confirm": "Gebruik voorkeuren van Mastodon", + "confirmations.missing_media_description.confirm": "Toch verzenden", + "confirmations.missing_media_description.edit": "Media bewerken", + "confirmations.missing_media_description.message": "Minstens één media-bijlage mist een beschrijving. Overweeg om alle mediabijlagen voor slechtzienden te beschrijven voordat u uw toot verstuurt.", + "confirmations.unfilter.author": "Auteur", + "confirmations.unfilter.confirm": "Weergeven", + "confirmations.unfilter.edit_filter": "Filter bewerken", + "content-type.change": "Inhoudstype", + "direct.group_by_conversations": "Groeperen op gesprek", "empty_column.follow_recommendations": "Het lijkt er op dat er geen aanbevelingen voor jou aangemaakt kunnen worden. Je kunt proberen te zoeken naar mensen die je wellicht kent, zoeken op hashtags, de lokale en globale tijdlijnen bekijken of de gebruikersgids doorbladeren.", + "endorsed_accounts_editor.endorsed_accounts": "Aanbevolen accounts", "follow_recommendations.done": "Klaar", "follow_recommendations.heading": "Volg mensen waarvan je graag berichten wil zien! Hier zijn enkele aanbevelingen.", "follow_recommendations.lead": "Berichten van mensen die je volgt zullen in chronologische volgorde op jouw starttijdlijn verschijnen. Wees niet bang om hierin fouten te maken, want je kunt mensen op elk moment net zo eenvoudig ontvolgen!", + "home.column_settings.advanced": "Geavanceerd", + "navigation_bar.featured_users": "Aanbevolen gebruikers", + "notification_purge.btn_all": "Alles selecteren", + "notification_purge.btn_invert": "Selectie omkeren", + "notifications.marked_clear": "Wis geselecteerde meldingen", + "notifications.marked_clear_confirmation": "Weet je zeker dat je alle geselecteerde meldingen permanent wilt wissen?", + "onboarding.next": "Volgende", + "onboarding.page_four.notifications": "Het meldingenkolom toont wanneer iemand met je omgaat.", "onboarding.page_one.federation": "{domain} is an \"instance\" of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.", "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}. Glitchsoc is fully compatible with all Mastodon apps and instances. Glitchsoc is free open-source software. You can report bugs, request features, or contribute to the code on {github}.", + "settings.auto_collapse_height": "Hoogte (in pixels) voor een toot om als lang beschouwd te worden", + "settings.auto_collapse_lengthy": "Lange toots", + "settings.auto_collapse_media": "Toots met media", + "settings.auto_collapse_notifications": "Meldingen", + "settings.auto_collapse_reblogs": "Boosts", + "settings.auto_collapse_replies": "Antwoorden", + "settings.close": "Sluiten", "settings.content_warnings": "Content warnings", + "settings.general": "Algemeen", + "settings.media": "Media", + "settings.notifications.favicon_badge": "Ongelezen meldingen badge op favicon", + "settings.notifications_opts": "Meldingsopties", + "settings.pop_in_left": "Linkerkant", + "settings.pop_in_right": "Rechterkant", "settings.preferences": "Preferences" } diff --git a/app/javascript/flavours/glitch/locales/uk.json b/app/javascript/flavours/glitch/locales/uk.json index a8f6e42e84..917bc2c011 100644 --- a/app/javascript/flavours/glitch/locales/uk.json +++ b/app/javascript/flavours/glitch/locales/uk.json @@ -4,7 +4,9 @@ "account.disclaimer_full": "Наведена нижче інформація може не повністю відображати профіль користувача.", "account.follows": "Підписки", "account.joined": "Приєднався {date}", + "account.mute_notifications": "Не показувати сповіщення від @{name}", "account.suspended_disclaimer_full": "Цей користувач був призупинений модератором.", + "account.unmute_notifications": "Показувати сповіщення від @{name}", "account.view_full_profile": "Переглянути повний профіль", "account_note.cancel": "Скасувати", "account_note.edit": "Змінити", @@ -50,6 +52,7 @@ "empty_column.follow_recommendations": "Схоже, для вас не було створено жодної пропозиції. Ви можете спробувати скористатися пошуком людей, яких ви можете знати, або переглянути популярні гештеґи.", "endorsed_accounts_editor.endorsed_accounts": "Рекомендовані облікові записи", "favourite_modal.combo": "Ви можете натиснути {combo}, щоб пропустити це наступного разу", + "firehose.column_settings.allow_local_only": "Відображати локальні повідомлення в \"Все\"", "follow_recommendations.done": "Готово", "follow_recommendations.heading": "Підпишіться на людей, чиї дописи ви хочете бачити! Ось деякі пропозиції.", "follow_recommendations.lead": "Дописи від людей, за якими ви стежите, з'являться в хронологічному порядку у вашій домашній стрічці. Не бійся помилятися, ви можете відписатися від людей так само легко в будь-який час!", diff --git a/app/javascript/flavours/glitch/locales/zh-TW.json b/app/javascript/flavours/glitch/locales/zh-TW.json index 221d8f9d68..3411876e39 100644 --- a/app/javascript/flavours/glitch/locales/zh-TW.json +++ b/app/javascript/flavours/glitch/locales/zh-TW.json @@ -15,19 +15,19 @@ "advanced_options.icon_title": "進階選項", "advanced_options.local-only.long": "不要傳遞給其他實例", "advanced_options.local-only.short": "僅限本地", - "advanced_options.local-only.tooltip": "此嘟文僅限本地", + "advanced_options.local-only.tooltip": "此貼文僅限本地", "advanced_options.threaded_mode.long": "發佈時自動打開回覆", "advanced_options.threaded_mode.short": "討論串模式", "advanced_options.threaded_mode.tooltip": "已啟用討論串模式", - "boost_modal.missing_description": "此嘟文包含未加說明的媒體檔案", + "boost_modal.missing_description": "此貼文包含未加說明的媒體檔案", "column.favourited_by": "誰按了最愛", "column.heading": "雜項", - "column.reblogged_by": "被誰轉嘟", + "column.reblogged_by": "被誰轉貼", "column.subheading": "其他選項", "column_header.profile": "個人檔案", "column_subheading.lists": "列表", "column_subheading.navigation": "導覽", - "community.column_settings.allow_local_only": "顯示僅限本地的嘟文", + "community.column_settings.allow_local_only": "顯示僅限本地的貼文", "compose.attach": "附加...", "compose.attach.doodle": "塗鴉", "compose.attach.upload": "上傳檔案", @@ -42,7 +42,7 @@ "confirmations.deprecated_settings.message": "您正在使用的某些特定於 glitch-soc 設備的 {app_settings} 已被 Mastodon {preferences} 所取代,並將被覆蓋:", "confirmations.missing_media_description.confirm": "仍要張貼", "confirmations.missing_media_description.edit": "編輯媒體", - "confirmations.missing_media_description.message": "至少有一個媒體附件缺少說明。 在發送嘟文之前,請考慮為視障人士在所有媒體附件加上說明。", + "confirmations.missing_media_description.message": "至少有一個媒體附件缺少說明。 在發送貼文之前,請考慮為視障人士在所有媒體附件加上說明。", "confirmations.unfilter.author": "作者", "confirmations.unfilter.confirm": "顯示", "confirmations.unfilter.edit_filter": "編輯篩選器", @@ -53,16 +53,16 @@ "favourite_modal.combo": "下次您可以按 {combo} 跳過", "firehose.column_settings.allow_local_only": "在「全部」顯示僅限本地的貼文", "follow_recommendations.done": "完成", - "follow_recommendations.heading": "跟隨您想檢視其嘟文的人!這裡有一些建議。", - "follow_recommendations.lead": "來自您跟隨的人之嘟文將會按時間順序顯示在您的首頁時間軸上。不要害怕犯錯,您隨時都可以取消跟隨其他人!", + "follow_recommendations.heading": "跟隨您想檢視其貼文的人!這裡有一些建議。", + "follow_recommendations.lead": "來自您跟隨的人之貼文將會按時間順序顯示在您的首頁時間軸上。不要害怕犯錯,您隨時都可以取消跟隨其他人!", "getting_started.onboarding": "帶我四處看看", "home.column_settings.advanced": "進階設定", "home.column_settings.filter_regex": "以正規表達式進行過濾", "home.column_settings.show_direct": "顯示私人提及", "home.settings": "欄位設定", "keyboard_shortcuts.bookmark": "到書籤", - "keyboard_shortcuts.secondary_toot": "使用次要隱私設定來發布嘟文", - "keyboard_shortcuts.toggle_collapse": "去折疊/展開嘟文", + "keyboard_shortcuts.secondary_toot": "使用次要隱私設定來發布貼文", + "keyboard_shortcuts.toggle_collapse": "去折疊/展開貼文", "media_gallery.sensitive": "敏感", "moved_to_warning": "此帳戶已標記為移至 {moved_to_link},因此可能不接受新的追隨者。", "navigation_bar.app_settings": "應用程式設定", @@ -99,37 +99,37 @@ "settings.always_show_spoilers_field": "永遠啟用內容警告欄位", "settings.auto_collapse": "自動折疊", "settings.auto_collapse_all": "全部", - "settings.auto_collapse_height": "高度超過多少像素會被視為較長的嘟文", - "settings.auto_collapse_lengthy": "較長的嘟文", - "settings.auto_collapse_media": "包含媒體檔案的嘟文", + "settings.auto_collapse_height": "高度超過多少像素會被視為較長的貼文", + "settings.auto_collapse_lengthy": "較長的貼文", + "settings.auto_collapse_media": "包含媒體檔案的貼文", "settings.auto_collapse_notifications": "通知", - "settings.auto_collapse_reblogs": "轉嘟", + "settings.auto_collapse_reblogs": "轉貼", "settings.auto_collapse_replies": "回覆", "settings.close": "關閉", - "settings.collapsed_statuses": "折疊的嘟文", - "settings.compose_box_opts": "嘟文撰寫框", - "settings.confirm_before_clearing_draft": "在覆蓋編輯中的嘟文前顯示確認對話框", - "settings.confirm_boost_missing_media_description": "在轉嘟包含缺少說明的媒體檔案的嘟文前顯示確認對話框", - "settings.confirm_missing_media_description": "在發出包含缺少說明的媒體檔案的嘟文前顯示確認對話框", + "settings.collapsed_statuses": "折疊的貼文", + "settings.compose_box_opts": "貼文撰寫框", + "settings.confirm_before_clearing_draft": "在覆蓋編輯中的貼文前顯示確認對話框", + "settings.confirm_boost_missing_media_description": "在轉貼包含缺少說明的媒體檔案的貼文前顯示確認對話框", + "settings.confirm_missing_media_description": "在發出包含缺少說明的媒體檔案的貼文前顯示確認對話框", "settings.content_warnings": "內容警告", "settings.content_warnings.regexp": "正規表達式", "settings.content_warnings_filter": "不要自動展開內容警告:", "settings.content_warnings_media_outside": "在內容警告外顯示媒體檔案", "settings.content_warnings_media_outside_hint": "透過內容警告切換不影響媒體檔案來重現上游 Mastodon 行為", "settings.content_warnings_shared_state": "一次顯示/隱藏所有副本的內容", - "settings.content_warnings_shared_state_hint": "透過內容警告按鈕同時影響嘟文的所有副本來重現上游 Mastodon 行為。 這將防止任何帶有展開的內容警告的嘟文副本自動折疊", + "settings.content_warnings_shared_state_hint": "透過內容警告按鈕同時影響貼文的所有副本來重現上游 Mastodon 行為。 這將防止任何帶有展開的內容警告的貼文副本自動折疊", "settings.content_warnings_unfold_opts": "自動展開選項", "settings.deprecated_setting": "此設定現在已由 Mastodon 的 {settings_page_link} 控制。", - "settings.enable_collapsed": "啟用折疊的嘟文", - "settings.enable_collapsed_hint": "折疊的嘟文隱藏了部分內容,以佔用更少的屏幕空間。這與內容警告功能不同", + "settings.enable_collapsed": "啟用折疊的貼文", + "settings.enable_collapsed_hint": "折疊的貼文隱藏了部分內容,以佔用更少的螢幕空間。這與內容警告功能不同", "settings.enable_content_warnings_auto_unfold": "自動展開內容警告", "settings.general": "一般設定", "settings.hicolor_privacy_icons": "隱私圖示使用對比色", "settings.hicolor_privacy_icons.hint": "用明亮且易於區分的顏色顯示隱私圖示", "settings.image_backgrounds": "圖片背景", - "settings.image_backgrounds_media": "預覽折疊嘟文的媒體檔案", - "settings.image_backgrounds_media_hint": "如果嘟文包含媒體檔案,使用第一個作為圖片背景", - "settings.image_backgrounds_users": "為折疊的嘟文加上圖片背景", + "settings.image_backgrounds_media": "預覽折疊貼文的媒體檔案", + "settings.image_backgrounds_media_hint": "如果貼文包含媒體檔案,使用第一個作為圖片背景", + "settings.image_backgrounds_users": "為折疊的貼文加上圖片背景", "settings.inline_preview_cards": "針對外部連接顯示內嵌的預覽卡", "settings.layout_opts": "版面選項", "settings.media": "媒體", @@ -150,26 +150,26 @@ "settings.prepend_cw_re": "回覆時在內容警告前添加 \"re:\"", "settings.preselect_on_reply": "回覆時預先選擇用戶名稱", "settings.preselect_on_reply_hint": "回覆與多個參與者的對話時,預先選擇第一個參與者之後的用戶名稱", - "settings.rewrite_mentions": "改寫已顯示嘟文中的提及", + "settings.rewrite_mentions": "改寫已顯示貼文中的提及", "settings.rewrite_mentions_acct": "改寫為使用者名稱與網域(當使用者來自外部)", "settings.rewrite_mentions_no": "不要改寫提及", "settings.rewrite_mentions_username": "改寫為使用者名稱", "settings.shared_settings_link": "使用者偏好設定", - "settings.show_action_bar": "在折疊的嘟文顯示操作按鈕", - "settings.show_content_type_choice": "在編寫嘟文時顯示內容類型選擇", + "settings.show_action_bar": "在折疊的貼文顯示操作按鈕", + "settings.show_content_type_choice": "在編寫貼文時顯示內容類型選擇", "settings.show_reply_counter": "顯示回覆數量的估計值", - "settings.side_arm": "次要發出嘟文按鈕", + "settings.side_arm": "次要發出貼文按鈕", "settings.side_arm.none": "無", - "settings.side_arm_reply_mode": "當回覆一篇嘟文時,次要發出嘟文按鈕應該設為:", - "settings.side_arm_reply_mode.copy": "複製回覆嘟文的隱私設置", + "settings.side_arm_reply_mode": "當回覆一篇貼文時,次要發出嘟文按鈕應該設為:", + "settings.side_arm_reply_mode.copy": "複製回覆貼文的隱私設置", "settings.side_arm_reply_mode.keep": "保持原本的隱私設定", - "settings.side_arm_reply_mode.restrict": "限制只能使用與回覆嘟文相同的隱私設置", - "settings.status_icons": "嘟文圖示", + "settings.side_arm_reply_mode.restrict": "限制只能使用與回覆貼文相同的隱私設置", + "settings.status_icons": "貼文圖示", "settings.status_icons_language": "語言指示器", "settings.status_icons_local_only": "僅限本地指示器", "settings.status_icons_media": "媒體與投票指示器", "settings.status_icons_reply": "回覆指示器", - "settings.status_icons_visibility": "嘟文隱私指示器", + "settings.status_icons_visibility": "貼文隱私指示器", "settings.swipe_to_change_columns": "允許使用滑動手勢更改顯示欄位(僅限移動裝置)", "settings.tag_misleading_links": "標記誤導性的連結", "settings.tag_misleading_links.hint": "在每個未明確提及的連結添加帶有連結目標主機的視覺指示", @@ -180,8 +180,8 @@ "status.has_pictures": "包含圖片", "status.has_preview_card": "包含預覽卡", "status.has_video": "包含視訊檔案", - "status.in_reply_to": "嘟文有回覆", - "status.is_poll": "嘟文有投票", + "status.in_reply_to": "貼文有回覆", + "status.is_poll": "貼文有投票", "status.local_only": "只在此實例可見", "status.sensitive_toggle": "點擊查看", "status.uncollapse": "展開", diff --git a/app/javascript/flavours/glitch/packs/common.js b/app/javascript/flavours/glitch/packs/common.js index cb9e7fe840..caad60a8c3 100644 --- a/app/javascript/flavours/glitch/packs/common.js +++ b/app/javascript/flavours/glitch/packs/common.js @@ -1,8 +1,8 @@ import 'packs/public-path'; -import { start } from '@rails/ujs'; +import Rails from '@rails/ujs'; import 'flavours/glitch/styles/index.scss'; -start(); +Rails.start(); // This ensures that webpack compiles our images. require.context('../images', true); diff --git a/app/javascript/flavours/glitch/packs/public.jsx b/app/javascript/flavours/glitch/packs/public.jsx index 653b35f3da..03b4b324ca 100644 --- a/app/javascript/flavours/glitch/packs/public.jsx +++ b/app/javascript/flavours/glitch/packs/public.jsx @@ -4,7 +4,7 @@ import { createRoot } from 'react-dom/client'; import { IntlMessageFormat } from 'intl-messageformat'; import { defineMessages } from 'react-intl'; -import { delegate } from '@rails/ujs'; +import Rails from '@rails/ujs'; import axios from 'axios'; import { createBrowserHistory } from 'history'; import { throttle } from 'lodash'; @@ -143,7 +143,7 @@ function main() { scrollToDetailedStatus(); } - delegate(document, '#user_account_attributes_username', 'input', throttle(() => { + Rails.delegate(document, '#user_account_attributes_username', 'input', throttle(() => { const username = document.getElementById('user_account_attributes_username'); if (username.value && username.value.length > 0) { @@ -157,7 +157,7 @@ function main() { } }, 500, { leading: false, trailing: true })); - delegate(document, '#user_password,#user_password_confirmation', 'input', () => { + Rails.delegate(document, '#user_password,#user_password_confirmation', 'input', () => { const password = document.getElementById('user_password'); const confirmation = document.getElementById('user_password_confirmation'); if (!confirmation) return; @@ -171,10 +171,10 @@ function main() { } }); - delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original')); - delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static')); + Rails.delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original')); + Rails.delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static')); - delegate(document, '.status__content__spoiler-link', 'click', function() { + Rails.delegate(document, '.status__content__spoiler-link', 'click', function() { const statusEl = this.parentNode.parentNode; if (statusEl.dataset.spoiler === 'expanded') { @@ -210,11 +210,11 @@ function main() { sidebar.classList.toggle('visible'); }; - delegate(document, '.sidebar__toggle__icon', 'click', () => { + Rails.delegate(document, '.sidebar__toggle__icon', 'click', () => { toggleSidebar(); }); - delegate(document, '.sidebar__toggle__icon', 'keydown', e => { + Rails.delegate(document, '.sidebar__toggle__icon', 'keydown', e => { if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); toggleSidebar(); @@ -223,7 +223,7 @@ function main() { // Empty the honeypot fields in JS in case something like an extension // automatically filled them. - delegate(document, '#registration_new_user,#new_user', 'submit', () => { + Rails.delegate(document, '#registration_new_user,#new_user', 'submit', () => { ['user_website', 'user_confirm_password', 'registration_user_website', 'registration_user_confirm_password'].forEach(id => { const field = document.getElementById(id); if (field) { diff --git a/app/javascript/flavours/glitch/packs/settings.js b/app/javascript/flavours/glitch/packs/settings.js index c7562edf3d..d9f3b68602 100644 --- a/app/javascript/flavours/glitch/packs/settings.js +++ b/app/javascript/flavours/glitch/packs/settings.js @@ -1,5 +1,5 @@ import 'packs/public-path'; -import { delegate } from '@rails/ujs'; +import Rails from '@rails/ujs'; import loadKeyboardExtensions from 'flavours/glitch/load_keyboard_extensions'; import { loadPolyfills } from 'flavours/glitch/polyfills'; @@ -22,11 +22,11 @@ function main() { sidebar.classList.toggle('visible'); }; - delegate(document, '.sidebar__toggle__icon', 'click', () => { + Rails.delegate(document, '.sidebar__toggle__icon', 'click', () => { toggleSidebar(); }); - delegate(document, '.sidebar__toggle__icon', 'keydown', e => { + Rails.delegate(document, '.sidebar__toggle__icon', 'keydown', e => { if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); toggleSidebar(); diff --git a/app/javascript/flavours/glitch/reducers/alerts.js b/app/javascript/flavours/glitch/reducers/alerts.js index 4e237d419d..bd49d748f9 100644 --- a/app/javascript/flavours/glitch/reducers/alerts.js +++ b/app/javascript/flavours/glitch/reducers/alerts.js @@ -4,7 +4,7 @@ import { ALERT_SHOW, ALERT_DISMISS, ALERT_CLEAR, -} from 'flavours/glitch/actions/alerts'; +} from '../actions/alerts'; const initialState = ImmutableList([]); diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 96d9774650..b9da3c84bc 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -53,16 +53,15 @@ import { COMPOSE_CHANGE_MEDIA_DESCRIPTION, COMPOSE_CHANGE_MEDIA_FOCUS, COMPOSE_SET_STATUS, -} from 'flavours/glitch/actions/compose'; -import { REDRAFT } from 'flavours/glitch/actions/statuses'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; -import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines'; -import { me, defaultContentType } from 'flavours/glitch/initial_state'; -import { recoverHashtags } from 'flavours/glitch/utils/hashtag'; -import { unescapeHTML } from 'flavours/glitch/utils/html'; -import { overwrite } from 'flavours/glitch/utils/js_helpers'; -import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; - +} from '../actions/compose'; +import { REDRAFT } from '../actions/statuses'; +import { STORE_HYDRATE } from '../actions/store'; +import { TIMELINE_DELETE } from '../actions/timelines'; +import { me, defaultContentType } from '../initial_state'; +import { recoverHashtags } from '../utils/hashtag'; +import { unescapeHTML } from '../utils/html'; +import { overwrite } from '../utils/js_helpers'; +import { privacyPreference } from '../utils/privacy_preference'; import { uuid } from '../uuid'; const totalElefriends = 3; diff --git a/app/javascript/flavours/glitch/reducers/contexts.js b/app/javascript/flavours/glitch/reducers/contexts.js index 552709383e..32e194dd42 100644 --- a/app/javascript/flavours/glitch/reducers/contexts.js +++ b/app/javascript/flavours/glitch/reducers/contexts.js @@ -3,10 +3,9 @@ import { Map as ImmutableMap, List as ImmutableList } from 'immutable'; import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, -} from 'flavours/glitch/actions/accounts'; -import { CONTEXT_FETCH_SUCCESS } from 'flavours/glitch/actions/statuses'; -import { TIMELINE_DELETE, TIMELINE_UPDATE } from 'flavours/glitch/actions/timelines'; - +} from '../actions/accounts'; +import { CONTEXT_FETCH_SUCCESS } from '../actions/statuses'; +import { TIMELINE_DELETE, TIMELINE_UPDATE } from '../actions/timelines'; import { compareId } from '../compare_id'; const initialState = ImmutableMap({ @@ -68,7 +67,8 @@ const deleteFromContexts = (immutableState, ids) => immutableState.withMutations }); const filterContexts = (state, relationship, statuses) => { - const ownedStatusIds = statuses.filter(status => status.get('account') === relationship.id) + const ownedStatusIds = statuses + .filter(status => status.get('account') === relationship.id) .map(status => status.get('id')); return deleteFromContexts(state, ownedStatusIds); diff --git a/app/javascript/flavours/glitch/reducers/custom_emojis.js b/app/javascript/flavours/glitch/reducers/custom_emojis.js index 13396db7e7..56ec80f2ff 100644 --- a/app/javascript/flavours/glitch/reducers/custom_emojis.js +++ b/app/javascript/flavours/glitch/reducers/custom_emojis.js @@ -1,8 +1,8 @@ import { List as ImmutableList, fromJS as ConvertToImmutable } from 'immutable'; -import { CUSTOM_EMOJIS_FETCH_SUCCESS } from 'flavours/glitch/actions/custom_emojis'; -import { buildCustomEmojis } from 'flavours/glitch/features/emoji/emoji'; -import { search as emojiSearch } from 'flavours/glitch/features/emoji/emoji_mart_search_light'; +import { CUSTOM_EMOJIS_FETCH_SUCCESS } from '../actions/custom_emojis'; +import { buildCustomEmojis } from '../features/emoji/emoji'; +import { search as emojiSearch } from '../features/emoji/emoji_mart_search_light'; const initialState = ImmutableList([]); diff --git a/app/javascript/flavours/glitch/reducers/height_cache.js b/app/javascript/flavours/glitch/reducers/height_cache.js index 89282994e3..2664d4f824 100644 --- a/app/javascript/flavours/glitch/reducers/height_cache.js +++ b/app/javascript/flavours/glitch/reducers/height_cache.js @@ -1,6 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; -import { HEIGHT_CACHE_SET, HEIGHT_CACHE_CLEAR } from 'flavours/glitch/actions/height_cache'; +import { HEIGHT_CACHE_SET, HEIGHT_CACHE_CLEAR } from '../actions/height_cache'; const initialState = ImmutableMap(); diff --git a/app/javascript/flavours/glitch/reducers/index.ts b/app/javascript/flavours/glitch/reducers/index.ts index a87e75fcad..79febbce3d 100644 --- a/app/javascript/flavours/glitch/reducers/index.ts +++ b/app/javascript/flavours/glitch/reducers/index.ts @@ -68,8 +68,8 @@ const reducers = { push_notifications, mutes, blocks, - server, boosts, + server, contexts, compose, search, diff --git a/app/javascript/flavours/glitch/reducers/media_attachments.js b/app/javascript/flavours/glitch/reducers/media_attachments.js index 5086126ab7..cbb4933bc7 100644 --- a/app/javascript/flavours/glitch/reducers/media_attachments.js +++ b/app/javascript/flavours/glitch/reducers/media_attachments.js @@ -1,6 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; +import { STORE_HYDRATE } from '../actions/store'; const initialState = ImmutableMap({ accept_content_types: [], diff --git a/app/javascript/flavours/glitch/reducers/mutes.js b/app/javascript/flavours/glitch/reducers/mutes.js index d346d9a78a..a9eb61ff83 100644 --- a/app/javascript/flavours/glitch/reducers/mutes.js +++ b/app/javascript/flavours/glitch/reducers/mutes.js @@ -4,7 +4,7 @@ import { MUTES_INIT_MODAL, MUTES_TOGGLE_HIDE_NOTIFICATIONS, MUTES_CHANGE_DURATION, -} from 'flavours/glitch/actions/mutes'; +} from '../actions/mutes'; const initialState = Immutable.Map({ new: Immutable.Map({ diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js index 9a4b75dce1..7bb11459ca 100644 --- a/app/javascript/flavours/glitch/reducers/notifications.js +++ b/app/javascript/flavours/glitch/reducers/notifications.js @@ -1,15 +1,16 @@ import { fromJS, Map as ImmutableMap, List as ImmutableList } from 'immutable'; +import { DOMAIN_BLOCK_SUCCESS } from 'flavours/glitch/actions/domain_blocks'; + import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, FOLLOW_REQUEST_AUTHORIZE_SUCCESS, FOLLOW_REQUEST_REJECT_SUCCESS, -} from 'flavours/glitch/actions/accounts'; -import { DOMAIN_BLOCK_SUCCESS } from 'flavours/glitch/actions/domain_blocks'; +} from '../actions/accounts'; import { MARKERS_FETCH_SUCCESS, -} from 'flavours/glitch/actions/markers'; +} from '../actions/markers'; import { NOTIFICATIONS_MOUNT, NOTIFICATIONS_UNMOUNT, @@ -31,9 +32,8 @@ import { NOTIFICATIONS_MARK_AS_READ, NOTIFICATIONS_SET_BROWSER_SUPPORT, NOTIFICATIONS_SET_BROWSER_PERMISSION, -} from 'flavours/glitch/actions/notifications'; -import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from 'flavours/glitch/actions/timelines'; - +} from '../actions/notifications'; +import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from '../actions/timelines'; import { compareId } from '../compare_id'; const initialState = ImmutableMap({ diff --git a/app/javascript/flavours/glitch/reducers/picture_in_picture.js b/app/javascript/flavours/glitch/reducers/picture_in_picture.js index 395c21245f..961fc5699c 100644 --- a/app/javascript/flavours/glitch/reducers/picture_in_picture.js +++ b/app/javascript/flavours/glitch/reducers/picture_in_picture.js @@ -1,5 +1,6 @@ import { PICTURE_IN_PICTURE_DEPLOY, PICTURE_IN_PICTURE_REMOVE } from 'flavours/glitch/actions/picture_in_picture'; -import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines'; + +import { TIMELINE_DELETE } from '../actions/timelines'; const initialState = { statusId: null, diff --git a/app/javascript/flavours/glitch/reducers/push_notifications.js b/app/javascript/flavours/glitch/reducers/push_notifications.js index 23aa9bd033..fa8af0e8cc 100644 --- a/app/javascript/flavours/glitch/reducers/push_notifications.js +++ b/app/javascript/flavours/glitch/reducers/push_notifications.js @@ -1,7 +1,7 @@ import Immutable from 'immutable'; -import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, SET_ALERTS } from 'flavours/glitch/actions/push_notifications'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; +import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, SET_ALERTS } from '../actions/push_notifications'; +import { STORE_HYDRATE } from '../actions/store'; const initialState = Immutable.Map({ subscription: null, diff --git a/app/javascript/flavours/glitch/reducers/relationships.js b/app/javascript/flavours/glitch/reducers/relationships.js index 38fd0caa49..d1ccf9ac95 100644 --- a/app/javascript/flavours/glitch/reducers/relationships.js +++ b/app/javascript/flavours/glitch/reducers/relationships.js @@ -2,7 +2,7 @@ import { Map as ImmutableMap, fromJS } from 'immutable'; import { ACCOUNT_NOTE_SUBMIT_SUCCESS, -} from 'flavours/glitch/actions/account_notes'; +} from '../actions/account_notes'; import { ACCOUNT_FOLLOW_SUCCESS, ACCOUNT_FOLLOW_REQUEST, @@ -19,12 +19,11 @@ import { RELATIONSHIPS_FETCH_SUCCESS, FOLLOW_REQUEST_AUTHORIZE_SUCCESS, FOLLOW_REQUEST_REJECT_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { DOMAIN_BLOCK_SUCCESS, DOMAIN_UNBLOCK_SUCCESS, -} from 'flavours/glitch/actions/domain_blocks'; - +} from '../actions/domain_blocks'; import { NOTIFICATIONS_UPDATE, } from '../actions/notifications'; diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index e4144db62e..72835eb917 100644 --- a/app/javascript/flavours/glitch/reducers/search.js +++ b/app/javascript/flavours/glitch/reducers/search.js @@ -4,7 +4,7 @@ import { COMPOSE_MENTION, COMPOSE_REPLY, COMPOSE_DIRECT, -} from 'flavours/glitch/actions/compose'; +} from '../actions/compose'; import { SEARCH_CHANGE, SEARCH_CLEAR, @@ -16,7 +16,7 @@ import { SEARCH_EXPAND_SUCCESS, SEARCH_EXPAND_FAIL, SEARCH_HISTORY_UPDATE, -} from 'flavours/glitch/actions/search'; +} from '../actions/search'; const initialState = ImmutableMap({ value: '', diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js index 19a6e43e34..3d04419d8d 100644 --- a/app/javascript/flavours/glitch/reducers/settings.js +++ b/app/javascript/flavours/glitch/reducers/settings.js @@ -1,13 +1,12 @@ import { Map as ImmutableMap, fromJS } from 'immutable'; -import { COLUMN_ADD, COLUMN_REMOVE, COLUMN_MOVE, COLUMN_PARAMS_CHANGE } from 'flavours/glitch/actions/columns'; -import { EMOJI_USE } from 'flavours/glitch/actions/emojis'; -import { LANGUAGE_USE } from 'flavours/glitch/actions/languages'; -import { NOTIFICATIONS_FILTER_SET } from 'flavours/glitch/actions/notifications'; -import { SETTING_CHANGE, SETTING_SAVE } from 'flavours/glitch/actions/settings'; -import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; - +import { COLUMN_ADD, COLUMN_REMOVE, COLUMN_MOVE, COLUMN_PARAMS_CHANGE } from '../actions/columns'; +import { EMOJI_USE } from '../actions/emojis'; +import { LANGUAGE_USE } from '../actions/languages'; import { LIST_DELETE_SUCCESS, LIST_FETCH_FAIL } from '../actions/lists'; +import { NOTIFICATIONS_FILTER_SET } from '../actions/notifications'; +import { SETTING_CHANGE, SETTING_SAVE } from '../actions/settings'; +import { STORE_HYDRATE } from '../actions/store'; import { uuid } from '../uuid'; const initialState = ImmutableMap({ diff --git a/app/javascript/flavours/glitch/reducers/status_lists.js b/app/javascript/flavours/glitch/reducers/status_lists.js index c4780a661f..41cc07341c 100644 --- a/app/javascript/flavours/glitch/reducers/status_lists.js +++ b/app/javascript/flavours/glitch/reducers/status_lists.js @@ -3,7 +3,7 @@ import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutabl import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { BOOKMARKED_STATUSES_FETCH_REQUEST, BOOKMARKED_STATUSES_FETCH_SUCCESS, @@ -11,7 +11,7 @@ import { BOOKMARKED_STATUSES_EXPAND_REQUEST, BOOKMARKED_STATUSES_EXPAND_SUCCESS, BOOKMARKED_STATUSES_EXPAND_FAIL, -} from 'flavours/glitch/actions/bookmarks'; +} from '../actions/bookmarks'; import { FAVOURITED_STATUSES_FETCH_REQUEST, FAVOURITED_STATUSES_FETCH_SUCCESS, @@ -19,7 +19,7 @@ import { FAVOURITED_STATUSES_EXPAND_REQUEST, FAVOURITED_STATUSES_EXPAND_SUCCESS, FAVOURITED_STATUSES_EXPAND_FAIL, -} from 'flavours/glitch/actions/favourites'; +} from '../actions/favourites'; import { FAVOURITE_SUCCESS, UNFAVOURITE_SUCCESS, @@ -27,10 +27,10 @@ import { UNBOOKMARK_SUCCESS, PIN_SUCCESS, UNPIN_SUCCESS, -} from 'flavours/glitch/actions/interactions'; +} from '../actions/interactions'; import { PINNED_STATUSES_FETCH_SUCCESS, -} from 'flavours/glitch/actions/pin_statuses'; +} from '../actions/pin_statuses'; import { TRENDS_STATUSES_FETCH_REQUEST, TRENDS_STATUSES_FETCH_SUCCESS, @@ -38,7 +38,7 @@ import { TRENDS_STATUSES_EXPAND_REQUEST, TRENDS_STATUSES_EXPAND_SUCCESS, TRENDS_STATUSES_EXPAND_FAIL, -} from 'flavours/glitch/actions/trends'; +} from '../actions/trends'; diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js index 59da21ad6a..683fe848f7 100644 --- a/app/javascript/flavours/glitch/reducers/statuses.js +++ b/app/javascript/flavours/glitch/reducers/statuses.js @@ -1,5 +1,7 @@ import { Map as ImmutableMap, fromJS } from 'immutable'; +import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; +import { normalizeStatusTranslation } from '../actions/importer/normalizer'; import { REBLOG_REQUEST, REBLOG_FAIL, @@ -13,7 +15,7 @@ import { BOOKMARK_FAIL, UNBOOKMARK_REQUEST, UNBOOKMARK_FAIL, -} from 'flavours/glitch/actions/interactions'; +} from '../actions/interactions'; import { STATUS_MUTE_SUCCESS, STATUS_UNMUTE_SUCCESS, @@ -24,13 +26,8 @@ import { STATUS_TRANSLATE_UNDO, STATUS_FETCH_REQUEST, STATUS_FETCH_FAIL, -} from 'flavours/glitch/actions/statuses'; -import { - TIMELINE_DELETE, -} from 'flavours/glitch/actions/timelines'; - -import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; -import { normalizeStatusTranslation } from '../actions/importer/normalizer'; +} from '../actions/statuses'; +import { TIMELINE_DELETE } from '../actions/timelines'; const importStatus = (state, status) => state.set(status.id, fromJS(status)); diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index 76bc6c8174..69f28d6849 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -4,7 +4,7 @@ import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS, ACCOUNT_UNFOLLOW_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { TIMELINE_UPDATE, TIMELINE_DELETE, @@ -17,8 +17,7 @@ import { TIMELINE_DISCONNECT, TIMELINE_LOAD_PENDING, TIMELINE_MARK_AS_PARTIAL, -} from 'flavours/glitch/actions/timelines'; - +} from '../actions/timelines'; import { compareId } from '../compare_id'; const initialState = ImmutableMap(); diff --git a/app/javascript/flavours/glitch/reducers/user_lists.js b/app/javascript/flavours/glitch/reducers/user_lists.js index d37451d005..76786b4220 100644 --- a/app/javascript/flavours/glitch/reducers/user_lists.js +++ b/app/javascript/flavours/glitch/reducers/user_lists.js @@ -1,5 +1,19 @@ import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable'; +import { + DIRECTORY_FETCH_REQUEST, + DIRECTORY_FETCH_SUCCESS, + DIRECTORY_FETCH_FAIL, + DIRECTORY_EXPAND_REQUEST, + DIRECTORY_EXPAND_SUCCESS, + DIRECTORY_EXPAND_FAIL, +} from 'flavours/glitch/actions/directory'; +import { + FEATURED_TAGS_FETCH_REQUEST, + FEATURED_TAGS_FETCH_SUCCESS, + FEATURED_TAGS_FETCH_FAIL, +} from 'flavours/glitch/actions/featured_tags'; + import { FOLLOWERS_FETCH_REQUEST, FOLLOWERS_FETCH_SUCCESS, @@ -21,7 +35,7 @@ import { FOLLOW_REQUESTS_EXPAND_FAIL, FOLLOW_REQUEST_AUTHORIZE_SUCCESS, FOLLOW_REQUEST_REJECT_SUCCESS, -} from 'flavours/glitch/actions/accounts'; +} from '../actions/accounts'; import { BLOCKS_FETCH_REQUEST, BLOCKS_FETCH_SUCCESS, @@ -29,20 +43,7 @@ import { BLOCKS_EXPAND_REQUEST, BLOCKS_EXPAND_SUCCESS, BLOCKS_EXPAND_FAIL, -} from 'flavours/glitch/actions/blocks'; -import { - DIRECTORY_FETCH_REQUEST, - DIRECTORY_FETCH_SUCCESS, - DIRECTORY_FETCH_FAIL, - DIRECTORY_EXPAND_REQUEST, - DIRECTORY_EXPAND_SUCCESS, - DIRECTORY_EXPAND_FAIL, -} from 'flavours/glitch/actions/directory'; -import { - FEATURED_TAGS_FETCH_REQUEST, - FEATURED_TAGS_FETCH_SUCCESS, - FEATURED_TAGS_FETCH_FAIL, -} from 'flavours/glitch/actions/featured_tags'; +} from '../actions/blocks'; import { REBLOGS_FETCH_REQUEST, REBLOGS_FETCH_SUCCESS, @@ -56,7 +57,7 @@ import { FAVOURITES_EXPAND_REQUEST, FAVOURITES_EXPAND_SUCCESS, FAVOURITES_EXPAND_FAIL, -} from 'flavours/glitch/actions/interactions'; +} from '../actions/interactions'; import { MUTES_FETCH_REQUEST, MUTES_FETCH_SUCCESS, @@ -64,13 +65,13 @@ import { MUTES_EXPAND_REQUEST, MUTES_EXPAND_SUCCESS, MUTES_EXPAND_FAIL, -} from 'flavours/glitch/actions/mutes'; - +} from '../actions/mutes'; import { NOTIFICATIONS_UPDATE, } from '../actions/notifications'; + const initialListState = ImmutableMap({ next: null, isLoading: false, diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js index a296ef8ede..74188aff6d 100644 --- a/app/javascript/flavours/glitch/selectors/index.js +++ b/app/javascript/flavours/glitch/selectors/index.js @@ -1,9 +1,10 @@ import { List as ImmutableList, Map as ImmutableMap } from 'immutable'; import { createSelector } from 'reselect'; -import { me } from 'flavours/glitch/initial_state'; import { toServerSideType } from 'flavours/glitch/utils/filters'; +import { me } from '../initial_state'; + const getAccountBase = (state, id) => state.getIn(['accounts', id], null); const getAccountCounters = (state, id) => state.getIn(['accounts_counters', id], null); const getAccountRelationship = (state, id) => state.getIn(['relationships', id], null); diff --git a/app/javascript/flavours/glitch/store/middlewares/errors.ts b/app/javascript/flavours/glitch/store/middlewares/errors.ts index 2697f80f18..4e720bfed4 100644 --- a/app/javascript/flavours/glitch/store/middlewares/errors.ts +++ b/app/javascript/flavours/glitch/store/middlewares/errors.ts @@ -1,8 +1,7 @@ import type { AnyAction, Middleware } from 'redux'; -import { showAlertForError } from 'flavours/glitch/actions/alerts'; - import type { RootState } from '..'; +import { showAlertForError } from '../../actions/alerts'; const defaultFailSuffix = 'FAIL'; diff --git a/app/javascript/flavours/glitch/stream.js b/app/javascript/flavours/glitch/stream.js index 55f009e130..ff3af5fd88 100644 --- a/app/javascript/flavours/glitch/stream.js +++ b/app/javascript/flavours/glitch/stream.js @@ -1,6 +1,7 @@ // @ts-check import WebSocketClient from '@gamestdio/websocket'; + /** * @type {WebSocketClient | undefined} */ @@ -85,12 +86,12 @@ const unsubscribe = ({ channelName, params, onDisconnect }) => { }; const sharedCallbacks = { - connected () { + connected() { subscriptions.forEach(subscription => subscribe(subscription)); }, // @ts-expect-error - received (data) { + received(data) { const { stream } = data; subscriptions.filter(({ channelName, params }) => { @@ -114,11 +115,11 @@ const sharedCallbacks = { }); }, - disconnected () { + disconnected() { subscriptions.forEach(subscription => unsubscribe(subscription)); }, - reconnected () { + reconnected() { }, }; @@ -151,19 +152,19 @@ export const connectStream = (channelName, params, callbacks) => (dispatch, getS // to using individual connections for each channel if (!streamingAPIBaseURL.startsWith('ws')) { const connection = createConnection(streamingAPIBaseURL, accessToken, channelNameWithInlineParams(channelName, params), { - connected () { + connected() { onConnect(); }, - received (data) { + received(data) { onReceive(data); }, - disconnected () { + disconnected() { onDisconnect(); }, - reconnected () { + reconnected() { onConnect(); }, }); @@ -239,10 +240,10 @@ const createConnection = (streamingAPIBaseURL, accessToken, channelName, { conne const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken); // @ts-expect-error - ws.onopen = connected; - ws.onmessage = e => received(JSON.parse(e.data)); + ws.onopen = connected; + ws.onmessage = e => received(JSON.parse(e.data)); // @ts-expect-error - ws.onclose = disconnected; + ws.onclose = disconnected; // @ts-expect-error ws.onreconnect = reconnected; @@ -265,7 +266,7 @@ const createConnection = (streamingAPIBaseURL, accessToken, channelName, { conne }; KNOWN_EVENT_TYPES.forEach(type => { - es.addEventListener(type, e => handleEventSourceMessage(/** @type {MessageEvent} */ (e), received)); + es.addEventListener(type, e => handleEventSourceMessage(/** @type {MessageEvent} */(e), received)); }); es.onerror = /** @type {function(): void} */ (disconnected); diff --git a/app/javascript/flavours/glitch/styles/components/accounts.scss b/app/javascript/flavours/glitch/styles/components/accounts.scss index e68c6cac04..5d4426fbc6 100644 --- a/app/javascript/flavours/glitch/styles/components/accounts.scss +++ b/app/javascript/flavours/glitch/styles/components/accounts.scss @@ -27,21 +27,6 @@ -webkit-box-orient: vertical; color: $ui-secondary-color; } - - &.small { - border: 0; - padding: 0; - - & > .account__avatar-wrapper { - margin: 0; - margin-inline-end: 8px; - } - - & > .display-name { - height: 24px; - line-height: 24px; - } - } } .follow-recommendations-account { diff --git a/app/javascript/flavours/glitch/styles/components/compose_form.scss b/app/javascript/flavours/glitch/styles/components/compose_form.scss index 3cfcf2ea7a..ac560f68e7 100644 --- a/app/javascript/flavours/glitch/styles/components/compose_form.scss +++ b/app/javascript/flavours/glitch/styles/components/compose_form.scss @@ -104,10 +104,7 @@ } input[type='checkbox'] { - display: none; - } - - .checkbox { + appearance: none; display: inline-block; position: relative; border: 1px solid $ui-primary-color; @@ -120,8 +117,9 @@ top: -1px; border-radius: 4px; vertical-align: middle; + cursor: inherit; - &.active { + &:checked { border-color: $highlight-text-color; background: $highlight-text-color url("data:image/svg+xml;utf8,") @@ -145,10 +143,6 @@ .reply-indicator__header { margin-bottom: 5px; overflow: hidden; - - & > .account.small { - color: $inverted-text-color; - } } .quote-indicator__cancel, @@ -157,6 +151,27 @@ line-height: 24px; } +.quote-indicator__display-name, +.reply-indicator__display-name { + color: $inverted-text-color; + display: block; + max-width: 100%; + line-height: 24px; + overflow: hidden; + text-decoration: none; + + & > .display-name { + line-height: unset; + height: unset; + } +} + +.quote-indicator__display-avatar, +.reply-indicator__display-avatar { + float: left; + margin-inline-end: 5px; +} + .quote-indicator__content, .reply-indicator__content { position: relative; @@ -314,9 +329,9 @@ background: darken($ui-secondary-color, 10%); } - > .account, - > .emoji, - > .autosuggest-hashtag { + .autosuggest-account, + .autosuggest-emoji, + .autosuggest-hashtag { display: flex; flex-direction: row; align-items: center; @@ -348,12 +363,13 @@ } } - & > .account.small { - .display-name { - & > span { - color: $lighter-text-color; - } - } + .autosuggest-account-icon, + .autosuggest-emoji img { + margin-inline-end: 8px; + } + + .autosuggest-account .display-name > span { + color: $lighter-text-color; } } diff --git a/app/javascript/flavours/glitch/styles/components/explore.scss b/app/javascript/flavours/glitch/styles/components/explore.scss index 78826e6331..79da9f2166 100644 --- a/app/javascript/flavours/glitch/styles/components/explore.scss +++ b/app/javascript/flavours/glitch/styles/components/explore.scss @@ -37,6 +37,9 @@ flex: 1 1 auto; display: flex; flex-direction: column; + background: $ui-base-color; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; } .story { diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index cdd30b6f1a..ac75d18d0f 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -1268,3 +1268,30 @@ a.status-card.compact:hover { border-color: lighten($ui-base-color, 12%); } } + +.hashtag-bar { + margin-top: 16px; + display: flex; + flex-wrap: wrap; + font-size: 14px; + line-height: 18px; + gap: 4px; + color: $darker-text-color; + + a { + display: inline-flex; + color: inherit; + text-decoration: none; + + &:hover span { + text-decoration: underline; + } + } + + .link-button { + color: inherit; + font-size: inherit; + line-height: inherit; + padding: 0; + } +} diff --git a/app/javascript/flavours/glitch/utils/dom_helpers.js b/app/javascript/flavours/glitch/utils/dom_helpers.js deleted file mode 100644 index bc5e200fcc..0000000000 --- a/app/javascript/flavours/glitch/utils/dom_helpers.js +++ /dev/null @@ -1,7 +0,0 @@ -// Focuses the root element. -export function focusRoot () { - let e; - if (document && (e = document.querySelector('.ui')) && (e = e.parentElement)) { - e.focus(); - } -} diff --git a/app/javascript/flavours/glitch/utils/html.js b/app/javascript/flavours/glitch/utils/html.js index 5159df9db7..247e98c88a 100644 --- a/app/javascript/flavours/glitch/utils/html.js +++ b/app/javascript/flavours/glitch/utils/html.js @@ -1,3 +1,4 @@ +// NB: This function can still return unsafe HTML export const unescapeHTML = (html) => { const wrapper = document.createElement('div'); wrapper.innerHTML = html.replace(//g, '\n').replace(/<\/p>

/g, '\n\n').replace(/<[^>]*>/g, ''); diff --git a/app/javascript/flavours/glitch/utils/icons.jsx b/app/javascript/flavours/glitch/utils/icons.jsx index 225345af68..be566032e0 100644 --- a/app/javascript/flavours/glitch/utils/icons.jsx +++ b/app/javascript/flavours/glitch/utils/icons.jsx @@ -1,3 +1,5 @@ +// Copied from emoji-mart for consistency with emoji picker and since +// they don't export the icons in the package export const loupeIcon = ( diff --git a/app/javascript/flavours/glitch/utils/notifications.js b/app/javascript/flavours/glitch/utils/notifications.js index 3cdf7caea0..42623ac7c6 100644 --- a/app/javascript/flavours/glitch/utils/notifications.js +++ b/app/javascript/flavours/glitch/utils/notifications.js @@ -3,7 +3,7 @@ const checkNotificationPromise = () => { try { - // eslint-disable-next-line promise/catch-or-return, promise/valid-params + // eslint-disable-next-line promise/valid-params, promise/catch-or-return Notification.requestPermission().then(); } catch(e) { return false; diff --git a/app/javascript/flavours/glitch/utils/numbers.ts b/app/javascript/flavours/glitch/utils/numbers.ts index 7139bf8039..35bcde83e2 100644 --- a/app/javascript/flavours/glitch/utils/numbers.ts +++ b/app/javascript/flavours/glitch/utils/numbers.ts @@ -1,4 +1,4 @@ -import type { ValueOf } from 'flavours/glitch/types/util'; +import type { ValueOf } from '../types/util'; export const DECIMAL_UNITS = Object.freeze({ ONE: 1, diff --git a/app/javascript/flavours/glitch/utils/react_router.jsx b/app/javascript/flavours/glitch/utils/react_router.jsx new file mode 100644 index 0000000000..fa8f0db2b5 --- /dev/null +++ b/app/javascript/flavours/glitch/utils/react_router.jsx @@ -0,0 +1,61 @@ +import PropTypes from "prop-types"; + +import { __RouterContext } from "react-router"; + +import hoistStatics from "hoist-non-react-statics"; + +export const WithRouterPropTypes = { + match: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, + history: PropTypes.object.isRequired, +}; + +export const WithOptionalRouterPropTypes = { + match: PropTypes.object, + location: PropTypes.object, + history: PropTypes.object, +}; + +// This is copied from https://github.com/remix-run/react-router/blob/v5.3.4/packages/react-router/modules/withRouter.js +// but does not fail if called outside of a React Router context +export function withOptionalRouter(Component) { + const displayName = `withRouter(${Component.displayName || Component.name})`; + const C = props => { + const { wrappedComponentRef, ...remainingProps } = props; + + return ( + <__RouterContext.Consumer> + {context => { + if(context) + return ( + + ); + else + return ( + + ); + }} + + ); + }; + + C.displayName = displayName; + C.WrappedComponent = Component; + C.propTypes = { + ...Component.propTypes, + wrappedComponentRef: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.func, + PropTypes.object + ]) + }; + + return hoistStatics(C, Component); +} diff --git a/app/javascript/mastodon/components/__tests__/button-test.jsx b/app/javascript/mastodon/components/__tests__/button-test.jsx index 6de961f784..ad7a0c49ca 100644 --- a/app/javascript/mastodon/components/__tests__/button-test.jsx +++ b/app/javascript/mastodon/components/__tests__/button-test.jsx @@ -1,7 +1,7 @@ import { render, fireEvent, screen } from '@testing-library/react'; import renderer from 'react-test-renderer'; -import Button from '../button'; +import { Button } from '../button'; describe('', () => { it('renders a button element', () => { diff --git a/app/javascript/mastodon/components/account.jsx b/app/javascript/mastodon/components/account.jsx index fd5ea60407..e4e3c88b6f 100644 --- a/app/javascript/mastodon/components/account.jsx +++ b/app/javascript/mastodon/components/account.jsx @@ -15,10 +15,9 @@ import { VerifiedBadge } from 'mastodon/components/verified_badge'; import { me } from '../initial_state'; import { Avatar } from './avatar'; -import Button from './button'; +import { Button } from './button'; import { FollowersCounter } from './counters'; import { DisplayName } from './display_name'; -import { IconButton } from './icon_button'; import { RelativeTimestamp } from './relative_timestamp'; const messages = defineMessages({ @@ -45,10 +44,7 @@ class Account extends ImmutablePureComponent { intl: PropTypes.object.isRequired, hidden: PropTypes.bool, minimal: PropTypes.bool, - actionIcon: PropTypes.string, - actionTitle: PropTypes.string, defaultAction: PropTypes.string, - onActionClick: PropTypes.func, withBio: PropTypes.bool, }; @@ -76,12 +72,8 @@ class Account extends ImmutablePureComponent { this.props.onMuteNotifications(this.props.account, false); }; - handleAction = () => { - this.props.onActionClick(this.props.account); - }; - render () { - const { account, intl, hidden, withBio, onActionClick, actionIcon, actionTitle, defaultAction, size, minimal } = this.props; + const { account, intl, hidden, withBio, defaultAction, size, minimal } = this.props; if (!account) { return ; @@ -98,9 +90,7 @@ class Account extends ImmutablePureComponent { let buttons; - if (actionIcon && onActionClick) { - buttons = ; - } else if (!actionIcon && account.get('id') !== me && account.get('relationship', null) !== null) { + if (account.get('id') !== me && account.get('relationship', null) !== null) { const following = account.getIn(['relationship', 'following']); const requested = account.getIn(['relationship', 'requested']); const blocking = account.getIn(['relationship', 'blocking']); diff --git a/app/javascript/mastodon/components/attachment_list.jsx b/app/javascript/mastodon/components/attachment_list.jsx index 71cb645c5c..ebf092b83d 100644 --- a/app/javascript/mastodon/components/attachment_list.jsx +++ b/app/javascript/mastodon/components/attachment_list.jsx @@ -7,6 +7,8 @@ import classNames from 'classnames'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as LinkIcon } from '@material-symbols/svg-600/outlined/link.svg'; + import { Icon } from 'mastodon/components/icon'; const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; @@ -25,7 +27,7 @@ export default class AttachmentList extends ImmutablePureComponent {

{!compact && (
- +
)} @@ -36,7 +38,7 @@ export default class AttachmentList extends ImmutablePureComponent { return (
  • - {compact && } + {compact && } {compact && ' ' } {displayUrl ? filename(displayUrl) : } diff --git a/app/javascript/mastodon/components/autosuggest_emoji.jsx b/app/javascript/mastodon/components/autosuggest_emoji.jsx index 5fa946f707..28f628b4ac 100644 --- a/app/javascript/mastodon/components/autosuggest_emoji.jsx +++ b/app/javascript/mastodon/components/autosuggest_emoji.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { assetHost } from 'mastodon/utils/config'; -import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light'; +import { unicodeMapping } from '../features/emoji/emoji_unicode_mapping_light'; export default class AutosuggestEmoji extends PureComponent { diff --git a/app/javascript/mastodon/components/badge.jsx b/app/javascript/mastodon/components/badge.jsx index 235aef0c26..2f762fed5f 100644 --- a/app/javascript/mastodon/components/badge.jsx +++ b/app/javascript/mastodon/components/badge.jsx @@ -2,9 +2,9 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -import { ReactComponent as GroupsIcon } from '@material-design-icons/svg/outlined/group.svg'; -import { ReactComponent as PersonIcon } from '@material-design-icons/svg/outlined/person.svg'; -import { ReactComponent as SmartToyIcon } from '@material-design-icons/svg/outlined/smart_toy.svg'; +import { ReactComponent as GroupsIcon } from '@material-symbols/svg-600/outlined/group.svg'; +import { ReactComponent as PersonIcon } from '@material-symbols/svg-600/outlined/person.svg'; +import { ReactComponent as SmartToyIcon } from '@material-symbols/svg-600/outlined/smart_toy.svg'; export const Badge = ({ icon, label, domain }) => ( diff --git a/app/javascript/mastodon/components/button.jsx b/app/javascript/mastodon/components/button.jsx deleted file mode 100644 index faa6cb2910..0000000000 --- a/app/javascript/mastodon/components/button.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import PropTypes from 'prop-types'; -import { PureComponent } from 'react'; - -import classNames from 'classnames'; - -export default class Button extends PureComponent { - - static propTypes = { - text: PropTypes.node, - type: PropTypes.string, - onClick: PropTypes.func, - disabled: PropTypes.bool, - block: PropTypes.bool, - secondary: PropTypes.bool, - className: PropTypes.string, - title: PropTypes.string, - children: PropTypes.node, - }; - - static defaultProps = { - type: 'button', - }; - - handleClick = (e) => { - if (!this.props.disabled && this.props.onClick) { - this.props.onClick(e); - } - }; - - setRef = (c) => { - this.node = c; - }; - - focus() { - this.node.focus(); - } - - render () { - const className = classNames('button', this.props.className, { - 'button-secondary': this.props.secondary, - 'button--block': this.props.block, - }); - - return ( - - ); - } - -} diff --git a/app/javascript/mastodon/components/button.tsx b/app/javascript/mastodon/components/button.tsx new file mode 100644 index 0000000000..0b6a0f267e --- /dev/null +++ b/app/javascript/mastodon/components/button.tsx @@ -0,0 +1,58 @@ +import { useCallback } from 'react'; + +import classNames from 'classnames'; + +interface BaseProps extends React.ButtonHTMLAttributes { + block?: boolean; + secondary?: boolean; + text?: JSX.Element; +} + +interface PropsWithChildren extends BaseProps { + text?: never; +} + +interface PropsWithText extends BaseProps { + text: JSX.Element; + children: never; +} + +type Props = PropsWithText | PropsWithChildren; + +export const Button: React.FC = ({ + text, + type = 'button', + onClick, + disabled, + block, + secondary, + className, + title, + children, + ...props +}) => { + const handleClick = useCallback>( + (e) => { + if (!disabled && onClick) { + onClick(e); + } + }, + [disabled, onClick], + ); + + return ( + + ); +}; diff --git a/app/javascript/mastodon/components/check.tsx b/app/javascript/mastodon/components/check.tsx deleted file mode 100644 index 901f89fc5b..0000000000 --- a/app/javascript/mastodon/components/check.tsx +++ /dev/null @@ -1,13 +0,0 @@ -export const Check: React.FC = () => ( - - - -); diff --git a/app/javascript/mastodon/components/column_back_button.jsx b/app/javascript/mastodon/components/column_back_button.jsx index 74a03b093a..3e914ecadd 100644 --- a/app/javascript/mastodon/components/column_back_button.jsx +++ b/app/javascript/mastodon/components/column_back_button.jsx @@ -4,29 +4,30 @@ import { createPortal } from 'react-dom'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + +import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; + import { Icon } from 'mastodon/components/icon'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; -export default class ColumnBackButton extends PureComponent { - - static contextTypes = { - router: PropTypes.object, - }; +export class ColumnBackButton extends PureComponent { static propTypes = { multiColumn: PropTypes.bool, onClick: PropTypes.func, + ...WithRouterPropTypes, }; handleClick = () => { - const { router } = this.context; - const { onClick } = this.props; + const { onClick, history } = this.props; if (onClick) { onClick(); - } else if (router.history.location?.state?.fromMastodon) { - router.history.goBack(); + } else if (history.location?.state?.fromMastodon) { + history.goBack(); } else { - router.history.push('/'); + history.push('/'); } }; @@ -35,7 +36,7 @@ export default class ColumnBackButton extends PureComponent { const component = ( ); @@ -60,3 +61,5 @@ export default class ColumnBackButton extends PureComponent { } } + +export default withRouter(ColumnBackButton); diff --git a/app/javascript/mastodon/components/column_back_button_slim.jsx b/app/javascript/mastodon/components/column_back_button_slim.jsx index f8060e5a5b..397e6c6a77 100644 --- a/app/javascript/mastodon/components/column_back_button_slim.jsx +++ b/app/javascript/mastodon/components/column_back_button_slim.jsx @@ -1,20 +1,20 @@ import { FormattedMessage } from 'react-intl'; +import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; + import { Icon } from 'mastodon/components/icon'; -import ColumnBackButton from './column_back_button'; +import { ColumnBackButton } from './column_back_button'; export default class ColumnBackButtonSlim extends ColumnBackButton { - render () { return (
    - +
    ); } - } diff --git a/app/javascript/mastodon/components/column_header.jsx b/app/javascript/mastodon/components/column_header.jsx index 9d29bbae03..f60b17d9b8 100644 --- a/app/javascript/mastodon/components/column_header.jsx +++ b/app/javascript/mastodon/components/column_header.jsx @@ -5,8 +5,17 @@ import { createPortal } from 'react-dom'; import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; + +import { ReactComponent as AddIcon } from '@material-symbols/svg-600/outlined/add.svg'; +import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; +import { ReactComponent as ChevronLeftIcon } from '@material-symbols/svg-600/outlined/chevron_left.svg'; +import { ReactComponent as ChevronRightIcon } from '@material-symbols/svg-600/outlined/chevron_right.svg'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; +import { ReactComponent as TuneIcon } from '@material-symbols/svg-600/outlined/tune.svg'; import { Icon } from 'mastodon/components/icon'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const messages = defineMessages({ show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' }, @@ -18,7 +27,6 @@ const messages = defineMessages({ class ColumnHeader extends PureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -26,6 +34,7 @@ class ColumnHeader extends PureComponent { intl: PropTypes.object.isRequired, title: PropTypes.node, icon: PropTypes.string, + iconComponent: PropTypes.func, active: PropTypes.bool, multiColumn: PropTypes.bool, extraButton: PropTypes.node, @@ -38,6 +47,7 @@ class ColumnHeader extends PureComponent { onClick: PropTypes.func, appendContent: PropTypes.node, collapseIssues: PropTypes.bool, + ...WithRouterPropTypes, }; state = { @@ -63,12 +73,12 @@ class ColumnHeader extends PureComponent { }; handleBackClick = () => { - const { router } = this.context; + const { history } = this.props; - if (router.history.location?.state?.fromMastodon) { - router.history.goBack(); + if (history.location?.state?.fromMastodon) { + history.goBack(); } else { - router.history.push('/'); + history.push('/'); } }; @@ -78,15 +88,14 @@ class ColumnHeader extends PureComponent { handlePin = () => { if (!this.props.pinned) { - this.context.router.history.replace('/'); + this.props.history.replace('/'); } this.props.onPin(); }; render () { - const { router } = this.context; - const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props; + const { title, icon, iconComponent, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues, history } = this.props; const { collapsed, animating } = this.state; const wrapperClassName = classNames('column-header__wrapper', { @@ -117,22 +126,22 @@ class ColumnHeader extends PureComponent { } if (multiColumn && pinned) { - pinButton = ; + pinButton = ; moveButtons = (
    - - + +
    ); } else if (multiColumn && this.props.onPin) { - pinButton = ; + pinButton = ; } - if (!pinned && ((multiColumn && router.history.location?.state?.fromMastodon) || showBackButton)) { + if (!pinned && ((multiColumn && history.location?.state?.fromMastodon) || showBackButton)) { backButton = ( ); @@ -156,21 +165,21 @@ class ColumnHeader extends PureComponent { onClick={this.handleToggleClick} > - + {collapseIssues && } ); } - const hasTitle = icon && title; + const hasTitle = (icon || iconComponent) && title; const component = (

    {hasTitle && ( )} @@ -215,4 +224,4 @@ class ColumnHeader extends PureComponent { } -export default injectIntl(ColumnHeader); +export default injectIntl(withRouter(ColumnHeader)); diff --git a/app/javascript/mastodon/components/dismissable_banner.tsx b/app/javascript/mastodon/components/dismissable_banner.tsx index 04a28e3cbe..4feb74a3a1 100644 --- a/app/javascript/mastodon/components/dismissable_banner.tsx +++ b/app/javascript/mastodon/components/dismissable_banner.tsx @@ -3,6 +3,8 @@ import { useCallback, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; + import { bannerSettings } from 'mastodon/settings'; import { IconButton } from './icon_button'; @@ -36,6 +38,7 @@ export const DismissableBanner: React.FC> = ({
    diff --git a/app/javascript/mastodon/components/domain.tsx b/app/javascript/mastodon/components/domain.tsx index f4a3b9d4b6..34c376f530 100644 --- a/app/javascript/mastodon/components/domain.tsx +++ b/app/javascript/mastodon/components/domain.tsx @@ -2,6 +2,8 @@ import { useCallback } from 'react'; import { defineMessages, useIntl } from 'react-intl'; +import { ReactComponent as LockOpenIcon } from '@material-symbols/svg-600/outlined/lock_open.svg'; + import { IconButton } from './icon_button'; const messages = defineMessages({ @@ -34,6 +36,7 @@ export const Domain: React.FC = ({ domain, onUnblockDomain }) => { diff --git a/app/javascript/mastodon/components/dropdown_menu.jsx b/app/javascript/mastodon/components/dropdown_menu.jsx index fd66310e85..de540b392b 100644 --- a/app/javascript/mastodon/components/dropdown_menu.jsx +++ b/app/javascript/mastodon/components/dropdown_menu.jsx @@ -2,13 +2,17 @@ import PropTypes from 'prop-types'; import { PureComponent, cloneElement, Children } from 'react'; import classNames from 'classnames'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; import { supportsPassiveEvents } from 'detect-passive-events'; import Overlay from 'react-overlays/Overlay'; -import { CircularProgress } from "./circular_progress"; +import { CircularProgress } from 'mastodon/components/circular_progress'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; + import { IconButton } from './icon_button'; const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true; @@ -16,10 +20,6 @@ let id = 0; class DropdownMenu extends PureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { items: PropTypes.oneOfType([PropTypes.array, ImmutablePropTypes.list]).isRequired, loading: PropTypes.bool, @@ -159,15 +159,12 @@ class DropdownMenu extends PureComponent { } -export default class Dropdown extends PureComponent { - - static contextTypes = { - router: PropTypes.object, - }; +class Dropdown extends PureComponent { static propTypes = { children: PropTypes.node, icon: PropTypes.string, + iconComponent: PropTypes.func, items: PropTypes.oneOfType([PropTypes.array, ImmutablePropTypes.list]).isRequired, loading: PropTypes.bool, size: PropTypes.number, @@ -183,6 +180,7 @@ export default class Dropdown extends PureComponent { renderItem: PropTypes.func, renderHeader: PropTypes.func, onItemClick: PropTypes.func, + ...WithRouterPropTypes }; static defaultProps = { @@ -250,7 +248,7 @@ export default class Dropdown extends PureComponent { item.action(); } else if (item && item.to) { e.preventDefault(); - this.context.router.history.push(item.to); + this.props.history.push(item.to); } }; @@ -259,7 +257,7 @@ export default class Dropdown extends PureComponent { }; findTarget = () => { - return this.target; + return this.target?.buttonRef?.current; }; componentWillUnmount = () => { @@ -275,6 +273,7 @@ export default class Dropdown extends PureComponent { render () { const { icon, + iconComponent, items, size, title, @@ -295,9 +294,11 @@ export default class Dropdown extends PureComponent { onMouseDown: this.handleMouseDown, onKeyDown: this.handleButtonKeyDown, onKeyPress: this.handleKeyPress, + ref: this.setTargetRef, }) : ( ); return ( <> - - {button} - + {button} + {({ props, arrowProps, placement }) => (
    @@ -338,3 +339,5 @@ export default class Dropdown extends PureComponent { } } + +export default withRouter(Dropdown); diff --git a/app/javascript/mastodon/components/edited_timestamp/index.jsx b/app/javascript/mastodon/components/edited_timestamp/index.jsx index 987b7c8272..4375166bcd 100644 --- a/app/javascript/mastodon/components/edited_timestamp/index.jsx +++ b/app/javascript/mastodon/components/edited_timestamp/index.jsx @@ -5,6 +5,8 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; +import { ReactComponent as ArrowDropDownIcon } from '@material-symbols/svg-600/outlined/arrow_drop_down.svg'; + import { openModal } from 'mastodon/actions/modal'; import { Icon } from 'mastodon/components/icon'; import InlineAccount from 'mastodon/components/inline_account'; @@ -66,7 +68,7 @@ class EditedTimestamp extends PureComponent { return ( ); diff --git a/app/javascript/mastodon/components/icon.tsx b/app/javascript/mastodon/components/icon.tsx index 3d091c7059..dbf5839606 100644 --- a/app/javascript/mastodon/components/icon.tsx +++ b/app/javascript/mastodon/components/icon.tsx @@ -1,20 +1,52 @@ import classNames from 'classnames'; -interface Props extends React.HTMLAttributes { - id: string; - className?: string; - fixedWidth?: boolean; +import { ReactComponent as CheckBoxOutlineBlankIcon } from '@material-symbols/svg-600/outlined/check_box_outline_blank.svg'; + +interface SVGPropsWithTitle extends React.SVGProps { + title?: string; +} + +export type IconProp = React.FC; + +interface Props extends React.SVGProps { children?: never; + id: string; + icon: IconProp; + title?: string; } export const Icon: React.FC = ({ id, + icon: IconComponent, className, - fixedWidth, + title: titleProp, ...other -}) => ( - -); +}) => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!IconComponent) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + ` is missing an "icon" prop.`, + ); + } + + IconComponent = CheckBoxOutlineBlankIcon; + } + + const ariaHidden = titleProp ? undefined : true; + const role = !ariaHidden ? 'img' : undefined; + + // Set the title to an empty string to remove the built-in SVG one if any + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + const title = titleProp || ''; + + return ( + + ); +}; diff --git a/app/javascript/mastodon/components/icon_button.tsx b/app/javascript/mastodon/components/icon_button.tsx index da6f19e9ea..e38e387712 100644 --- a/app/javascript/mastodon/components/icon_button.tsx +++ b/app/javascript/mastodon/components/icon_button.tsx @@ -1,19 +1,20 @@ -import { PureComponent } from 'react'; +import { PureComponent, createRef } from 'react'; import classNames from 'classnames'; import { AnimatedNumber } from './animated_number'; +import type { IconProp } from './icon'; import { Icon } from './icon'; interface Props { className?: string; title: string; icon: string; + iconComponent: IconProp; onClick?: React.MouseEventHandler; onMouseDown?: React.MouseEventHandler; onKeyDown?: React.KeyboardEventHandler; onKeyPress?: React.KeyboardEventHandler; - size: number; active: boolean; expanded?: boolean; style?: React.CSSProperties; @@ -32,8 +33,9 @@ interface States { deactivate: boolean; } export class IconButton extends PureComponent { + buttonRef = createRef(); + static defaultProps = { - size: 18, active: false, disabled: false, animate: false, @@ -85,10 +87,6 @@ export class IconButton extends PureComponent { render() { const style = { - fontSize: `${this.props.size}px`, - width: `${this.props.size * 1.28571429}px`, - height: `${this.props.size * 1.28571429}px`, - lineHeight: `${this.props.size}px`, ...this.props.style, ...(this.props.active ? this.props.activeStyle : {}), }; @@ -99,6 +97,7 @@ export class IconButton extends PureComponent { disabled, expanded, icon, + iconComponent, inverted, overlay, tabIndex, @@ -120,13 +119,9 @@ export class IconButton extends PureComponent { 'icon-button--with-counter': typeof counter !== 'undefined', }); - if (typeof counter !== 'undefined') { - style.width = 'auto'; - } - let contents = ( <> -
    @@ -448,7 +454,7 @@ class Header extends ImmutablePureComponent {
    - {pair.get('verified_at') && } + {pair.get('verified_at') && }
    ))} @@ -492,4 +498,4 @@ class Header extends ImmutablePureComponent { } -export default injectIntl(Header); +export default withRouter(injectIntl(Header)); diff --git a/app/javascript/mastodon/features/account_gallery/components/media_item.jsx b/app/javascript/mastodon/features/account_gallery/components/media_item.jsx index 63fbac6799..657b17d43d 100644 --- a/app/javascript/mastodon/features/account_gallery/components/media_item.jsx +++ b/app/javascript/mastodon/features/account_gallery/components/media_item.jsx @@ -5,6 +5,10 @@ import classNames from 'classnames'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as AudiotrackIcon } from '@material-symbols/svg-600/outlined/music_note.svg'; +import { ReactComponent as PlayArrowIcon } from '@material-symbols/svg-600/outlined/play_arrow.svg'; +import { ReactComponent as VisibilityOffIcon } from '@material-symbols/svg-600/outlined/visibility_off.svg'; + import { Blurhash } from 'mastodon/components/blurhash'; import { Icon } from 'mastodon/components/icon'; import { autoPlayGif, displayMedia, useBlurhash } from 'mastodon/initial_state'; @@ -69,7 +73,7 @@ export default class MediaItem extends ImmutablePureComponent { if (!visible) { icon = ( - + ); } else { @@ -84,9 +88,9 @@ export default class MediaItem extends ImmutablePureComponent { ); if (attachment.get('type') === 'audio') { - label = ; + label = ; } else { - label = ; + label = ; } } else if (attachment.get('type') === 'image') { const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0; diff --git a/app/javascript/mastodon/features/account_timeline/components/header.jsx b/app/javascript/mastodon/features/account_timeline/components/header.jsx index be21de5910..aede7e4957 100644 --- a/app/javascript/mastodon/features/account_timeline/components/header.jsx +++ b/app/javascript/mastodon/features/account_timeline/components/header.jsx @@ -2,17 +2,19 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -import { NavLink } from 'react-router-dom'; +import { NavLink, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; + import InnerHeader from '../../account/components/header'; import MemorialNote from './memorial_note'; import MovedNote from './moved_note'; -export default class Header extends ImmutablePureComponent { +class Header extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, @@ -34,10 +36,7 @@ export default class Header extends ImmutablePureComponent { hideTabs: PropTypes.bool, domain: PropTypes.string.isRequired, hidden: PropTypes.bool, - }; - - static contextTypes = { - router: PropTypes.object, + ...WithRouterPropTypes, }; handleFollow = () => { @@ -49,11 +48,11 @@ export default class Header extends ImmutablePureComponent { }; handleMention = () => { - this.props.onMention(this.props.account, this.context.router.history); + this.props.onMention(this.props.account, this.props.history); }; handleDirect = () => { - this.props.onDirect(this.props.account, this.context.router.history); + this.props.onDirect(this.props.account, this.props.history); }; handleReport = () => { @@ -159,3 +158,5 @@ export default class Header extends ImmutablePureComponent { } } + +export default withRouter(Header); diff --git a/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx b/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx index 4872455e97..59b7358233 100644 --- a/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx +++ b/app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { revealAccount } from 'mastodon/actions/accounts'; -import Button from 'mastodon/components/button'; +import { Button } from 'mastodon/components/button'; import { domain } from 'mastodon/initial_state'; const mapDispatchToProps = (dispatch, { accountId }) => ({ diff --git a/app/javascript/mastodon/features/audio/index.jsx b/app/javascript/mastodon/features/audio/index.jsx index 103ef57827..60d599b97a 100644 --- a/app/javascript/mastodon/features/audio/index.jsx +++ b/app/javascript/mastodon/features/audio/index.jsx @@ -7,6 +7,12 @@ import classNames from 'classnames'; import { is } from 'immutable'; +import { ReactComponent as DownloadIcon } from '@material-symbols/svg-600/outlined/download.svg'; +import { ReactComponent as PauseIcon } from '@material-symbols/svg-600/outlined/pause.svg'; +import { ReactComponent as PlayArrowIcon } from '@material-symbols/svg-600/outlined/play_arrow.svg'; +import { ReactComponent as VisibilityOffIcon } from '@material-symbols/svg-600/outlined/visibility_off.svg'; +import { ReactComponent as VolumeOffIcon } from '@material-symbols/svg-600/outlined/volume_off.svg'; +import { ReactComponent as VolumeUpIcon } from '@material-symbols/svg-600/outlined/volume_up.svg'; import { throttle, debounce } from 'lodash'; import { Icon } from 'mastodon/components/icon'; @@ -554,8 +560,8 @@ class Audio extends PureComponent {
    - - + +
    @@ -575,9 +581,9 @@ class Audio extends PureComponent {
    - {!editable && } + {!editable && } - +
    diff --git a/app/javascript/mastodon/features/blocks/index.jsx b/app/javascript/mastodon/features/blocks/index.jsx index d976174ce0..210260c811 100644 --- a/app/javascript/mastodon/features/blocks/index.jsx +++ b/app/javascript/mastodon/features/blocks/index.jsx @@ -6,6 +6,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as BlockIcon } from '@material-symbols/svg-600/outlined/block-fill.svg'; import { debounce } from 'lodash'; import { fetchBlocks, expandBlocks } from '../../actions/blocks'; @@ -59,7 +60,7 @@ class Blocks extends ImmutablePureComponent { const emptyMessage = ; return ( - + { class CommunityTimeline extends PureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -129,6 +130,7 @@ class CommunityTimeline extends PureComponent {
    - +
    ); diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index 59e6d02c26..5bd990a302 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -7,13 +7,15 @@ import classNames from 'classnames'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as LockIcon } from '@material-symbols/svg-600/outlined/lock.svg'; import { length } from 'stringz'; import { Icon } from 'mastodon/components/icon'; +import { WithOptionalRouterPropTypes, withOptionalRouter } from 'mastodon/utils/react_router'; import AutosuggestInput from '../../../components/autosuggest_input'; import AutosuggestTextarea from '../../../components/autosuggest_textarea'; -import Button from '../../../components/button'; +import { Button } from '../../../components/button'; import { maxChars } from '../../../initial_state'; import EmojiPickerDropdown from '../containers/emoji_picker_dropdown_container'; import LanguageDropdown from '../containers/language_dropdown_container'; @@ -40,11 +42,6 @@ const messages = defineMessages({ }); class ComposeForm extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { intl: PropTypes.object.isRequired, text: PropTypes.string.isRequired, @@ -72,6 +69,7 @@ class ComposeForm extends ImmutablePureComponent { isInReply: PropTypes.bool, singleColumn: PropTypes.bool, lang: PropTypes.string, + ...WithOptionalRouterPropTypes }; static defaultProps = { @@ -115,7 +113,7 @@ class ComposeForm extends ImmutablePureComponent { return; } - this.props.onSubmit(this.context.router ? this.context.router.history : null); + this.props.onSubmit(this.props.history || null); if (e) { e.preventDefault(); @@ -233,7 +231,7 @@ class ComposeForm extends ImmutablePureComponent { if (this.props.isEditing) { publishText = intl.formatMessage(messages.saveChanges); } else if (this.props.privacy === 'private' || this.props.privacy === 'direct') { - publishText = {intl.formatMessage(messages.publish)}; + publishText = <> {intl.formatMessage(messages.publish)}; } else { publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish); } @@ -319,4 +317,4 @@ class ComposeForm extends ImmutablePureComponent { } -export default injectIntl(ComposeForm); +export default withOptionalRouter(injectIntl(ComposeForm)); diff --git a/app/javascript/mastodon/features/compose/components/poll_button.jsx b/app/javascript/mastodon/features/compose/components/poll_button.jsx index daf48ba410..f722815b51 100644 --- a/app/javascript/mastodon/features/compose/components/poll_button.jsx +++ b/app/javascript/mastodon/features/compose/components/poll_button.jsx @@ -3,8 +3,11 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; +import { ReactComponent as InsertChartIcon } from '@material-symbols/svg-600/outlined/insert_chart.svg'; + import { IconButton } from '../../../components/icon_button'; + const messages = defineMessages({ add_poll: { id: 'poll_button.add_poll', defaultMessage: 'Add a poll' }, remove_poll: { id: 'poll_button.remove_poll', defaultMessage: 'Remove poll' }, @@ -40,6 +43,7 @@ class PollButton extends PureComponent {
    - +

  • ); @@ -164,7 +167,7 @@ class PollForm extends ImmutablePureComponent {
    - + {/* eslint-disable-next-line jsx-a11y/no-onchange */}
    - +
    diff --git a/app/javascript/mastodon/features/compose/index.jsx b/app/javascript/mastodon/features/compose/index.jsx index 8997f1bc6c..65650ffe02 100644 --- a/app/javascript/mastodon/features/compose/index.jsx +++ b/app/javascript/mastodon/features/compose/index.jsx @@ -9,6 +9,13 @@ import { Link } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { ReactComponent as PeopleIcon } from '@material-symbols/svg-600/outlined/group.svg'; +import { ReactComponent as HomeIcon } from '@material-symbols/svg-600/outlined/home-fill.svg'; +import { ReactComponent as LogoutIcon } from '@material-symbols/svg-600/outlined/logout.svg'; +import { ReactComponent as MenuIcon } from '@material-symbols/svg-600/outlined/menu.svg'; +import { ReactComponent as NotificationsIcon } from '@material-symbols/svg-600/outlined/notifications-fill.svg'; +import { ReactComponent as PublicIcon } from '@material-symbols/svg-600/outlined/public.svg'; +import { ReactComponent as SettingsIcon } from '@material-symbols/svg-600/outlined/settings-fill.svg'; import spring from 'react-motion/lib/spring'; import { openModal } from 'mastodon/actions/modal'; @@ -101,21 +108,21 @@ class Compose extends PureComponent { return (
    {multiColumn && } diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx b/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx index bf0a9da95a..005edc5c2b 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx +++ b/app/javascript/mastodon/features/direct_timeline/components/conversation.jsx @@ -3,11 +3,13 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; -import { Link } from 'react-router-dom'; +import { Link, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg'; +import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg'; import { HotKeys } from 'react-hotkeys'; import AttachmentList from 'mastodon/components/attachment_list'; @@ -17,6 +19,7 @@ import { RelativeTimestamp } from 'mastodon/components/relative_timestamp'; import StatusContent from 'mastodon/components/status_content'; import DropdownMenuContainer from 'mastodon/containers/dropdown_menu_container'; import { autoPlayGif } from 'mastodon/initial_state'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const messages = defineMessages({ more: { id: 'status.more', defaultMessage: 'More' }, @@ -30,10 +33,6 @@ const messages = defineMessages({ class Conversation extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { conversationId: PropTypes.string.isRequired, accounts: ImmutablePropTypes.list.isRequired, @@ -45,6 +44,7 @@ class Conversation extends ImmutablePureComponent { markRead: PropTypes.func.isRequired, delete: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; handleMouseEnter = ({ currentTarget }) => { @@ -74,7 +74,7 @@ class Conversation extends ImmutablePureComponent { }; handleClick = () => { - if (!this.context.router) { + if (!this.props.history) { return; } @@ -84,7 +84,7 @@ class Conversation extends ImmutablePureComponent { markRead(); } - this.context.router.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`); + this.props.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`); }; handleMarkAsRead = () => { @@ -92,7 +92,7 @@ class Conversation extends ImmutablePureComponent { }; handleReply = () => { - this.props.reply(this.props.lastStatus, this.context.router.history); + this.props.reply(this.props.lastStatus, this.props.history); }; handleDelete = () => { @@ -180,7 +180,7 @@ class Conversation extends ImmutablePureComponent { )}
    - +
    ({ class Directory extends PureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { isLoading: PropTypes.bool, accountIds: ImmutablePropTypes.list.isRequired, @@ -160,6 +158,7 @@ class Directory extends PureComponent { ; return ( - + ; -export type EmojisWithoutShortCodes = FilenameData[]; +type EmojisWithoutShortCodes = FilenameData; -export type EmojiCompressed = [ +type EmojiCompressed = [ ShortCodesToEmojiData, Skins, Category[], diff --git a/app/javascript/mastodon/features/emoji/emoji_mart_data_light.ts b/app/javascript/mastodon/features/emoji/emoji_mart_data_light.ts index 142605b4bc..ffca1f8b06 100644 --- a/app/javascript/mastodon/features/emoji/emoji_mart_data_light.ts +++ b/app/javascript/mastodon/features/emoji/emoji_mart_data_light.ts @@ -30,22 +30,13 @@ const emojis: Emojis = {}; // decompress Object.keys(shortCodesToEmojiData).forEach((shortCode) => { const [_filenameData, searchData] = shortCodesToEmojiData[shortCode]; - const native = searchData[0]; - let short_names = searchData[1]; - const search = searchData[2]; - let unified = searchData[3]; + const [native, short_names, search, unified] = searchData; - if (!unified) { - // unified name can be derived from unicodeToUnifiedName - unified = unicodeToUnifiedName(native); - } - - if (short_names) short_names = [shortCode].concat(short_names); emojis[shortCode] = { native, search, - short_names, - unified, + short_names: short_names ? [shortCode].concat(short_names) : undefined, + unified: unified ?? unicodeToUnifiedName(native), }; }); diff --git a/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.js b/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.js deleted file mode 100644 index 3e3834580d..0000000000 --- a/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.js +++ /dev/null @@ -1,37 +0,0 @@ -// A mapping of unicode strings to an object containing the filename -// (i.e. the svg filename) and a shortCode intended to be shown -// as a "title" attribute in an HTML element (aka tooltip). - -import emojiCompressed from './emoji_compressed'; -import { unicodeToFilename } from './unicode_to_filename'; - -const [ - shortCodesToEmojiData, - _skins, - _categories, - _short_names, - emojisWithoutShortCodes, -] = emojiCompressed; - -// decompress -const unicodeMapping = {}; - -function processEmojiMapData(emojiMapData, shortCode) { - let [ native, filename ] = emojiMapData; - if (!filename) { - // filename name can be derived from unicodeToFilename - filename = unicodeToFilename(native); - } - unicodeMapping[native] = { - shortCode: shortCode, - filename: filename, - }; -} - -Object.keys(shortCodesToEmojiData).forEach((shortCode) => { - let [ filenameData ] = shortCodesToEmojiData[shortCode]; - filenameData.forEach(emojiMapData => processEmojiMapData(emojiMapData, shortCode)); -}); -emojisWithoutShortCodes.forEach(emojiMapData => processEmojiMapData(emojiMapData)); - -export default unicodeMapping; diff --git a/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.ts b/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.ts new file mode 100644 index 0000000000..191419496f --- /dev/null +++ b/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.ts @@ -0,0 +1,60 @@ +// A mapping of unicode strings to an object containing the filename +// (i.e. the svg filename) and a shortCode intended to be shown +// as a "title" attribute in an HTML element (aka tooltip). + +import type { + FilenameData, + ShortCodesToEmojiDataKey, +} from './emoji_compressed'; +import emojiCompressed from './emoji_compressed'; +import { unicodeToFilename } from './unicode_to_filename'; + +type UnicodeMapping = { + [key in FilenameData[number][0]]: { + shortCode: ShortCodesToEmojiDataKey; + filename: FilenameData[number][number]; + }; +}; + +const [ + shortCodesToEmojiData, + _skins, + _categories, + _short_names, + emojisWithoutShortCodes, +] = emojiCompressed; + +// decompress +const unicodeMapping: UnicodeMapping = {}; + +function processEmojiMapData( + emojiMapData: FilenameData[number], + shortCode?: ShortCodesToEmojiDataKey, +) { + const [native, _filename] = emojiMapData; + let filename = emojiMapData[1]; + if (!filename) { + // filename name can be derived from unicodeToFilename + filename = unicodeToFilename(native); + } + unicodeMapping[native] = { + shortCode, + filename, + }; +} + +Object.keys(shortCodesToEmojiData).forEach( + (shortCode: ShortCodesToEmojiDataKey) => { + if (shortCode === undefined) return; + const [filenameData, _searchData] = shortCodesToEmojiData[shortCode]; + filenameData.forEach((emojiMapData) => { + processEmojiMapData(emojiMapData, shortCode); + }); + }, +); + +emojisWithoutShortCodes.forEach((emojiMapData) => { + processEmojiMapData(emojiMapData); +}); + +export { unicodeMapping }; diff --git a/app/javascript/mastodon/features/explore/index.jsx b/app/javascript/mastodon/features/explore/index.jsx index fefdc23fab..80825e4563 100644 --- a/app/javascript/mastodon/features/explore/index.jsx +++ b/app/javascript/mastodon/features/explore/index.jsx @@ -8,6 +8,9 @@ import { NavLink, Switch, Route } from 'react-router-dom'; import { connect } from 'react-redux'; +import { ReactComponent as SearchIcon } from '@material-symbols/svg-600/outlined/search.svg'; +import { ReactComponent as TagIcon } from '@material-symbols/svg-600/outlined/tag.svg'; + import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; import Search from 'mastodon/features/compose/containers/search_container'; @@ -32,7 +35,6 @@ const mapStateToProps = state => ({ class Explore extends PureComponent { static contextTypes = { - router: PropTypes.object, identity: PropTypes.object, }; @@ -58,6 +60,7 @@ class Explore extends PureComponent { 0) { + return; + } + dispatch(fetchTrendingLinks()); } @@ -77,4 +87,4 @@ class Links extends PureComponent { } -export default connect(mapStateToProps)(Links); +export default connect(mapStateToProps)(withRouter(Links)); diff --git a/app/javascript/mastodon/features/explore/results.jsx b/app/javascript/mastodon/features/explore/results.jsx index a3c6adee9d..8c172c134a 100644 --- a/app/javascript/mastodon/features/explore/results.jsx +++ b/app/javascript/mastodon/features/explore/results.jsx @@ -9,6 +9,10 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { ReactComponent as FindInPageIcon } from '@material-symbols/svg-600/outlined/find_in_page.svg'; +import { ReactComponent as PeopleIcon } from '@material-symbols/svg-600/outlined/group.svg'; +import { ReactComponent as TagIcon } from '@material-symbols/svg-600/outlined/tag.svg'; + import { submitSearch, expandSearch } from 'mastodon/actions/search'; import { ImmutableHashtag as Hashtag } from 'mastodon/components/hashtag'; import { Icon } from 'mastodon/components/icon'; @@ -165,19 +169,19 @@ class Results extends PureComponent { filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? ( <> {accounts.size > 0 && ( - } onClickMore={this.handleLoadMoreAccounts}> + } onClickMore={this.handleLoadMoreAccounts}> {accounts.take(INITIAL_DISPLAY).map(id => )} )} {hashtags.size > 0 && ( - } onClickMore={this.handleLoadMoreHashtags}> + } onClickMore={this.handleLoadMoreHashtags}> {hashtags.take(INITIAL_DISPLAY).map(hashtag => )} )} {statuses.size > 0 && ( - } onClickMore={this.handleLoadMoreStatuses}> + } onClickMore={this.handleLoadMoreStatuses}> {statuses.take(INITIAL_DISPLAY).map(id => )} )} diff --git a/app/javascript/mastodon/features/explore/statuses.jsx b/app/javascript/mastodon/features/explore/statuses.jsx index f32a4a5368..414b47fcdd 100644 --- a/app/javascript/mastodon/features/explore/statuses.jsx +++ b/app/javascript/mastodon/features/explore/statuses.jsx @@ -3,15 +3,19 @@ import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { debounce } from 'lodash'; + import { fetchTrendingStatuses, expandTrendingStatuses } from 'mastodon/actions/trends'; import { DismissableBanner } from 'mastodon/components/dismissable_banner'; import StatusList from 'mastodon/components/status_list'; import { getStatusList } from 'mastodon/selectors'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const mapStateToProps = state => ({ statusIds: getStatusList(state, 'trending'), @@ -27,10 +31,17 @@ class Statuses extends PureComponent { hasMore: PropTypes.bool, multiColumn: PropTypes.bool, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, statusIds, history } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && statusIds.size > 0) { + return; + } + dispatch(fetchTrendingStatuses()); } @@ -45,27 +56,23 @@ class Statuses extends PureComponent { const emptyMessage = ; return ( - <> - - - - - - + } + alwaysPrepend + timelineId='explore' + statusIds={statusIds} + scrollKey='explore-statuses' + hasMore={hasMore} + isLoading={isLoading} + onLoadMore={this.handleLoadMore} + emptyMessage={emptyMessage} + bindToDocument={!multiColumn} + withCounters + /> ); } } -export default connect(mapStateToProps)(Statuses); +export default connect(mapStateToProps)(withRouter(Statuses)); diff --git a/app/javascript/mastodon/features/explore/suggestions.jsx b/app/javascript/mastodon/features/explore/suggestions.jsx index c60aa7e11c..ba33c4d081 100644 --- a/app/javascript/mastodon/features/explore/suggestions.jsx +++ b/app/javascript/mastodon/features/explore/suggestions.jsx @@ -3,12 +3,15 @@ import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { fetchSuggestions } from 'mastodon/actions/suggestions'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import AccountCard from 'mastodon/features/directory/components/account_card'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const mapStateToProps = state => ({ suggestions: state.getIn(['suggestions', 'items']), @@ -21,10 +24,17 @@ class Suggestions extends PureComponent { isLoading: PropTypes.bool, suggestions: ImmutablePropTypes.list, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, suggestions, history } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && suggestions.size > 0) { + return; + } + dispatch(fetchSuggestions(true)); } @@ -52,4 +62,4 @@ class Suggestions extends PureComponent { } -export default connect(mapStateToProps)(Suggestions); +export default connect(mapStateToProps)(withRouter(Suggestions)); diff --git a/app/javascript/mastodon/features/explore/tags.jsx b/app/javascript/mastodon/features/explore/tags.jsx index 11e0147214..90cf3c32a7 100644 --- a/app/javascript/mastodon/features/explore/tags.jsx +++ b/app/javascript/mastodon/features/explore/tags.jsx @@ -3,6 +3,8 @@ import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; +import { withRouter } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; @@ -10,6 +12,7 @@ import { fetchTrendingHashtags } from 'mastodon/actions/trends'; import { DismissableBanner } from 'mastodon/components/dismissable_banner'; import { ImmutableHashtag as Hashtag } from 'mastodon/components/hashtag'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const mapStateToProps = state => ({ hashtags: state.getIn(['trends', 'tags', 'items']), @@ -22,10 +25,17 @@ class Tags extends PureComponent { hashtags: ImmutablePropTypes.list, isLoading: PropTypes.bool, dispatch: PropTypes.func.isRequired, + ...WithRouterPropTypes, }; componentDidMount () { - const { dispatch } = this.props; + const { dispatch, history, hashtags } = this.props; + + // If we're navigating back to the screen, do not trigger a reload + if (history.action === 'POP' && hashtags.size > 0) { + return; + } + dispatch(fetchTrendingHashtags()); } @@ -63,4 +73,4 @@ class Tags extends PureComponent { } -export default connect(mapStateToProps)(Tags); +export default connect(mapStateToProps)(withRouter(Tags)); diff --git a/app/javascript/mastodon/features/favourited_statuses/index.jsx b/app/javascript/mastodon/features/favourited_statuses/index.jsx index 76cff7f8df..d3c3cc9f09 100644 --- a/app/javascript/mastodon/features/favourited_statuses/index.jsx +++ b/app/javascript/mastodon/features/favourited_statuses/index.jsx @@ -8,6 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; import { debounce } from 'lodash'; import { addColumn, removeColumn, moveColumn } from 'mastodon/actions/columns'; @@ -80,6 +81,7 @@ class Favourites extends ImmutablePureComponent { + )} /> diff --git a/app/javascript/mastodon/features/filters/added_to_filter.jsx b/app/javascript/mastodon/features/filters/added_to_filter.jsx index ec848f622e..e341eddbad 100644 --- a/app/javascript/mastodon/features/filters/added_to_filter.jsx +++ b/app/javascript/mastodon/features/filters/added_to_filter.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import Button from 'mastodon/components/button'; +import { Button } from 'mastodon/components/button'; import { toServerSideType } from 'mastodon/utils/filters'; const mapStateToProps = (state, { filterId }) => ({ diff --git a/app/javascript/mastodon/features/filters/select_filter.jsx b/app/javascript/mastodon/features/filters/select_filter.jsx index 79ada6f586..9e8f87e005 100644 --- a/app/javascript/mastodon/features/filters/select_filter.jsx +++ b/app/javascript/mastodon/features/filters/select_filter.jsx @@ -5,6 +5,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; +import { ReactComponent as AddIcon } from '@material-symbols/svg-600/outlined/add.svg'; import fuzzysort from 'fuzzysort'; import { Icon } from 'mastodon/components/icon'; @@ -78,7 +79,7 @@ class SelectFilter extends PureComponent { renderCreateNew (name) { return (
    - +
    ); } diff --git a/app/javascript/mastodon/features/firehose/index.jsx b/app/javascript/mastodon/features/firehose/index.jsx index 849ee38f5f..0ed8aa11aa 100644 --- a/app/javascript/mastodon/features/firehose/index.jsx +++ b/app/javascript/mastodon/features/firehose/index.jsx @@ -6,6 +6,8 @@ import { useIntl, defineMessages, FormattedMessage } from 'react-intl'; import { Helmet } from 'react-helmet'; import { NavLink } from 'react-router-dom'; +import { ReactComponent as PublicIcon } from '@material-symbols/svg-600/outlined/public.svg'; + import { addColumn } from 'mastodon/actions/columns'; import { changeSetting } from 'mastodon/actions/settings'; import { connectPublicStream, connectCommunityStream } from 'mastodon/actions/streaming'; @@ -160,6 +162,7 @@ const Firehose = ({ feedType, multiColumn }) => {
    -
    -
    +
    +
    ); diff --git a/app/javascript/mastodon/features/follow_requests/index.jsx b/app/javascript/mastodon/features/follow_requests/index.jsx index 796254e0ec..8e17607fd9 100644 --- a/app/javascript/mastodon/features/follow_requests/index.jsx +++ b/app/javascript/mastodon/features/follow_requests/index.jsx @@ -8,6 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add.svg'; import { debounce } from 'lodash'; import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts'; @@ -67,7 +68,7 @@ class FollowRequests extends ImmutablePureComponent { ); return ( - + { @@ -89,25 +90,25 @@ class Content extends ImmutablePureComponent { } onMentionClick = (mention, e) => { - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/@${mention.get('acct')}`); + this.props.history.push(`/@${mention.get('acct')}`); } }; onHashtagClick = (hashtag, e) => { hashtag = hashtag.replace(/^#/, ''); - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.props.history&& e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/tags/${hashtag}`); + this.props.history.push(`/tags/${hashtag}`); } }; onStatusClick = (status, e) => { - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); + this.props.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); } }; @@ -153,6 +154,8 @@ class Content extends ImmutablePureComponent { } +const Content = withRouter(ContentWithRouter); + class Emoji extends PureComponent { static propTypes = { @@ -294,7 +297,7 @@ class ReactionsBar extends ImmutablePureComponent { /> ))} - {visibleReactions.size < 8 && } />} + {visibleReactions.size < 8 && } />}
    )} @@ -440,9 +443,9 @@ class Announcements extends ImmutablePureComponent { {announcements.size > 1 && (
    - + {index + 1} / {announcements.size} - +
    )}
    diff --git a/app/javascript/mastodon/features/getting_started/index.jsx b/app/javascript/mastodon/features/getting_started/index.jsx index f0cd70d7a1..5994e88edf 100644 --- a/app/javascript/mastodon/features/getting_started/index.jsx +++ b/app/javascript/mastodon/features/getting_started/index.jsx @@ -9,6 +9,18 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg'; +import { ReactComponent as BookmarksIcon } from '@material-symbols/svg-600/outlined/bookmarks-fill.svg'; +import { ReactComponent as PeopleIcon } from '@material-symbols/svg-600/outlined/group.svg'; +import { ReactComponent as HomeIcon } from '@material-symbols/svg-600/outlined/home-fill.svg'; +import { ReactComponent as ListAltIcon } from '@material-symbols/svg-600/outlined/list_alt.svg'; +import { ReactComponent as MenuIcon } from '@material-symbols/svg-600/outlined/menu.svg'; +import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add.svg'; +import { ReactComponent as PublicIcon } from '@material-symbols/svg-600/outlined/public.svg'; +import { ReactComponent as SettingsIcon } from '@material-symbols/svg-600/outlined/settings-fill.svg'; +import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star.svg'; +import { ReactComponent as TagIcon } from '@material-symbols/svg-600/outlined/tag.svg'; + import { fetchFollowRequests } from 'mastodon/actions/accounts'; import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; @@ -66,7 +78,6 @@ const badgeDisplay = (number, limit) => { class GettingStarted extends ImmutablePureComponent { static contextTypes = { - router: PropTypes.object.isRequired, identity: PropTypes.object, }; @@ -102,38 +113,38 @@ class GettingStarted extends ImmutablePureComponent { if (showTrends) { navItems.push( - , + , ); } navItems.push( - , - , + , + , ); if (signedIn) { navItems.push( , - , - , - , - , - , + , + , + , + , + , ); if (myAccount.get('locked') || unreadFollowRequests > 0) { - navItems.push(); + navItems.push(); } navItems.push( , - , + , ); } return ( - {(signedIn && !multiColumn) ? : } + {(signedIn && !multiColumn) ? : }
    diff --git a/app/javascript/mastodon/features/hashtag_timeline/components/hashtag_header.jsx b/app/javascript/mastodon/features/hashtag_timeline/components/hashtag_header.jsx index 46050309ff..d2fe8851f6 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/components/hashtag_header.jsx +++ b/app/javascript/mastodon/features/hashtag_timeline/components/hashtag_header.jsx @@ -4,7 +4,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import Button from 'mastodon/components/button'; +import { Button } from 'mastodon/components/button'; import { ShortNumber } from 'mastodon/components/short_number'; const messages = defineMessages({ @@ -76,4 +76,4 @@ HashtagHeader.propTypes = { disabled: PropTypes.bool, onClick: PropTypes.func, intl: PropTypes.object, -}; \ No newline at end of file +}; diff --git a/app/javascript/mastodon/features/hashtag_timeline/index.jsx b/app/javascript/mastodon/features/hashtag_timeline/index.jsx index 7079f55e92..d39d550a1b 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/index.jsx +++ b/app/javascript/mastodon/features/hashtag_timeline/index.jsx @@ -8,6 +8,7 @@ import { Helmet } from 'react-helmet'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { ReactComponent as TagIcon } from '@material-symbols/svg-600/outlined/tag.svg'; import { isEqual } from 'lodash'; import { addColumn, removeColumn, moveColumn } from 'mastodon/actions/columns'; @@ -190,6 +191,7 @@ class HashtagTimeline extends PureComponent { - + ); } @@ -198,6 +201,7 @@ class HomeTimeline extends PureComponent { ; + icon = ; title = ; actionDescription = ; break; case 'reblog': - icon = ; + icon = ; title = ; actionDescription = ; break; case 'favourite': - icon = ; + icon = ; title = ; actionDescription = ; break; case 'follow': - icon = ; + icon = ; title = ; actionDescription = ; break; diff --git a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx index 3dc21f7e8e..7552e1799b 100644 --- a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx @@ -6,6 +6,8 @@ import { Helmet } from 'react-helmet'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as InfoIcon } from '@material-symbols/svg-600/outlined/info.svg'; + import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; @@ -27,7 +29,8 @@ class KeyboardShortcuts extends ImmutablePureComponent { diff --git a/app/javascript/mastodon/features/list_adder/components/list.jsx b/app/javascript/mastodon/features/list_adder/components/list.jsx index faade6f614..6c5aab85da 100644 --- a/app/javascript/mastodon/features/list_adder/components/list.jsx +++ b/app/javascript/mastodon/features/list_adder/components/list.jsx @@ -6,6 +6,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as AddIcon } from '@material-symbols/svg-600/outlined/add.svg'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; +import { ReactComponent as ListAltIcon } from '@material-symbols/svg-600/outlined/list_alt.svg'; + import { Icon } from 'mastodon/components/icon'; import { removeFromListAdder, addToListAdder } from '../../../actions/lists'; @@ -46,16 +50,16 @@ class List extends ImmutablePureComponent { let button; if (added) { - button = ; + button = ; } else { - button = ; + button = ; } return (
    - + {list.get('title')}
    diff --git a/app/javascript/mastodon/features/list_editor/components/account.jsx b/app/javascript/mastodon/features/list_editor/components/account.jsx index 4618bd1c16..f38c7d93a7 100644 --- a/app/javascript/mastodon/features/list_editor/components/account.jsx +++ b/app/javascript/mastodon/features/list_editor/components/account.jsx @@ -6,6 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as AddIcon } from '@material-symbols/svg-600/outlined/add.svg'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; + import { removeFromListEditor, addToListEditor } from '../../../actions/lists'; import { Avatar } from '../../../components/avatar'; import { DisplayName } from '../../../components/display_name'; @@ -53,9 +56,9 @@ class Account extends ImmutablePureComponent { let button; if (added) { - button = ; + button = ; } else { - button = ; + button = ; } return ( diff --git a/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx b/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx index 9e087a97d7..1e2446f92b 100644 --- a/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx +++ b/app/javascript/mastodon/features/list_editor/components/edit_list_form.jsx @@ -5,6 +5,8 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; +import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg'; + import { changeListEditorTitle, submitListEditor } from '../../../actions/lists'; import { IconButton } from '../../../components/icon_button'; @@ -61,6 +63,7 @@ class ListForm extends PureComponent { diff --git a/app/javascript/mastodon/features/list_editor/components/search.jsx b/app/javascript/mastodon/features/list_editor/components/search.jsx index 021bc450ad..093af5cd4e 100644 --- a/app/javascript/mastodon/features/list_editor/components/search.jsx +++ b/app/javascript/mastodon/features/list_editor/components/search.jsx @@ -7,6 +7,9 @@ import classNames from 'classnames'; import { connect } from 'react-redux'; +import { ReactComponent as CancelIcon } from '@material-symbols/svg-600/outlined/cancel.svg'; +import { ReactComponent as SearchIcon } from '@material-symbols/svg-600/outlined/search.svg'; + import { Icon } from 'mastodon/components/icon'; import { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from '../../../actions/lists'; @@ -69,8 +72,8 @@ class Search extends PureComponent {
    - - + +
    ); diff --git a/app/javascript/mastodon/features/list_timeline/index.jsx b/app/javascript/mastodon/features/list_timeline/index.jsx index a5acc416e0..aadb6ecd54 100644 --- a/app/javascript/mastodon/features/list_timeline/index.jsx +++ b/app/javascript/mastodon/features/list_timeline/index.jsx @@ -4,10 +4,14 @@ import { PureComponent } from 'react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Helmet } from 'react-helmet'; +import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { ReactComponent as DeleteIcon } from '@material-symbols/svg-600/outlined/delete.svg'; +import { ReactComponent as EditIcon } from '@material-symbols/svg-600/outlined/edit.svg'; +import { ReactComponent as ListAltIcon } from '@material-symbols/svg-600/outlined/list_alt.svg'; import Toggle from 'react-toggle'; import { addColumn, removeColumn, moveColumn } from 'mastodon/actions/columns'; @@ -22,6 +26,7 @@ import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import { RadioButton } from 'mastodon/components/radio_button'; import BundleColumnError from 'mastodon/features/ui/components/bundle_column_error'; import StatusListContainer from 'mastodon/features/ui/containers/status_list_container'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const messages = defineMessages({ deleteMessage: { id: 'confirmations.delete_list.message', defaultMessage: 'Are you sure you want to permanently delete this list?' }, @@ -38,10 +43,6 @@ const mapStateToProps = (state, props) => ({ class ListTimeline extends PureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, @@ -50,6 +51,7 @@ class ListTimeline extends PureComponent { multiColumn: PropTypes.bool, list: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]), intl: PropTypes.object.isRequired, + ...WithRouterPropTypes, }; handlePin = () => { @@ -59,7 +61,7 @@ class ListTimeline extends PureComponent { dispatch(removeColumn(columnId)); } else { dispatch(addColumn('LIST', { id: this.props.params.id })); - this.context.router.history.push('/'); + this.props.history.push('/'); } }; @@ -137,7 +139,7 @@ class ListTimeline extends PureComponent { if (columnId) { dispatch(removeColumn(columnId)); } else { - this.context.router.history.push('/lists'); + this.props.history.push('/lists'); } }, }, @@ -182,6 +184,7 @@ class ListTimeline extends PureComponent {
    @@ -240,4 +243,4 @@ class ListTimeline extends PureComponent { } -export default connect(mapStateToProps)(injectIntl(ListTimeline)); +export default withRouter(connect(mapStateToProps)(injectIntl(ListTimeline))); diff --git a/app/javascript/mastodon/features/lists/components/new_list_form.jsx b/app/javascript/mastodon/features/lists/components/new_list_form.jsx index 40e2d4a1c2..0fed9d70a2 100644 --- a/app/javascript/mastodon/features/lists/components/new_list_form.jsx +++ b/app/javascript/mastodon/features/lists/components/new_list_form.jsx @@ -6,7 +6,7 @@ import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { changeListEditorTitle, submitListEditor } from 'mastodon/actions/lists'; -import Button from 'mastodon/components/button'; +import { Button } from 'mastodon/components/button'; const messages = defineMessages({ label: { id: 'lists.new.title_placeholder', defaultMessage: 'New list title' }, diff --git a/app/javascript/mastodon/features/lists/index.jsx b/app/javascript/mastodon/features/lists/index.jsx index e947a40b83..58e85b4d28 100644 --- a/app/javascript/mastodon/features/lists/index.jsx +++ b/app/javascript/mastodon/features/lists/index.jsx @@ -9,6 +9,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; +import { ReactComponent as ListAltIcon } from '@material-symbols/svg-600/outlined/list_alt.svg'; + import { fetchLists } from 'mastodon/actions/lists'; import Column from 'mastodon/components/column'; import ColumnHeader from 'mastodon/components/column_header'; @@ -65,7 +67,7 @@ class Lists extends ImmutablePureComponent { return ( - + @@ -76,7 +78,7 @@ class Lists extends ImmutablePureComponent { bindToDocument={!multiColumn} > {lists.map(list => - , + , )} diff --git a/app/javascript/mastodon/features/mutes/index.jsx b/app/javascript/mastodon/features/mutes/index.jsx index 947fe4c9b2..da69bc547d 100644 --- a/app/javascript/mastodon/features/mutes/index.jsx +++ b/app/javascript/mastodon/features/mutes/index.jsx @@ -8,6 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as VolumeOffIcon } from '@material-symbols/svg-600/outlined/volume_off.svg'; import { debounce } from 'lodash'; import { fetchMutes, expandMutes } from '../../actions/mutes'; @@ -61,7 +62,7 @@ class Mutes extends ImmutablePureComponent { const emptyMessage = ; return ( - + + ); } diff --git a/app/javascript/mastodon/features/notifications/components/filter_bar.jsx b/app/javascript/mastodon/features/notifications/components/filter_bar.jsx index 773fe9a8f8..84bd4791ca 100644 --- a/app/javascript/mastodon/features/notifications/components/filter_bar.jsx +++ b/app/javascript/mastodon/features/notifications/components/filter_bar.jsx @@ -3,6 +3,13 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import { ReactComponent as HomeIcon } from '@material-symbols/svg-600/outlined/home-fill.svg'; +import { ReactComponent as InsertChartIcon } from '@material-symbols/svg-600/outlined/insert_chart.svg'; +import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add.svg'; +import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg'; +import { ReactComponent as ReplyAllIcon } from '@material-symbols/svg-600/outlined/reply_all.svg'; +import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star.svg'; + import { Icon } from 'mastodon/components/icon'; const tooltips = defineMessages({ @@ -66,42 +73,42 @@ class FilterBar extends PureComponent { onClick={this.onClick('mention')} title={intl.formatMessage(tooltips.mentions)} > - +
    ); diff --git a/app/javascript/mastodon/features/notifications/components/follow_request.jsx b/app/javascript/mastodon/features/notifications/components/follow_request.jsx index 8a5c997c64..c10633beeb 100644 --- a/app/javascript/mastodon/features/notifications/components/follow_request.jsx +++ b/app/javascript/mastodon/features/notifications/components/follow_request.jsx @@ -7,6 +7,9 @@ import { Link } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; + import { Avatar } from 'mastodon/components/avatar'; import { DisplayName } from 'mastodon/components/display_name'; import { IconButton } from 'mastodon/components/icon_button'; @@ -50,8 +53,8 @@ class FollowRequest extends ImmutablePureComponent {
    - - + +
    diff --git a/app/javascript/mastodon/features/notifications/components/notification.jsx b/app/javascript/mastodon/features/notifications/components/notification.jsx index 43c5e85cef..ad7308b26f 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.jsx +++ b/app/javascript/mastodon/features/notifications/components/notification.jsx @@ -3,17 +3,26 @@ import PropTypes from 'prop-types'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import classNames from 'classnames'; -import { Link } from 'react-router-dom'; +import { Link, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { ReactComponent as EditIcon } from '@material-symbols/svg-600/outlined/edit.svg'; +import { ReactComponent as FlagIcon } from '@material-symbols/svg-600/outlined/flag-fill.svg'; +import { ReactComponent as HomeIcon } from '@material-symbols/svg-600/outlined/home-fill.svg'; +import { ReactComponent as InsertChartIcon } from '@material-symbols/svg-600/outlined/insert_chart.svg'; +import { ReactComponent as PersonIcon } from '@material-symbols/svg-600/outlined/person-fill.svg'; +import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add-fill.svg'; +import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg'; +import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; import { HotKeys } from 'react-hotkeys'; import { Icon } from 'mastodon/components/icon'; import AccountContainer from 'mastodon/containers/account_container'; import StatusContainer from 'mastodon/containers/status_container'; import { me } from 'mastodon/initial_state'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; import FollowRequestContainer from '../containers/follow_request_container'; @@ -40,11 +49,6 @@ const notificationForScreenReader = (intl, message, timestamp) => { }; class Notification extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { notification: ImmutablePropTypes.map.isRequired, hidden: PropTypes.bool, @@ -61,6 +65,7 @@ class Notification extends ImmutablePureComponent { cacheMediaWidth: PropTypes.func, cachedMediaWidth: PropTypes.number, unread: PropTypes.bool, + ...WithRouterPropTypes, }; handleMoveUp = () => { @@ -77,7 +82,7 @@ class Notification extends ImmutablePureComponent { const { notification } = this.props; if (notification.get('status')) { - this.context.router.history.push(`/@${notification.getIn(['status', 'account', 'acct'])}/${notification.get('status')}`); + this.props.history.push(`/@${notification.getIn(['status', 'account', 'acct'])}/${notification.get('status')}`); } else { this.handleOpenProfile(); } @@ -85,14 +90,14 @@ class Notification extends ImmutablePureComponent { handleOpenProfile = () => { const { notification } = this.props; - this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); + this.props.history.push(`/@${notification.getIn(['account', 'acct'])}`); }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; - onMention(notification.get('account'), this.context.router.history); + onMention(notification.get('account'), this.props.history); }; handleHotkeyFavourite = () => { @@ -131,9 +136,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -153,9 +156,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -193,9 +194,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -225,9 +224,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -261,9 +258,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -298,9 +293,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -337,9 +330,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + {ownPoll ? ( @@ -374,9 +365,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -404,9 +393,7 @@ class Notification extends ImmutablePureComponent {
    -
    - -
    + @@ -453,4 +440,4 @@ class Notification extends ImmutablePureComponent { } -export default injectIntl(Notification); +export default withRouter(injectIntl(Notification)); diff --git a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx index 59b0335c10..b7ebb4c467 100644 --- a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx +++ b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.jsx @@ -5,9 +5,12 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; +import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg'; +import { ReactComponent as TuneIcon } from '@material-symbols/svg-600/outlined/tune.svg'; + import { requestBrowserPermission } from 'mastodon/actions/notifications'; import { changeSetting } from 'mastodon/actions/settings'; -import Button from 'mastodon/components/button'; +import { Button } from 'mastodon/components/button'; import { Icon } from 'mastodon/components/icon'; import { IconButton } from 'mastodon/components/icon_button'; @@ -36,11 +39,11 @@ class NotificationsPermissionBanner extends PureComponent { return (
    - +

    -

    }} />

    +

    }} />

    ); diff --git a/app/javascript/mastodon/features/notifications/index.jsx b/app/javascript/mastodon/features/notifications/index.jsx index 9fd2cf4b18..379932b7b7 100644 --- a/app/javascript/mastodon/features/notifications/index.jsx +++ b/app/javascript/mastodon/features/notifications/index.jsx @@ -10,6 +10,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; +import { ReactComponent as DoneAllIcon } from '@material-symbols/svg-600/outlined/done_all.svg'; +import { ReactComponent as NotificationsIcon } from '@material-symbols/svg-600/outlined/notifications-fill.svg'; import { debounce } from 'lodash'; import { compareId } from 'mastodon/compare_id'; @@ -260,7 +262,7 @@ class Notifications extends PureComponent { onClick={this.handleMarkAsRead} className='column-header__button' > - + ); } @@ -269,6 +271,7 @@ class Notifications extends PureComponent { ( - - - -); - -export default ArrowSmallRight; \ No newline at end of file diff --git a/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx b/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx index 32d1754ff6..37288a286f 100644 --- a/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx +++ b/app/javascript/mastodon/features/onboarding/components/progress_indicator.jsx @@ -3,7 +3,9 @@ import { Fragment } from 'react'; import classNames from 'classnames'; -import { Check } from 'mastodon/components/check'; +import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/done.svg'; + +import { Icon } from 'mastodon/components/icon'; const ProgressIndicator = ({ steps, completed }) => (
    @@ -12,7 +14,7 @@ const ProgressIndicator = ({ steps, completed }) => ( {i > 0 &&
    i })} />}
    i })}> - {completed > i && } + {completed > i && }
    ))} diff --git a/app/javascript/mastodon/features/onboarding/components/step.jsx b/app/javascript/mastodon/features/onboarding/components/step.jsx index 379f433040..1f42d9d499 100644 --- a/app/javascript/mastodon/features/onboarding/components/step.jsx +++ b/app/javascript/mastodon/features/onboarding/components/step.jsx @@ -1,15 +1,15 @@ import PropTypes from 'prop-types'; -import { Check } from 'mastodon/components/check'; +import { ReactComponent as ArrowRightAltIcon } from '@material-symbols/svg-600/outlined/arrow_right_alt.svg'; +import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/done.svg'; + import { Icon } from 'mastodon/components/icon'; -import ArrowSmallRight from './arrow_small_right'; - -const Step = ({ label, description, icon, completed, onClick, href }) => { +const Step = ({ label, description, icon, iconComponent, completed, onClick, href }) => { const content = ( <>
    - +
    @@ -18,7 +18,7 @@ const Step = ({ label, description, icon, completed, onClick, href }) => {
    - {completed ? : } + {completed ? : }
    ); @@ -42,6 +42,7 @@ Step.propTypes = { label: PropTypes.node, description: PropTypes.node, icon: PropTypes.string, + iconComponent: PropTypes.func, completed: PropTypes.bool, href: PropTypes.string, onClick: PropTypes.func, diff --git a/app/javascript/mastodon/features/onboarding/index.jsx b/app/javascript/mastodon/features/onboarding/index.jsx index 41d499f684..0be1512ad8 100644 --- a/app/javascript/mastodon/features/onboarding/index.jsx +++ b/app/javascript/mastodon/features/onboarding/index.jsx @@ -3,24 +3,30 @@ import PropTypes from 'prop-types'; import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; import { Helmet } from 'react-helmet'; -import { Link } from 'react-router-dom'; +import { Link, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; +import { ReactComponent as AccountCircleIcon } from '@material-symbols/svg-600/outlined/account_circle.svg'; +import { ReactComponent as ArrowRightAltIcon } from '@material-symbols/svg-600/outlined/arrow_right_alt.svg'; +import { ReactComponent as ContentCopyIcon } from '@material-symbols/svg-600/outlined/content_copy.svg'; +import { ReactComponent as EditNoteIcon } from '@material-symbols/svg-600/outlined/edit_note.svg'; +import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add.svg'; import { debounce } from 'lodash'; import illustration from 'mastodon/../images/elephant_ui_conversation.svg'; import { fetchAccount } from 'mastodon/actions/accounts'; import { focusCompose } from 'mastodon/actions/compose'; import { closeOnboarding } from 'mastodon/actions/onboarding'; +import { Icon } from 'mastodon/components/icon'; import Column from 'mastodon/features/ui/components/column'; import { me } from 'mastodon/initial_state'; import { makeGetAccount } from 'mastodon/selectors'; import { assetHost } from 'mastodon/utils/config'; +import { WithRouterPropTypes } from 'mastodon/utils/react_router'; -import ArrowSmallRight from './components/arrow_small_right'; import Step from './components/step'; import Follows from './follows'; import Share from './share'; @@ -38,15 +44,11 @@ const mapStateToProps = () => { }; class Onboarding extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object.isRequired, - }; - static propTypes = { dispatch: PropTypes.func.isRequired, account: ImmutablePropTypes.map, multiColumn: PropTypes.bool, + ...WithRouterPropTypes, }; state = { @@ -56,11 +58,10 @@ class Onboarding extends ImmutablePureComponent { }; handleClose = () => { - const { dispatch } = this.props; - const { router } = this.context; + const { dispatch, history } = this.props; dispatch(closeOnboarding()); - router.history.push('/home'); + history.push('/home'); }; handleProfileClick = () => { @@ -72,10 +73,9 @@ class Onboarding extends ImmutablePureComponent { }; handleComposeClick = () => { - const { dispatch, intl } = this.props; - const { router } = this.context; + const { dispatch, intl, history } = this.props; - dispatch(focusCompose(router.history, intl.formatMessage(messages.template))); + dispatch(focusCompose(history, intl.formatMessage(messages.template))); }; handleShareClick = () => { @@ -120,10 +120,10 @@ class Onboarding extends ImmutablePureComponent {
    - 0 && account.get('note').length > 0)} icon='address-book-o' label={} description={} /> - = 7} icon='user-plus' label={} description={} /> - = 1} icon='pencil-square-o' label={} description={ }} />} /> - } description={} /> + 0 && account.get('note').length > 0)} icon='address-book-o' iconComponent={AccountCircleIcon} label={} description={} /> + = 7} icon='user-plus' iconComponent={PersonAddIcon} label={} description={} /> + = 1} icon='pencil-square-o' iconComponent={EditNoteIcon} label={} description={ }} />} /> + } description={} />

    @@ -131,12 +131,12 @@ class Onboarding extends ImmutablePureComponent {
    - + - +
    @@ -150,4 +150,4 @@ class Onboarding extends ImmutablePureComponent { } -export default connect(mapStateToProps)(injectIntl(Onboarding)); +export default withRouter(connect(mapStateToProps)(injectIntl(Onboarding))); diff --git a/app/javascript/mastodon/features/onboarding/share.jsx b/app/javascript/mastodon/features/onboarding/share.jsx index c5b185a244..c9d58c4e65 100644 --- a/app/javascript/mastodon/features/onboarding/share.jsx +++ b/app/javascript/mastodon/features/onboarding/share.jsx @@ -9,6 +9,8 @@ import { Link } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { ReactComponent as ArrowRightAltIcon } from '@material-symbols/svg-600/outlined/arrow_right_alt.svg'; +import { ReactComponent as ContentCopyIcon } from '@material-symbols/svg-600/outlined/content_copy.svg'; import SwipeableViews from 'react-swipeable-views'; import Column from 'mastodon/components/column'; @@ -16,8 +18,6 @@ import ColumnBackButton from 'mastodon/components/column_back_button'; import { Icon } from 'mastodon/components/icon'; import { me, domain } from 'mastodon/initial_state'; -import ArrowSmallRight from './components/arrow_small_right'; - const messages = defineMessages({ shareableMessage: { id: 'onboarding.share.message', defaultMessage: 'I\'m {username} on #Mastodon! Come follow me at {url}' }, }); @@ -79,7 +79,7 @@ class CopyPasteText extends PureComponent {