Compare commits
No commits in common. "main" and "v4.1.14" have entirely different histories.
30
.github/dependabot.yml
vendored
Normal file
30
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
allow:
|
||||||
|
- dependency-type: direct
|
||||||
|
|
||||||
|
- package-ecosystem: bundler
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
allow:
|
||||||
|
- dependency-type: direct
|
||||||
|
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 99
|
||||||
|
allow:
|
||||||
|
- dependency-type: direct
|
153
.github/workflows/test-ruby.yml
vendored
153
.github/workflows/test-ruby.yml
vendored
@ -1,153 +0,0 @@
|
|||||||
name: Ruby Testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- 'dependabot/**'
|
|
||||||
- 'renovate/**'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUNDLE_CLEAN: true
|
|
||||||
BUNDLE_FROZEN: true
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
mode:
|
|
||||||
- production
|
|
||||||
- test
|
|
||||||
env:
|
|
||||||
RAILS_ENV: ${{ matrix.mode }}
|
|
||||||
BUNDLE_WITH: ${{ matrix.mode }}
|
|
||||||
OTP_SECRET: precompile_placeholder
|
|
||||||
SECRET_KEY_BASE: precompile_placeholder
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- 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 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
|
|
||||||
run: |-
|
|
||||||
./bin/rails assets:precompile
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: matrix.mode == 'test'
|
|
||||||
with:
|
|
||||||
path: |-
|
|
||||||
./public/assets
|
|
||||||
./public/packs-test
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
retention-days: 0
|
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
DISABLE_SIMPLECOV: true
|
|
||||||
RAILS_ENV: test
|
|
||||||
ALLOW_NOPAM: true
|
|
||||||
PAM_ENABLED: true
|
|
||||||
PAM_DEFAULT_SERVICE: pam_test
|
|
||||||
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
|
||||||
OIDC_ENABLED: true
|
|
||||||
OIDC_SCOPE: read
|
|
||||||
SAML_ENABLED: true
|
|
||||||
CAS_ENABLED: true
|
|
||||||
BUNDLE_WITH: 'pam_authentication test'
|
|
||||||
CI_JOBS: ${{ matrix.ci_job }}/4
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '.ruby-version'
|
|
||||||
ci_job:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
- 4
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
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
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: './bin/rails db:create db:schema:load db:seed'
|
|
||||||
|
|
||||||
- run: bin/rspec
|
|
85
CHANGELOG.md
85
CHANGELOG.md
@ -3,91 +3,6 @@ Changelog
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [4.1.18] - 2024-07-04
|
|
||||||
|
|
||||||
### Security
|
|
||||||
|
|
||||||
- Fix incorrect permission checking on multiple API endpoints ([GHSA-58x8-3qxw-6hm7](https://github.com/mastodon/mastodon/security/advisories/GHSA-58x8-3qxw-6hm7))
|
|
||||||
- Fix incorrect authorship checking when processing some activities (CVE-2024-37903, [GHSA-xjvf-fm67-4qc3](https://github.com/mastodon/mastodon/security/advisories/GHSA-xjvf-fm67-4qc3))
|
|
||||||
- Fix ongoing streaming sessions not being invalidated when application tokens get revoked ([GHSA-vp5r-5pgw-jwqx](https://github.com/mastodon/mastodon/security/advisories/GHSA-vp5r-5pgw-jwqx))
|
|
||||||
- Update dependencies
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Change preview cards generation to skip unusually long URLs ([oneiros](https://github.com/mastodon/mastodon/pull/30854))
|
|
||||||
- Change search modifiers to be case-insensitive ([Gargron](https://github.com/mastodon/mastodon/pull/30865))
|
|
||||||
- Change `STATSD_ADDR` handling to emit a warning rather than crashing if the address is unreachable ([timothyjrogers](https://github.com/mastodon/mastodon/pull/30691))
|
|
||||||
- Change PWA start URL from `/home` to `/` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27377))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix scheduled statuses scheduled in less than 5 minutes being immediately published ([danielmbrasil](https://github.com/mastodon/mastodon/pull/30584))
|
|
||||||
- Fix encoding detection for link cards ([oneiros](https://github.com/mastodon/mastodon/pull/30780))
|
|
||||||
- Fix `/admin/accounts/:account_id/statuses/:id` for edited posts with media attachments ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/30819))
|
|
||||||
|
|
||||||
## [4.1.17] - 2024-05-30
|
|
||||||
|
|
||||||
### Security
|
|
||||||
|
|
||||||
- Update dependencies
|
|
||||||
- Fix private mention filtering ([GHSA-5fq7-3p3j-9vrf](https://github.com/mastodon/mastodon/security/advisories/GHSA-5fq7-3p3j-9vrf))
|
|
||||||
- Fix password change endpoint not being rate-limited ([GHSA-q3rg-xx5v-4mxh](https://github.com/mastodon/mastodon/security/advisories/GHSA-q3rg-xx5v-4mxh))
|
|
||||||
- Add hardening around rate-limit bypass ([GHSA-c2r5-cfqr-c553](https://github.com/mastodon/mastodon/security/advisories/GHSA-c2r5-cfqr-c553))
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Add fallback redirection when getting a webfinger query `WEB_DOMAIN@WEB_DOMAIN` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/28592))
|
|
||||||
- Add `digest` attribute to `Admin::DomainBlock` entity in REST API ([ThisIsMissEm](https://github.com/mastodon/mastodon/pull/29092))
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
- Remove superfluous application-level caching in some controllers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29862))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix leaking Elasticsearch connections in Sidekiq processes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/30450))
|
|
||||||
- Fix language of remote posts not being recognized when using unusual casing ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/30403))
|
|
||||||
- Fix off-by-one in `tootctl media` commands ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/30306))
|
|
||||||
- Fix removal of allowed domains (in `LIMITED_FEDERATION_MODE`) not being recorded in the audit log ([ThisIsMissEm](https://github.com/mastodon/mastodon/pull/30125))
|
|
||||||
- Fix not being able to block a subdomain of an already-blocked domain through the API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/30119))
|
|
||||||
- Fix `Idempotency-Key` being ignored when scheduling a post ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/30084))
|
|
||||||
- Fix crash when supplying the `FFMPEG_BINARY` environment variable ([timothyjrogers](https://github.com/mastodon/mastodon/pull/30022))
|
|
||||||
- Fix improper email address validation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29838))
|
|
||||||
- Fix results/query in `api/v1/featured_tags/suggestions` ([mjankowski](https://github.com/mastodon/mastodon/pull/29597))
|
|
||||||
- Fix unblocking internationalized domain names under certain conditions ([tribela](https://github.com/mastodon/mastodon/pull/29530))
|
|
||||||
- Fix admin account created by `mastodon:setup` not being auto-approved ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29379))
|
|
||||||
- Fix reference to non-existent var in CLI maintenance command ([mjankowski](https://github.com/mastodon/mastodon/pull/28363))
|
|
||||||
|
|
||||||
## [4.1.16] - 2024-02-23
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Add hourly task to automatically require approval for new registrations in the absence of moderators ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29318), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/29355))
|
|
||||||
In order to prevent future abandoned Mastodon servers from being used for spam, harassment and other malicious activity, Mastodon will now automatically switch new user registrations to require moderator approval whenever they are left open and no activity (including non-moderation actions from apps) from any logged-in user with permission to access moderation reports has been detected in a full week.
|
|
||||||
When this happens, users with the permission to change server settings will receive an email notification.
|
|
||||||
This feature is disabled when `EMAIL_DOMAIN_ALLOWLIST` is used, and can also be disabled with `DISABLE_AUTOMATIC_SWITCHING_TO_APPROVED_REGISTRATIONS=true`.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Change registrations to be closed by default on new installations ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29280))
|
|
||||||
If you are running a server and never changed your registrations mode from the default, updating will automatically close your registrations.
|
|
||||||
Simply re-enable them through the administration interface or using `tootctl settings registrations open` if you want to enable them again.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix processing of remote ActivityPub actors making use of `Link` objects as `Image` `url` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29335))
|
|
||||||
- Fix link verifications when page size exceeds 1MB ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29358))
|
|
||||||
|
|
||||||
## [4.1.15] - 2024-02-16
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix OmniAuth tests and edge cases in error handling ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/29201), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/29207))
|
|
||||||
|
|
||||||
### Security
|
|
||||||
|
|
||||||
- Fix insufficient checking of remote posts ([GHSA-jhrq-qvrm-qr36](https://github.com/mastodon/mastodon/security/advisories/GHSA-jhrq-qvrm-qr36))
|
|
||||||
|
|
||||||
## [4.1.14] - 2024-02-14
|
## [4.1.14] - 2024-02-14
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
1
Gemfile
1
Gemfile
@ -158,4 +158,3 @@ gem 'concurrent-ruby', require: false
|
|||||||
gem 'connection_pool', require: false
|
gem 'connection_pool', require: false
|
||||||
gem 'xorcist', '~> 1.1'
|
gem 'xorcist', '~> 1.1'
|
||||||
gem 'cocoon', '~> 1.2'
|
gem 'cocoon', '~> 1.2'
|
||||||
gem 'mail', '~> 2.8'
|
|
||||||
|
139
Gemfile.lock
139
Gemfile.lock
@ -10,40 +10,40 @@ GIT
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (6.1.7.8)
|
actioncable (6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (6.1.7.8)
|
actionmailbox (6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
activejob (= 6.1.7.8)
|
activejob (= 6.1.7.6)
|
||||||
activerecord (= 6.1.7.8)
|
activerecord (= 6.1.7.6)
|
||||||
activestorage (= 6.1.7.8)
|
activestorage (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
actionmailer (6.1.7.8)
|
actionmailer (6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
actionview (= 6.1.7.8)
|
actionview (= 6.1.7.6)
|
||||||
activejob (= 6.1.7.8)
|
activejob (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (6.1.7.8)
|
actionpack (6.1.7.6)
|
||||||
actionview (= 6.1.7.8)
|
actionview (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
rack (~> 2.0, >= 2.0.9)
|
rack (~> 2.0, >= 2.0.9)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (6.1.7.8)
|
actiontext (6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
activerecord (= 6.1.7.8)
|
activerecord (= 6.1.7.6)
|
||||||
activestorage (= 6.1.7.8)
|
activestorage (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (6.1.7.8)
|
actionview (6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
@ -54,22 +54,22 @@ GEM
|
|||||||
case_transform (>= 0.2)
|
case_transform (>= 0.2)
|
||||||
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
||||||
active_record_query_trace (1.8)
|
active_record_query_trace (1.8)
|
||||||
activejob (6.1.7.8)
|
activejob (6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (6.1.7.8)
|
activemodel (6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
activerecord (6.1.7.8)
|
activerecord (6.1.7.6)
|
||||||
activemodel (= 6.1.7.8)
|
activemodel (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
activestorage (6.1.7.8)
|
activestorage (6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
activejob (= 6.1.7.8)
|
activejob (= 6.1.7.6)
|
||||||
activerecord (= 6.1.7.8)
|
activerecord (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
mini_mime (>= 1.1.0)
|
||||||
activesupport (6.1.7.8)
|
activesupport (6.1.7.6)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
@ -105,7 +105,6 @@ GEM
|
|||||||
aws-sigv4 (~> 1.4)
|
aws-sigv4 (~> 1.4)
|
||||||
aws-sigv4 (1.5.2)
|
aws-sigv4 (1.5.2)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
base64 (0.2.0)
|
|
||||||
bcrypt (3.1.17)
|
bcrypt (3.1.17)
|
||||||
better_errors (2.9.1)
|
better_errors (2.9.1)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
@ -174,7 +173,7 @@ GEM
|
|||||||
cocoon (1.2.15)
|
cocoon (1.2.15)
|
||||||
coderay (1.1.3)
|
coderay (1.1.3)
|
||||||
color_diff (0.1)
|
color_diff (0.1)
|
||||||
concurrent-ruby (1.2.3)
|
concurrent-ruby (1.2.2)
|
||||||
connection_pool (2.3.0)
|
connection_pool (2.3.0)
|
||||||
cose (1.2.1)
|
cose (1.2.1)
|
||||||
cbor (~> 0.5.9)
|
cbor (~> 0.5.9)
|
||||||
@ -184,7 +183,7 @@ GEM
|
|||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
css_parser (1.12.0)
|
css_parser (1.12.0)
|
||||||
addressable
|
addressable
|
||||||
date (3.3.4)
|
date (3.3.3)
|
||||||
debug_inspector (1.0.0)
|
debug_inspector (1.0.0)
|
||||||
devise (4.8.1)
|
devise (4.8.1)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
@ -331,7 +330,7 @@ GEM
|
|||||||
jmespath (1.6.2)
|
jmespath (1.6.2)
|
||||||
json (2.6.3)
|
json (2.6.3)
|
||||||
json-canonicalization (0.3.0)
|
json-canonicalization (0.3.0)
|
||||||
json-jwt (1.15.3.1)
|
json-jwt (1.15.3)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
aes_key_wrap
|
aes_key_wrap
|
||||||
bindata
|
bindata
|
||||||
@ -396,7 +395,7 @@ GEM
|
|||||||
net-smtp
|
net-smtp
|
||||||
makara (0.5.1)
|
makara (0.5.1)
|
||||||
activerecord (>= 5.2.0)
|
activerecord (>= 5.2.0)
|
||||||
marcel (1.0.4)
|
marcel (1.0.2)
|
||||||
mario-redis-lock (1.2.1)
|
mario-redis-lock (1.2.1)
|
||||||
redis (>= 3.0.5)
|
redis (>= 3.0.5)
|
||||||
matrix (0.4.2)
|
matrix (0.4.2)
|
||||||
@ -406,7 +405,7 @@ GEM
|
|||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2022.0105)
|
mime-types-data (3.2022.0105)
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
mini_portile2 (2.8.7)
|
mini_portile2 (2.8.5)
|
||||||
minitest (5.17.0)
|
minitest (5.17.0)
|
||||||
msgpack (1.6.0)
|
msgpack (1.6.0)
|
||||||
multi_json (1.15.0)
|
multi_json (1.15.0)
|
||||||
@ -417,15 +416,15 @@ GEM
|
|||||||
net-ldap (0.17.1)
|
net-ldap (0.17.1)
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
net-protocol
|
net-protocol
|
||||||
net-protocol (0.2.2)
|
net-protocol (0.2.1)
|
||||||
timeout
|
timeout
|
||||||
net-scp (4.0.0.rc1)
|
net-scp (4.0.0.rc1)
|
||||||
net-ssh (>= 2.6.5, < 8.0.0)
|
net-ssh (>= 2.6.5, < 8.0.0)
|
||||||
net-smtp (0.3.4)
|
net-smtp (0.3.3)
|
||||||
net-protocol
|
net-protocol
|
||||||
net-ssh (7.0.1)
|
net-ssh (7.0.1)
|
||||||
nio4r (2.5.9)
|
nio4r (2.5.9)
|
||||||
nokogiri (1.16.6)
|
nokogiri (1.16.2)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nsa (0.2.8)
|
nsa (0.2.8)
|
||||||
@ -469,7 +468,7 @@ GEM
|
|||||||
parslet (2.0.0)
|
parslet (2.0.0)
|
||||||
pastel (0.8.0)
|
pastel (0.8.0)
|
||||||
tty-color (~> 0.5)
|
tty-color (~> 0.5)
|
||||||
pg (1.4.6)
|
pg (1.4.5)
|
||||||
pghero (3.1.0)
|
pghero (3.1.0)
|
||||||
activerecord (>= 6)
|
activerecord (>= 6)
|
||||||
pkg-config (1.5.1)
|
pkg-config (1.5.1)
|
||||||
@ -492,13 +491,13 @@ GEM
|
|||||||
pry-rails (0.3.9)
|
pry-rails (0.3.9)
|
||||||
pry (>= 0.10.4)
|
pry (>= 0.10.4)
|
||||||
public_suffix (5.0.1)
|
public_suffix (5.0.1)
|
||||||
puma (5.6.8)
|
puma (5.6.7)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
pundit (2.3.0)
|
pundit (2.3.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
raabro (1.4.0)
|
raabro (1.4.0)
|
||||||
racc (1.7.3)
|
racc (1.7.3)
|
||||||
rack (2.2.9)
|
rack (2.2.8)
|
||||||
rack-attack (6.6.1)
|
rack-attack (6.6.1)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rack-cors (1.1.1)
|
rack-cors (1.1.1)
|
||||||
@ -513,20 +512,20 @@ GEM
|
|||||||
rack
|
rack
|
||||||
rack-test (2.0.2)
|
rack-test (2.0.2)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
rails (6.1.7.8)
|
rails (6.1.7.6)
|
||||||
actioncable (= 6.1.7.8)
|
actioncable (= 6.1.7.6)
|
||||||
actionmailbox (= 6.1.7.8)
|
actionmailbox (= 6.1.7.6)
|
||||||
actionmailer (= 6.1.7.8)
|
actionmailer (= 6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
actiontext (= 6.1.7.8)
|
actiontext (= 6.1.7.6)
|
||||||
actionview (= 6.1.7.8)
|
actionview (= 6.1.7.6)
|
||||||
activejob (= 6.1.7.8)
|
activejob (= 6.1.7.6)
|
||||||
activemodel (= 6.1.7.8)
|
activemodel (= 6.1.7.6)
|
||||||
activerecord (= 6.1.7.8)
|
activerecord (= 6.1.7.6)
|
||||||
activestorage (= 6.1.7.8)
|
activestorage (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 6.1.7.8)
|
railties (= 6.1.7.6)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-controller-testing (1.0.5)
|
rails-controller-testing (1.0.5)
|
||||||
actionpack (>= 5.0.1.rc1)
|
actionpack (>= 5.0.1.rc1)
|
||||||
@ -542,9 +541,9 @@ GEM
|
|||||||
railties (>= 6.0.0, < 7)
|
railties (>= 6.0.0, < 7)
|
||||||
rails-settings-cached (0.6.6)
|
rails-settings-cached (0.6.6)
|
||||||
rails (>= 4.2.0)
|
rails (>= 4.2.0)
|
||||||
railties (6.1.7.8)
|
railties (6.1.7.6)
|
||||||
actionpack (= 6.1.7.8)
|
actionpack (= 6.1.7.6)
|
||||||
activesupport (= 6.1.7.8)
|
activesupport (= 6.1.7.6)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
@ -566,8 +565,7 @@ GEM
|
|||||||
responders (3.0.1)
|
responders (3.0.1)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
rexml (3.2.8)
|
rexml (3.2.5)
|
||||||
strscan (>= 3.0.9)
|
|
||||||
rotp (6.2.0)
|
rotp (6.2.0)
|
||||||
rpam2 (4.0.2)
|
rpam2 (4.0.2)
|
||||||
rqrcode (2.1.2)
|
rqrcode (2.1.2)
|
||||||
@ -665,8 +663,7 @@ GEM
|
|||||||
simplecov-html (0.12.3)
|
simplecov-html (0.12.3)
|
||||||
simplecov_json_formatter (0.1.4)
|
simplecov_json_formatter (0.1.4)
|
||||||
smart_properties (1.17.0)
|
smart_properties (1.17.0)
|
||||||
sprockets (3.7.3)
|
sprockets (3.7.2)
|
||||||
base64
|
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.4.2)
|
sprockets-rails (3.4.2)
|
||||||
@ -682,7 +679,6 @@ GEM
|
|||||||
redlock (~> 1.0)
|
redlock (~> 1.0)
|
||||||
strong_migrations (0.7.9)
|
strong_migrations (0.7.9)
|
||||||
activerecord (>= 5)
|
activerecord (>= 5)
|
||||||
strscan (3.1.0)
|
|
||||||
swd (1.3.0)
|
swd (1.3.0)
|
||||||
activesupport (>= 3)
|
activesupport (>= 3)
|
||||||
attr_required (>= 0.0.5)
|
attr_required (>= 0.0.5)
|
||||||
@ -757,7 +753,7 @@ GEM
|
|||||||
xorcist (1.1.3)
|
xorcist (1.1.3)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
zeitwerk (2.6.16)
|
zeitwerk (2.6.12)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
@ -820,7 +816,6 @@ DEPENDENCIES
|
|||||||
letter_opener_web (~> 2.0)
|
letter_opener_web (~> 2.0)
|
||||||
link_header (~> 0.0)
|
link_header (~> 0.0)
|
||||||
lograge (~> 0.12)
|
lograge (~> 0.12)
|
||||||
mail (~> 2.8)
|
|
||||||
makara (~> 0.5)
|
makara (~> 0.5)
|
||||||
mario-redis-lock (~> 1.2)
|
mario-redis-lock (~> 1.2)
|
||||||
memory_profiler
|
memory_profiler
|
||||||
|
@ -25,8 +25,6 @@ class Admin::DomainAllowsController < Admin::BaseController
|
|||||||
def destroy
|
def destroy
|
||||||
authorize @domain_allow, :destroy?
|
authorize @domain_allow, :destroy?
|
||||||
UnallowDomainService.new.call(@domain_allow)
|
UnallowDomainService.new.call(@domain_allow)
|
||||||
log_action :destroy, @domain_allow
|
|
||||||
|
|
||||||
redirect_to admin_instances_path, notice: I18n.t('admin.domain_allows.destroyed_msg')
|
redirect_to admin_instances_path, notice: I18n.t('admin.domain_allows.destroyed_msg')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -7,11 +7,8 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
|
|||||||
after_action :insert_pagination_headers, unless: -> { truthy_param?(:pinned) }
|
after_action :insert_pagination_headers, unless: -> { truthy_param?(:pinned) }
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
|
||||||
render json: @statuses, each_serializer: REST::StatusSerializer,
|
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -19,11 +19,10 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
|||||||
def create
|
def create
|
||||||
authorize :domain_block, :create?
|
authorize :domain_block, :create?
|
||||||
|
|
||||||
@domain_block = DomainBlock.new(resource_params)
|
|
||||||
existing_domain_block = resource_params[:domain].present? ? DomainBlock.rule_for(resource_params[:domain]) : nil
|
existing_domain_block = resource_params[:domain].present? ? DomainBlock.rule_for(resource_params[:domain]) : nil
|
||||||
return render json: existing_domain_block, serializer: REST::Admin::ExistingDomainBlockErrorSerializer, status: 422 if conflicts_with_existing_block?(@domain_block, existing_domain_block)
|
return render json: existing_domain_block, serializer: REST::Admin::ExistingDomainBlockErrorSerializer, status: 422 if existing_domain_block.present?
|
||||||
|
|
||||||
@domain_block.save!
|
@domain_block = DomainBlock.create!(resource_params)
|
||||||
DomainBlockWorker.perform_async(@domain_block.id)
|
DomainBlockWorker.perform_async(@domain_block.id)
|
||||||
log_action :create, @domain_block
|
log_action :create, @domain_block
|
||||||
render json: @domain_block, serializer: REST::Admin::DomainBlockSerializer
|
render json: @domain_block, serializer: REST::Admin::DomainBlockSerializer
|
||||||
@ -56,10 +55,6 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def conflicts_with_existing_block?(domain_block, existing_domain_block)
|
|
||||||
existing_domain_block.present? && (existing_domain_block.domain == TagManager.instance.normalize_domain(domain_block.domain) || !domain_block.stricter_than?(existing_domain_block))
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_domain_blocks
|
def set_domain_blocks
|
||||||
@domain_blocks = filtered_domain_blocks.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
@domain_blocks = filtered_domain_blocks.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
||||||
end
|
end
|
||||||
|
@ -6,11 +6,8 @@ class Api::V1::BookmarksController < Api::BaseController
|
|||||||
after_action :insert_pagination_headers
|
after_action :insert_pagination_headers
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
|
||||||
render json: @statuses, each_serializer: REST::StatusSerializer,
|
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -6,11 +6,8 @@ class Api::V1::FavouritesController < Api::BaseController
|
|||||||
after_action :insert_pagination_headers
|
after_action :insert_pagination_headers
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
|
||||||
render json: @statuses, each_serializer: REST::StatusSerializer,
|
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -12,10 +12,6 @@ class Api::V1::FeaturedTags::SuggestionsController < Api::BaseController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def set_recently_used_tags
|
def set_recently_used_tags
|
||||||
@recently_used_tags = Tag.recently_used(current_account).where.not(id: featured_tag_ids).limit(10)
|
@recently_used_tags = Tag.recently_used(current_account).where.not(id: current_account.featured_tags).limit(10)
|
||||||
end
|
|
||||||
|
|
||||||
def featured_tag_ids
|
|
||||||
current_account.featured_tags.pluck(:tag_id)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,6 @@ class Api::V1::ScheduledStatusesController < Api::BaseController
|
|||||||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, except: [:update, :destroy]
|
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, except: [:update, :destroy]
|
||||||
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:update, :destroy]
|
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:update, :destroy]
|
||||||
|
|
||||||
before_action :require_user!
|
|
||||||
before_action :set_statuses, only: :index
|
before_action :set_statuses, only: :index
|
||||||
before_action :set_status, except: :index
|
before_action :set_status, except: :index
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ class Api::V1::Statuses::TranslationsController < Api::BaseController
|
|||||||
include Authorization
|
include Authorization
|
||||||
|
|
||||||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }
|
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }
|
||||||
before_action :require_user!
|
|
||||||
before_action :set_status
|
before_action :set_status
|
||||||
before_action :set_translation
|
before_action :set_translation
|
||||||
|
|
||||||
|
@ -44,13 +44,10 @@ class Api::V1::StatusesController < Api::BaseController
|
|||||||
loaded_ancestors = cache_collection(ancestors_results, Status)
|
loaded_ancestors = cache_collection(ancestors_results, Status)
|
||||||
loaded_descendants = cache_collection(descendants_results, Status)
|
loaded_descendants = cache_collection(descendants_results, Status)
|
||||||
|
|
||||||
@context = Context.new(ancestors: loaded_ancestors, descendants: loaded_descendants)
|
@context = Context.new(ancestors: loaded_ancestors, descendants: loaded_descendants)
|
||||||
statuses = [@status] + @context.ancestors + @context.descendants
|
statuses = [@status] + @context.ancestors + @context.descendants
|
||||||
account_ids = statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
|
||||||
|
|
||||||
render json: @context, serializer: REST::ContextSerializer,
|
render json: @context, serializer: REST::ContextSerializer, relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id)
|
||||||
relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id),
|
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@ -67,8 +64,7 @@ class Api::V1::StatusesController < Api::BaseController
|
|||||||
application: doorkeeper_token.application,
|
application: doorkeeper_token.application,
|
||||||
poll: status_params[:poll],
|
poll: status_params[:poll],
|
||||||
idempotency: request.headers['Idempotency-Key'],
|
idempotency: request.headers['Idempotency-Key'],
|
||||||
with_rate_limit: true,
|
with_rate_limit: true
|
||||||
quote_id: status_params[:quote_id].presence,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
|
render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
|
||||||
@ -132,7 +128,6 @@ class Api::V1::StatusesController < Api::BaseController
|
|||||||
:visibility,
|
:visibility,
|
||||||
:language,
|
:language,
|
||||||
:scheduled_at,
|
:scheduled_at,
|
||||||
:quote_id,
|
|
||||||
media_ids: [],
|
media_ids: [],
|
||||||
media_attributes: [
|
media_attributes: [
|
||||||
:id,
|
:id,
|
||||||
|
@ -6,13 +6,11 @@ class Api::V1::Timelines::HomeController < Api::BaseController
|
|||||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
|
||||||
|
|
||||||
render json: @statuses,
|
render json: @statuses,
|
||||||
each_serializer: REST::StatusSerializer,
|
each_serializer: REST::StatusSerializer,
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id),
|
|
||||||
status: account_home_feed.regenerating? ? 206 : 200
|
status: account_home_feed.regenerating? ? 206 : 200
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -9,12 +9,9 @@ class Api::V1::Timelines::ListController < Api::BaseController
|
|||||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||||
|
|
||||||
def show
|
def show
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
|
||||||
|
|
||||||
render json: @statuses,
|
render json: @statuses,
|
||||||
each_serializer: REST::StatusSerializer,
|
each_serializer: REST::StatusSerializer,
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user.account_id),
|
relationships: StatusRelationshipsPresenter.new(@statuses, current_user.account_id)
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Timelines::PublicController < Api::BaseController
|
class Api::V1::Timelines::PublicController < Api::BaseController
|
||||||
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
|
|
||||||
before_action :require_user!, only: [:show], if: :require_auth?
|
before_action :require_user!, only: [:show], if: :require_auth?
|
||||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
|
||||||
|
|
||||||
render json: @statuses, each_serializer: REST::StatusSerializer,
|
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Timelines::TagController < Api::BaseController
|
class Api::V1::Timelines::TagController < Api::BaseController
|
||||||
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
|
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, only: :show, if: :require_auth?
|
||||||
before_action :require_user!, if: :require_auth?
|
|
||||||
before_action :load_tag
|
before_action :load_tag
|
||||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
account_ids = @statuses.filter(&:quote?).map { |status| status.quote.account_id }.uniq
|
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
|
||||||
|
|
||||||
render json: @statuses, each_serializer: REST::StatusSerializer,
|
|
||||||
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
|
|
||||||
account_relationships: AccountRelationshipsPresenter.new(account_ids, current_user&.account_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -24,9 +24,6 @@ class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|||||||
session["devise.#{provider}_data"] = request.env['omniauth.auth']
|
session["devise.#{provider}_data"] = request.env['omniauth.auth']
|
||||||
redirect_to new_user_registration_url
|
redirect_to new_user_registration_url
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordInvalid
|
|
||||||
flash[:alert] = I18n.t('devise.failure.omniauth_user_creation_failure') if is_navigational_format?
|
|
||||||
redirect_to new_user_session_url
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,19 +28,29 @@ module CacheConcern
|
|||||||
response.headers['Vary'] = public_fetch_mode? ? 'Accept' : 'Accept, Signature'
|
response.headers['Vary'] = public_fetch_mode? ? 'Accept' : 'Accept, Signature'
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: Rename this method, as it does not perform any caching anymore.
|
|
||||||
def cache_collection(raw, klass)
|
def cache_collection(raw, klass)
|
||||||
return raw unless klass.respond_to?(:preload_cacheable_associations)
|
return raw unless klass.respond_to?(:with_includes)
|
||||||
|
|
||||||
records = raw.to_a
|
raw = raw.cache_ids.to_a if raw.is_a?(ActiveRecord::Relation)
|
||||||
|
return [] if raw.empty?
|
||||||
|
|
||||||
klass.preload_cacheable_associations(records)
|
cached_keys_with_value = Rails.cache.read_multi(*raw).transform_keys(&:id)
|
||||||
|
uncached_ids = raw.map(&:id) - cached_keys_with_value.keys
|
||||||
|
|
||||||
records
|
klass.reload_stale_associations!(cached_keys_with_value.values) if klass.respond_to?(:reload_stale_associations!)
|
||||||
|
|
||||||
|
unless uncached_ids.empty?
|
||||||
|
uncached = klass.where(id: uncached_ids).with_includes.index_by(&:id)
|
||||||
|
|
||||||
|
uncached.each_value do |item|
|
||||||
|
Rails.cache.write(item, item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
raw.filter_map { |item| cached_keys_with_value[item.id] || uncached[item.id] }
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: Rename this method, as it does not perform any caching anymore.
|
|
||||||
def cache_collection_paginated_by_id(raw, klass, limit, options)
|
def cache_collection_paginated_by_id(raw, klass, limit, options)
|
||||||
cache_collection raw.to_a_paginated_by_id(limit, options), klass
|
cache_collection raw.cache_ids.to_a_paginated_by_id(limit, options), klass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -16,7 +16,6 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
|
|||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
Web::PushSubscription.unsubscribe_for(params[:id], current_resource_owner)
|
Web::PushSubscription.unsubscribe_for(params[:id], current_resource_owner)
|
||||||
Doorkeeper::Application.find_by(id: params[:id])&.close_streaming_sessions(current_resource_owner)
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ class Settings::PreferencesController < Settings::BaseController
|
|||||||
:setting_trends,
|
:setting_trends,
|
||||||
:setting_crop_images,
|
:setting_crop_images,
|
||||||
:setting_always_send_emails,
|
:setting_always_send_emails,
|
||||||
:setting_place_tab_bar_at_bottom,
|
|
||||||
notification_emails: %i(follow follow_request reblog favourite mention report pending_account trending_tag appeal),
|
notification_emails: %i(follow follow_request reblog favourite mention report pending_account trending_tag appeal),
|
||||||
interactions: %i(must_be_follower must_be_following must_be_following_dm)
|
interactions: %i(must_be_follower must_be_following must_be_following_dm)
|
||||||
)
|
)
|
||||||
|
@ -20,7 +20,7 @@ module WellKnown
|
|||||||
def set_account
|
def set_account
|
||||||
username = username_from_resource
|
username = username_from_resource
|
||||||
@account = begin
|
@account = begin
|
||||||
if username == Rails.configuration.x.local_domain || username == Rails.configuration.x.web_domain
|
if username == Rails.configuration.x.local_domain
|
||||||
Account.representative
|
Account.representative
|
||||||
else
|
else
|
||||||
Account.find_local!(username)
|
Account.find_local!(username)
|
||||||
|
@ -23,7 +23,6 @@ module ContextHelper
|
|||||||
voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' },
|
voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' },
|
||||||
olm: { 'toot' => 'http://joinmastodon.org/ns#', 'Device' => 'toot:Device', 'Ed25519Signature' => 'toot:Ed25519Signature', 'Ed25519Key' => 'toot:Ed25519Key', 'Curve25519Key' => 'toot:Curve25519Key', 'EncryptedMessage' => 'toot:EncryptedMessage', 'publicKeyBase64' => 'toot:publicKeyBase64', 'deviceId' => 'toot:deviceId', 'claim' => { '@type' => '@id', '@id' => 'toot:claim' }, 'fingerprintKey' => { '@type' => '@id', '@id' => 'toot:fingerprintKey' }, 'identityKey' => { '@type' => '@id', '@id' => 'toot:identityKey' }, 'devices' => { '@type' => '@id', '@id' => 'toot:devices' }, 'messageFranking' => 'toot:messageFranking', 'messageType' => 'toot:messageType', 'cipherText' => 'toot:cipherText' },
|
olm: { 'toot' => 'http://joinmastodon.org/ns#', 'Device' => 'toot:Device', 'Ed25519Signature' => 'toot:Ed25519Signature', 'Ed25519Key' => 'toot:Ed25519Key', 'Curve25519Key' => 'toot:Curve25519Key', 'EncryptedMessage' => 'toot:EncryptedMessage', 'publicKeyBase64' => 'toot:publicKeyBase64', 'deviceId' => 'toot:deviceId', 'claim' => { '@type' => '@id', '@id' => 'toot:claim' }, 'fingerprintKey' => { '@type' => '@id', '@id' => 'toot:fingerprintKey' }, 'identityKey' => { '@type' => '@id', '@id' => 'toot:identityKey' }, 'devices' => { '@type' => '@id', '@id' => 'toot:devices' }, 'messageFranking' => 'toot:messageFranking', 'messageType' => 'toot:messageType', 'cipherText' => 'toot:cipherText' },
|
||||||
suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' },
|
suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' },
|
||||||
quoteUrl: { 'quoteUrl' => 'as:quoteUrl' },
|
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
def full_context
|
def full_context
|
||||||
|
@ -15,12 +15,7 @@ module FormattingHelper
|
|||||||
module_function :extract_status_plain_text
|
module_function :extract_status_plain_text
|
||||||
|
|
||||||
def status_content_format(status)
|
def status_content_format(status)
|
||||||
html_aware_format(
|
html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : []))
|
||||||
status.text,
|
|
||||||
status.local?,
|
|
||||||
preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : []),
|
|
||||||
quote: status.respond_to?(:quote) && status.quote,
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def rss_status_content_format(status)
|
def rss_status_content_format(status)
|
||||||
|
@ -176,19 +176,7 @@ module JsonLdHelper
|
|||||||
build_request(uri, on_behalf_of, options: request_options).perform do |response|
|
build_request(uri, on_behalf_of, options: request_options).perform do |response|
|
||||||
raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response) || !raise_on_temporary_error
|
raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response) || !raise_on_temporary_error
|
||||||
|
|
||||||
body_to_json(response.body_with_limit) if response.code == 200 && valid_activitypub_content_type?(response)
|
body_to_json(response.body_with_limit) if response.code == 200
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def valid_activitypub_content_type?(response)
|
|
||||||
return true if response.mime_type == 'application/activity+json'
|
|
||||||
|
|
||||||
# When the mime type is `application/ld+json`, we need to check the profile,
|
|
||||||
# but `http.rb` does not parse it for us.
|
|
||||||
return false unless response.mime_type == 'application/ld+json'
|
|
||||||
|
|
||||||
response.headers[HTTP::Headers::CONTENT_TYPE]&.split(';')&.map(&:strip)&.any? do |str|
|
|
||||||
str.start_with?('profile="') && str[9...-1].split.include?('https://www.w3.org/ns/activitystreams')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 588 B |
Binary file not shown.
Before Width: | Height: | Size: 735 B After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.6 KiB |
@ -1,89 +0,0 @@
|
|||||||
import { changeCompose } from '../actions/compose';
|
|
||||||
|
|
||||||
export const UTILBTNS_GOJI = 'UTILBTNS_GOJI';
|
|
||||||
export const UTILBTNS_HARUKIN = 'UTILBTNS_HARUKIN';
|
|
||||||
export const UTILBTNS_RISA = 'UTILBTNS_RISA';
|
|
||||||
|
|
||||||
export function submitGoji (textarea) {
|
|
||||||
return function (dispatch, getState) {
|
|
||||||
if (!textarea.value) {
|
|
||||||
let text = [
|
|
||||||
"#ゴジモリィィィィイイ",
|
|
||||||
":goji:"
|
|
||||||
].join("\r\n");
|
|
||||||
|
|
||||||
dispatch(submitGojiRequest());
|
|
||||||
dispatch(changeCompose(text));
|
|
||||||
|
|
||||||
textarea.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function submitGojiRequest () {
|
|
||||||
return {
|
|
||||||
type: UTILBTNS_GOJI
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function submitHarukin (textarea) {
|
|
||||||
return function (dispatch, getState) {
|
|
||||||
const HARUKINS = [":harukin: ", ":harukin_old: ", ":harukin_ika: ", ":harukin_tako: "];
|
|
||||||
const MAX = 6;
|
|
||||||
|
|
||||||
if (!textarea.value) {
|
|
||||||
let text = "";
|
|
||||||
|
|
||||||
let quantity = Math.round(Math.random() * MAX + 1);
|
|
||||||
let type = Math.round(Math.random() * (HARUKINS.length - 1));
|
|
||||||
|
|
||||||
let harukin = HARUKINS[type];
|
|
||||||
|
|
||||||
switch (quantity) {
|
|
||||||
default:
|
|
||||||
text = [
|
|
||||||
harukin.repeat(quantity),
|
|
||||||
"🔥 ".repeat(quantity)
|
|
||||||
].join("\r\n");
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MAX + 1:
|
|
||||||
text = `${harukin}💕\r\n`.repeat(6);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch(submitHarukinRequest());
|
|
||||||
dispatch(changeCompose(text));
|
|
||||||
|
|
||||||
textarea.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function submitHarukinRequest () {
|
|
||||||
return {
|
|
||||||
type: UTILBTNS_HARUKIN
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function submitRisa (textarea) {
|
|
||||||
return function (dispatch, getState) {
|
|
||||||
if (!textarea.value) {
|
|
||||||
let text = [
|
|
||||||
"@risa2 "
|
|
||||||
].join("\r\n");
|
|
||||||
|
|
||||||
dispatch(submitRisaRequest());
|
|
||||||
dispatch(changeCompose(text));
|
|
||||||
|
|
||||||
textarea.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function submitRisaRequest () {
|
|
||||||
return {
|
|
||||||
type: UTILBTNS_RISA
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,5 @@
|
|||||||
import { fetchRelationships } from './accounts';
|
|
||||||
import api, { getLinks } from '../api';
|
import api, { getLinks } from '../api';
|
||||||
import { importFetchedStatuses } from './importer';
|
import { importFetchedStatuses } from './importer';
|
||||||
import { uniq } from '../utils/uniq';
|
|
||||||
|
|
||||||
export const BOOKMARKED_STATUSES_FETCH_REQUEST = 'BOOKMARKED_STATUSES_FETCH_REQUEST';
|
export const BOOKMARKED_STATUSES_FETCH_REQUEST = 'BOOKMARKED_STATUSES_FETCH_REQUEST';
|
||||||
export const BOOKMARKED_STATUSES_FETCH_SUCCESS = 'BOOKMARKED_STATUSES_FETCH_SUCCESS';
|
export const BOOKMARKED_STATUSES_FETCH_SUCCESS = 'BOOKMARKED_STATUSES_FETCH_SUCCESS';
|
||||||
@ -22,7 +20,6 @@ export function fetchBookmarkedStatuses() {
|
|||||||
api(getState).get('/api/v1/bookmarks').then(response => {
|
api(getState).get('/api/v1/bookmarks').then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
dispatch(importFetchedStatuses(response.data));
|
dispatch(importFetchedStatuses(response.data));
|
||||||
dispatch(fetchRelationships(uniq(response.data.map(item => item.reblog ? item.reblog.account.id : item.account.id))));
|
|
||||||
dispatch(fetchBookmarkedStatusesSuccess(response.data, next ? next.uri : null));
|
dispatch(fetchBookmarkedStatusesSuccess(response.data, next ? next.uri : null));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch(fetchBookmarkedStatusesFail(error));
|
dispatch(fetchBookmarkedStatusesFail(error));
|
||||||
@ -64,7 +61,6 @@ export function expandBookmarkedStatuses() {
|
|||||||
api(getState).get(url).then(response => {
|
api(getState).get(url).then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
dispatch(importFetchedStatuses(response.data));
|
dispatch(importFetchedStatuses(response.data));
|
||||||
dispatch(fetchRelationships(uniq(response.data.map(item => item.reblog ? item.reblog.account.id : item.account.id))));
|
|
||||||
dispatch(expandBookmarkedStatusesSuccess(response.data, next ? next.uri : null));
|
dispatch(expandBookmarkedStatusesSuccess(response.data, next ? next.uri : null));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch(expandBookmarkedStatusesFail(error));
|
dispatch(expandBookmarkedStatusesFail(error));
|
||||||
|
@ -22,8 +22,6 @@ export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS';
|
|||||||
export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL';
|
export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL';
|
||||||
export const COMPOSE_REPLY = 'COMPOSE_REPLY';
|
export const COMPOSE_REPLY = 'COMPOSE_REPLY';
|
||||||
export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL';
|
export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL';
|
||||||
export const COMPOSE_QUOTE = 'COMPOSE_QUOTE';
|
|
||||||
export const COMPOSE_QUOTE_CANCEL = 'COMPOSE_QUOTE_CANCEL';
|
|
||||||
export const COMPOSE_DIRECT = 'COMPOSE_DIRECT';
|
export const COMPOSE_DIRECT = 'COMPOSE_DIRECT';
|
||||||
export const COMPOSE_MENTION = 'COMPOSE_MENTION';
|
export const COMPOSE_MENTION = 'COMPOSE_MENTION';
|
||||||
export const COMPOSE_RESET = 'COMPOSE_RESET';
|
export const COMPOSE_RESET = 'COMPOSE_RESET';
|
||||||
@ -122,23 +120,6 @@ export function cancelReplyCompose() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function quoteCompose(status, routerHistory) {
|
|
||||||
return (dispatch, getState) => {
|
|
||||||
dispatch({
|
|
||||||
type: COMPOSE_QUOTE,
|
|
||||||
status: status,
|
|
||||||
});
|
|
||||||
|
|
||||||
ensureComposeIsVisible(getState, routerHistory);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export function cancelQuoteCompose() {
|
|
||||||
return {
|
|
||||||
type: COMPOSE_QUOTE_CANCEL,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export function resetCompose() {
|
export function resetCompose() {
|
||||||
return {
|
return {
|
||||||
type: COMPOSE_RESET,
|
type: COMPOSE_RESET,
|
||||||
@ -212,7 +193,6 @@ export function submitCompose(routerHistory) {
|
|||||||
visibility: getState().getIn(['compose', 'privacy']),
|
visibility: getState().getIn(['compose', 'privacy']),
|
||||||
poll: getState().getIn(['compose', 'poll'], null),
|
poll: getState().getIn(['compose', 'poll'], null),
|
||||||
language: getState().getIn(['compose', 'language']),
|
language: getState().getIn(['compose', 'language']),
|
||||||
quote_id: getState().getIn(['compose', 'quote_from'], null),
|
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
|
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { fetchRelationships } from './accounts';
|
|
||||||
import api, { getLinks } from '../api';
|
import api, { getLinks } from '../api';
|
||||||
import { importFetchedStatuses } from './importer';
|
import { importFetchedStatuses } from './importer';
|
||||||
import { uniq } from '../utils/uniq';
|
|
||||||
|
|
||||||
export const FAVOURITED_STATUSES_FETCH_REQUEST = 'FAVOURITED_STATUSES_FETCH_REQUEST';
|
export const FAVOURITED_STATUSES_FETCH_REQUEST = 'FAVOURITED_STATUSES_FETCH_REQUEST';
|
||||||
export const FAVOURITED_STATUSES_FETCH_SUCCESS = 'FAVOURITED_STATUSES_FETCH_SUCCESS';
|
export const FAVOURITED_STATUSES_FETCH_SUCCESS = 'FAVOURITED_STATUSES_FETCH_SUCCESS';
|
||||||
@ -22,7 +20,6 @@ export function fetchFavouritedStatuses() {
|
|||||||
api(getState).get('/api/v1/favourites').then(response => {
|
api(getState).get('/api/v1/favourites').then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
dispatch(importFetchedStatuses(response.data));
|
dispatch(importFetchedStatuses(response.data));
|
||||||
dispatch(fetchRelationships(uniq(response.data.map(item => item.reblog ? item.reblog.account.id : item.account.id))));
|
|
||||||
dispatch(fetchFavouritedStatusesSuccess(response.data, next ? next.uri : null));
|
dispatch(fetchFavouritedStatusesSuccess(response.data, next ? next.uri : null));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch(fetchFavouritedStatusesFail(error));
|
dispatch(fetchFavouritedStatusesFail(error));
|
||||||
@ -67,7 +64,6 @@ export function expandFavouritedStatuses() {
|
|||||||
api(getState).get(url).then(response => {
|
api(getState).get(url).then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
dispatch(importFetchedStatuses(response.data));
|
dispatch(importFetchedStatuses(response.data));
|
||||||
dispatch(fetchRelationships(uniq(response.data.map(item => item.reblog ? item.reblog.account.id : item.account.id))));
|
|
||||||
dispatch(expandFavouritedStatusesSuccess(response.data, next ? next.uri : null));
|
dispatch(expandFavouritedStatusesSuccess(response.data, next ? next.uri : null));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch(expandFavouritedStatusesFail(error));
|
dispatch(expandFavouritedStatusesFail(error));
|
||||||
|
@ -80,10 +80,6 @@ export function importFetchedStatuses(statuses) {
|
|||||||
processStatus(status.reblog);
|
processStatus(status.reblog);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.quote && status.quote.id) {
|
|
||||||
processStatus(status.quote);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status.poll && status.poll.id) {
|
if (status.poll && status.poll.id) {
|
||||||
pushUnique(polls, normalizePoll(status.poll));
|
pushUnique(polls, normalizePoll(status.poll));
|
||||||
}
|
}
|
||||||
|
@ -75,8 +75,6 @@ export function normalizeStatus(status, normalOldStatus) {
|
|||||||
normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');
|
normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');
|
||||||
normalStatus.spoiler_text = normalOldStatus.get('spoiler_text');
|
normalStatus.spoiler_text = normalOldStatus.get('spoiler_text');
|
||||||
normalStatus.hidden = normalOldStatus.get('hidden');
|
normalStatus.hidden = normalOldStatus.get('hidden');
|
||||||
normalStatus.quote = normalOldStatus.get('quote');
|
|
||||||
normalStatus.quote_hidden = normalOldStatus.get('quote_hidden');
|
|
||||||
} else {
|
} else {
|
||||||
// If the status has a CW but no contents, treat the CW as if it were the
|
// If the status has a CW but no contents, treat the CW as if it were the
|
||||||
// status' contents, to avoid having a CW toggle with seemingly no effect.
|
// status' contents, to avoid having a CW toggle with seemingly no effect.
|
||||||
@ -93,11 +91,6 @@ export function normalizeStatus(status, normalOldStatus) {
|
|||||||
normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);
|
normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);
|
||||||
normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);
|
normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);
|
||||||
normalStatus.hidden = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive;
|
normalStatus.hidden = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive;
|
||||||
|
|
||||||
if (status.quote) {
|
|
||||||
normalStatus.quote = normalizeStatus(status.quote, null);
|
|
||||||
normalStatus.quote_hidden = normalStatus.quote.hidden;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return normalStatus;
|
return normalStatus;
|
||||||
|
@ -28,9 +28,6 @@ export const STATUS_REVEAL = 'STATUS_REVEAL';
|
|||||||
export const STATUS_HIDE = 'STATUS_HIDE';
|
export const STATUS_HIDE = 'STATUS_HIDE';
|
||||||
export const STATUS_COLLAPSE = 'STATUS_COLLAPSE';
|
export const STATUS_COLLAPSE = 'STATUS_COLLAPSE';
|
||||||
|
|
||||||
export const QUOTE_REVEAL = 'QUOTE_REVEAL';
|
|
||||||
export const QUOTE_HIDE = 'QUOTE_HIDE';
|
|
||||||
|
|
||||||
export const REDRAFT = 'REDRAFT';
|
export const REDRAFT = 'REDRAFT';
|
||||||
|
|
||||||
export const STATUS_FETCH_SOURCE_REQUEST = 'STATUS_FETCH_SOURCE_REQUEST';
|
export const STATUS_FETCH_SOURCE_REQUEST = 'STATUS_FETCH_SOURCE_REQUEST';
|
||||||
@ -350,25 +347,3 @@ export const undoStatusTranslation = id => ({
|
|||||||
type: STATUS_TRANSLATE_UNDO,
|
type: STATUS_TRANSLATE_UNDO,
|
||||||
id,
|
id,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function hideQuote(ids) {
|
|
||||||
if (!Array.isArray(ids)) {
|
|
||||||
ids = [ids];
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
type: QUOTE_HIDE,
|
|
||||||
ids,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export function revealQuote(ids) {
|
|
||||||
if (!Array.isArray(ids)) {
|
|
||||||
ids = [ids];
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
type: QUOTE_REVEAL,
|
|
||||||
ids,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { fetchRelationships } from './accounts';
|
|
||||||
import { importFetchedStatus, importFetchedStatuses } from './importer';
|
import { importFetchedStatus, importFetchedStatuses } from './importer';
|
||||||
import { submitMarkers } from './markers';
|
import { submitMarkers } from './markers';
|
||||||
import api, { getLinks } from 'mastodon/api';
|
import api, { getLinks } from 'mastodon/api';
|
||||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||||
import compareId from 'mastodon/compare_id';
|
import compareId from 'mastodon/compare_id';
|
||||||
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
|
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
|
||||||
import { uniq } from '../utils/uniq';
|
|
||||||
|
|
||||||
export const TIMELINE_UPDATE = 'TIMELINE_UPDATE';
|
export const TIMELINE_UPDATE = 'TIMELINE_UPDATE';
|
||||||
export const TIMELINE_DELETE = 'TIMELINE_DELETE';
|
export const TIMELINE_DELETE = 'TIMELINE_DELETE';
|
||||||
@ -41,7 +39,6 @@ export function updateTimeline(timeline, status, accept) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dispatch(importFetchedStatus(status));
|
dispatch(importFetchedStatus(status));
|
||||||
dispatch(fetchRelationships([status.reblog ? status.reblog.account.id : status.account.id, status.quote ? status.quote.account.id : null].filter(x => x)));
|
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: TIMELINE_UPDATE,
|
type: TIMELINE_UPDATE,
|
||||||
@ -114,7 +111,6 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) {
|
|||||||
api(getState).get(path, { params }).then(response => {
|
api(getState).get(path, { params }).then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
dispatch(importFetchedStatuses(response.data));
|
dispatch(importFetchedStatuses(response.data));
|
||||||
dispatch(fetchRelationships(uniq(response.data.map(item => [item.reblog ? item.reblog.account.id : item.account.id, item.quote ? item.quote.account.id : null]).flat().filter(x => x))));
|
|
||||||
dispatch(expandTimelineSuccess(timelineId, response.data, next ? next.uri : null, response.status === 206, isLoadingRecent, isLoadingMore, isLoadingRecent && preferPendingItems));
|
dispatch(expandTimelineSuccess(timelineId, response.data, next ? next.uri : null, response.status === 206, isLoadingRecent, isLoadingMore, isLoadingRecent && preferPendingItems));
|
||||||
|
|
||||||
if (timelineId === 'home') {
|
if (timelineId === 'home') {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const Logo = () => (
|
const Logo = () => (
|
||||||
<img src="/y-zu-logo.svg" height="32px" />
|
<svg viewBox='0 0 261 66' className='logo' role='img'>
|
||||||
|
<title>Mastodon</title>
|
||||||
|
<use xlinkHref='#logo-symbol-wordmark' />
|
||||||
|
</svg>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default Logo;
|
export default Logo;
|
||||||
|
@ -236,12 +236,10 @@ class MediaGallery extends React.PureComponent {
|
|||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
autoplay: PropTypes.bool,
|
autoplay: PropTypes.bool,
|
||||||
onToggleVisibility: PropTypes.func,
|
onToggleVisibility: PropTypes.func,
|
||||||
quote: PropTypes.bool,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
standalone: false,
|
standalone: false,
|
||||||
quote: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -312,7 +310,7 @@ class MediaGallery extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { media, intl, sensitive, height, defaultWidth, standalone, autoplay, quote } = this.props;
|
const { media, intl, sensitive, height, defaultWidth, standalone, autoplay } = this.props;
|
||||||
const { visible } = this.state;
|
const { visible } = this.state;
|
||||||
|
|
||||||
const width = this.state.width || defaultWidth;
|
const width = this.state.width || defaultWidth;
|
||||||
@ -331,10 +329,6 @@ class MediaGallery extends React.PureComponent {
|
|||||||
style.height = height;
|
style.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quote && style.height) {
|
|
||||||
style.height /= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
const size = media.take(4).size;
|
const size = media.take(4).size;
|
||||||
const uncached = media.every(attachment => attachment.get('type') === 'unknown');
|
const uncached = media.every(attachment => attachment.get('type') === 'unknown');
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Avatar from './avatar';
|
import Avatar from './avatar';
|
||||||
@ -23,29 +22,6 @@ import PictureInPicturePlaceholder from 'mastodon/components/picture_in_picture_
|
|||||||
// to use the progress bar to show download progress
|
// to use the progress bar to show download progress
|
||||||
import Bundle from '../features/ui/components/bundle';
|
import Bundle from '../features/ui/components/bundle';
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
let status = props.status;
|
|
||||||
|
|
||||||
if (status === null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
|
|
||||||
status = status.get('reblog');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status.get('quote', null) === null) {
|
|
||||||
return {
|
|
||||||
quoteMuted: !!status.get('quote_id', null),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const id = status.getIn(['quote', 'account', 'id'], null);
|
|
||||||
return {
|
|
||||||
quoteMuted: id !== null && (state.getIn(['relationships', id, 'muting']) || state.getIn(['relationships', id, 'blocking']) || state.getIn(['relationships', id, 'blocked_by']) || state.getIn(['relationships', id, 'domain_blocking']) || status.getIn(['quote', 'muted'])),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const textForScreenReader = (intl, status, rebloggedByText = false) => {
|
export const textForScreenReader = (intl, status, rebloggedByText = false) => {
|
||||||
const displayName = status.getIn(['account', 'display_name']);
|
const displayName = status.getIn(['account', 'display_name']);
|
||||||
|
|
||||||
@ -83,61 +59,7 @@ const messages = defineMessages({
|
|||||||
edited: { id: 'status.edited', defaultMessage: 'Edited {date}' },
|
edited: { id: 'status.edited', defaultMessage: 'Edited {date}' },
|
||||||
});
|
});
|
||||||
|
|
||||||
export const quote = (status, muted, quoteMuted, handleQuoteClick, handleExpandedQuoteToggle, identity, media, router, contextType = 'home') => {
|
export default @injectIntl
|
||||||
const quoteStatus = status.get('quote', null);
|
|
||||||
|
|
||||||
if (!quoteStatus) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const quoteInner = (() => {
|
|
||||||
const hideUnlisted = quoteStatus.get('visibility') === 'unlisted'
|
|
||||||
&& ['public', 'community', 'hashtag'].includes(contextType);
|
|
||||||
if (quoteMuted || hideUnlisted) {
|
|
||||||
const content = (() => {
|
|
||||||
if (quoteMuted) {
|
|
||||||
return (
|
|
||||||
<FormattedMessage id='status.muted_quote' defaultMessage='Muted quote' />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button onClick={handleQuoteClick}>
|
|
||||||
<FormattedMessage id='status.unlisted_quote' defaultMessage='Unlisted quote' />
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
})();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classNames('status__content', { 'muted-quote': quoteMuted, 'unlisted-quote': hideUnlisted, 'status__content--with-action': router })}>
|
|
||||||
{content}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className='status__info'>
|
|
||||||
{identity(quoteStatus, null, null, true)}
|
|
||||||
</div>
|
|
||||||
<StatusContent status={quoteStatus} onClick={handleQuoteClick} expanded={!status.get('quote_hidden')} onExpandedToggle={handleExpandedQuoteToggle} quote />
|
|
||||||
{media(quoteStatus, true)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={classNames('quote-status', `status-${quoteStatus.get('visibility')}`, { muted: muted })}
|
|
||||||
data-id={quoteStatus.get('id')}
|
|
||||||
dataurl={quoteStatus.get('url')}
|
|
||||||
>
|
|
||||||
{quoteInner}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default @connect(mapStateToProps) @injectIntl
|
|
||||||
class Status extends ImmutablePureComponent {
|
class Status extends ImmutablePureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@ -165,9 +87,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
onToggleCollapsed: PropTypes.func,
|
onToggleCollapsed: PropTypes.func,
|
||||||
onTranslate: PropTypes.func,
|
onTranslate: PropTypes.func,
|
||||||
onInteractionModal: PropTypes.func,
|
onInteractionModal: PropTypes.func,
|
||||||
onQuoteToggleHidden: PropTypes.func,
|
|
||||||
muted: PropTypes.bool,
|
muted: PropTypes.bool,
|
||||||
quoteMuted: PropTypes.bool,
|
|
||||||
hidden: PropTypes.bool,
|
hidden: PropTypes.bool,
|
||||||
unread: PropTypes.bool,
|
unread: PropTypes.bool,
|
||||||
onMoveUp: PropTypes.func,
|
onMoveUp: PropTypes.func,
|
||||||
@ -183,7 +103,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
inUse: PropTypes.bool,
|
inUse: PropTypes.bool,
|
||||||
available: PropTypes.bool,
|
available: PropTypes.bool,
|
||||||
}),
|
}),
|
||||||
contextType: PropTypes.string,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Avoid checking props that are functions (and whose equality will always
|
// Avoid checking props that are functions (and whose equality will always
|
||||||
@ -195,12 +114,10 @@ class Status extends ImmutablePureComponent {
|
|||||||
'hidden',
|
'hidden',
|
||||||
'unread',
|
'unread',
|
||||||
'pictureInPicture',
|
'pictureInPicture',
|
||||||
'quoteMuted',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
showMedia: defaultMediaVisibility(this.props.status),
|
showMedia: defaultMediaVisibility(this.props.status),
|
||||||
showQuoteMedia: defaultMediaVisibility(this.props.status ? this.props.status.get('quote', null) : null),
|
|
||||||
statusId: undefined,
|
statusId: undefined,
|
||||||
forceFilter: undefined,
|
forceFilter: undefined,
|
||||||
};
|
};
|
||||||
@ -209,7 +126,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
|
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
|
||||||
return {
|
return {
|
||||||
showMedia: defaultMediaVisibility(nextProps.status),
|
showMedia: defaultMediaVisibility(nextProps.status),
|
||||||
showQuoteMedia: defaultMediaVisibility(nextProps.status ? nextProps.status.get('quote', null) : null),
|
|
||||||
statusId: nextProps.status.get('id'),
|
statusId: nextProps.status.get('id'),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@ -221,10 +137,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
this.setState({ showMedia: !this.state.showMedia });
|
this.setState({ showMedia: !this.state.showMedia });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleToggleQuoteMediaVisibility = () => {
|
|
||||||
this.setState({ showQuoteMedia: !this.state.showQuoteMedia });
|
|
||||||
}
|
|
||||||
|
|
||||||
handleClick = e => {
|
handleClick = e => {
|
||||||
if (e && (e.button !== 0 || e.ctrlKey || e.metaKey)) {
|
if (e && (e.button !== 0 || e.ctrlKey || e.metaKey)) {
|
||||||
return;
|
return;
|
||||||
@ -253,15 +165,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
this._openProfile(proper);
|
this._openProfile(proper);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleQuoteClick = () => {
|
|
||||||
if (!this.context.router) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { status } = this.props;
|
|
||||||
this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'quote', 'id'], status.getIn(['quote', 'id']))}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleExpandedToggle = () => {
|
handleExpandedToggle = () => {
|
||||||
this.props.onToggleHidden(this._properStatus());
|
this.props.onToggleHidden(this._properStatus());
|
||||||
};
|
};
|
||||||
@ -274,10 +177,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
this.props.onTranslate(this._properStatus());
|
this.props.onTranslate(this._properStatus());
|
||||||
};
|
};
|
||||||
|
|
||||||
handleExpandedQuoteToggle = () => {
|
|
||||||
this.props.onQuoteToggleHidden(this._properStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
renderLoadingMediaGallery () {
|
renderLoadingMediaGallery () {
|
||||||
return <div className='media-gallery' style={{ height: '110px' }} />;
|
return <div className='media-gallery' style={{ height: '110px' }} />;
|
||||||
}
|
}
|
||||||
@ -410,9 +309,10 @@ class Status extends ImmutablePureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let prepend, rebloggedByText;
|
let media = null;
|
||||||
|
let statusAvatar, prepend, rebloggedByText;
|
||||||
|
|
||||||
const { intl, hidden, featured, unread, showThread, scrollKey, pictureInPicture, quoteMuted, contextType } = this.props;
|
const { intl, hidden, featured, unread, showThread, scrollKey, pictureInPicture } = this.props;
|
||||||
|
|
||||||
let { status, account, ...other } = this.props;
|
let { status, account, ...other } = this.props;
|
||||||
|
|
||||||
@ -497,123 +397,103 @@ class Status extends ImmutablePureComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const media = (status, quote = false) => {
|
if (pictureInPicture.get('inUse')) {
|
||||||
if (pictureInPicture.get('inUse')) {
|
media = <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
|
||||||
return <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
|
} else if (status.get('media_attachments').size > 0) {
|
||||||
} else if (status.get('media_attachments').size > 0) {
|
if (this.props.muted) {
|
||||||
if (this.props.muted) {
|
media = (
|
||||||
return (
|
<AttachmentList
|
||||||
<AttachmentList
|
|
||||||
compact
|
|
||||||
media={status.get('media_attachments')}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
} else if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
|
|
||||||
const attachment = status.getIn(['media_attachments', 0]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Bundle fetchComponent={Audio} loading={this.renderLoadingAudioPlayer}>
|
|
||||||
{Component => (
|
|
||||||
<Component
|
|
||||||
src={attachment.get('url')}
|
|
||||||
alt={attachment.get('description')}
|
|
||||||
poster={attachment.get('preview_url') || status.getIn(['account', 'avatar_static'])}
|
|
||||||
backgroundColor={attachment.getIn(['meta', 'colors', 'background'])}
|
|
||||||
foregroundColor={attachment.getIn(['meta', 'colors', 'foreground'])}
|
|
||||||
accentColor={attachment.getIn(['meta', 'colors', 'accent'])}
|
|
||||||
duration={attachment.getIn(['meta', 'original', 'duration'], 0)}
|
|
||||||
width={this.props.cachedMediaWidth}
|
|
||||||
height={110}
|
|
||||||
cacheWidth={this.props.cacheMediaWidth}
|
|
||||||
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
blurhash={attachment.get('blurhash')}
|
|
||||||
visible={this.state.showMedia}
|
|
||||||
onToggleVisibility={this.handleToggleMediaVisibility}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Bundle>
|
|
||||||
);
|
|
||||||
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
|
||||||
const attachment = status.getIn(['media_attachments', 0]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Bundle fetchComponent={Video} loading={this.renderLoadingVideoPlayer}>
|
|
||||||
{Component => (
|
|
||||||
<Component
|
|
||||||
preview={attachment.get('preview_url')}
|
|
||||||
frameRate={attachment.getIn(['meta', 'original', 'frame_rate'])}
|
|
||||||
blurhash={attachment.get('blurhash')}
|
|
||||||
src={attachment.get('url')}
|
|
||||||
alt={attachment.get('description')}
|
|
||||||
width={this.props.cachedMediaWidth}
|
|
||||||
height={110}
|
|
||||||
inline
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
onOpenVideo={this.handleOpenVideo}
|
|
||||||
cacheWidth={this.props.cacheMediaWidth}
|
|
||||||
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
|
|
||||||
visible={quote ? this.state.showQuoteMedia : this.state.showMedia}
|
|
||||||
onToggleVisibility={quote ? this.handleToggleQuoteMediaVisibility : this.handleToggleMediaVisibility}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Bundle>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<Bundle fetchComponent={MediaGallery} loading={this.renderLoadingMediaGallery}>
|
|
||||||
{Component => (
|
|
||||||
<Component
|
|
||||||
media={status.get('media_attachments')}
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
height={110}
|
|
||||||
onOpenMedia={this.handleOpenMedia}
|
|
||||||
cacheWidth={this.props.cacheMediaWidth}
|
|
||||||
defaultWidth={this.props.cachedMediaWidth}
|
|
||||||
visible={quote ? this.state.showQuoteMedia : this.state.showMedia}
|
|
||||||
onToggleVisibility={quote ? this.handleToggleQuoteMediaVisibility : this.handleToggleMediaVisibility}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Bundle>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else if (status.get('spoiler_text').length === 0 && status.get('card') && !this.props.muted) {
|
|
||||||
return (
|
|
||||||
<Card
|
|
||||||
onOpenMedia={this.handleOpenMedia}
|
|
||||||
card={status.get('card')}
|
|
||||||
compact
|
compact
|
||||||
cacheWidth={this.props.cacheMediaWidth}
|
media={status.get('media_attachments')}
|
||||||
defaultWidth={this.props.cachedMediaWidth}
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
} else if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
|
||||||
|
const attachment = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
return null;
|
media = (
|
||||||
};
|
<Bundle fetchComponent={Audio} loading={this.renderLoadingAudioPlayer} >
|
||||||
|
{Component => (
|
||||||
|
<Component
|
||||||
|
src={attachment.get('url')}
|
||||||
|
alt={attachment.get('description')}
|
||||||
|
poster={attachment.get('preview_url') || status.getIn(['account', 'avatar_static'])}
|
||||||
|
backgroundColor={attachment.getIn(['meta', 'colors', 'background'])}
|
||||||
|
foregroundColor={attachment.getIn(['meta', 'colors', 'foreground'])}
|
||||||
|
accentColor={attachment.getIn(['meta', 'colors', 'accent'])}
|
||||||
|
duration={attachment.getIn(['meta', 'original', 'duration'], 0)}
|
||||||
|
width={this.props.cachedMediaWidth}
|
||||||
|
height={110}
|
||||||
|
cacheWidth={this.props.cacheMediaWidth}
|
||||||
|
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
blurhash={attachment.get('blurhash')}
|
||||||
|
visible={this.state.showMedia}
|
||||||
|
onToggleVisibility={this.handleToggleMediaVisibility}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Bundle>
|
||||||
|
);
|
||||||
|
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
|
const attachment = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
const statusAvatar = (status, account) => {
|
media = (
|
||||||
if (account === undefined || account === null) {
|
<Bundle fetchComponent={Video} loading={this.renderLoadingVideoPlayer} >
|
||||||
return <Avatar account={status.get('account')} size={46} />;
|
{Component => (
|
||||||
|
<Component
|
||||||
|
preview={attachment.get('preview_url')}
|
||||||
|
frameRate={attachment.getIn(['meta', 'original', 'frame_rate'])}
|
||||||
|
blurhash={attachment.get('blurhash')}
|
||||||
|
src={attachment.get('url')}
|
||||||
|
alt={attachment.get('description')}
|
||||||
|
width={this.props.cachedMediaWidth}
|
||||||
|
height={110}
|
||||||
|
inline
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
onOpenVideo={this.handleOpenVideo}
|
||||||
|
cacheWidth={this.props.cacheMediaWidth}
|
||||||
|
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
|
||||||
|
visible={this.state.showMedia}
|
||||||
|
onToggleVisibility={this.handleToggleMediaVisibility}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Bundle>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return <AvatarOverlay account={status.get('account')} friend={account} />;
|
media = (
|
||||||
|
<Bundle fetchComponent={MediaGallery} loading={this.renderLoadingMediaGallery}>
|
||||||
|
{Component => (
|
||||||
|
<Component
|
||||||
|
media={status.get('media_attachments')}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
height={110}
|
||||||
|
onOpenMedia={this.handleOpenMedia}
|
||||||
|
cacheWidth={this.props.cacheMediaWidth}
|
||||||
|
defaultWidth={this.props.cachedMediaWidth}
|
||||||
|
visible={this.state.showMedia}
|
||||||
|
onToggleVisibility={this.handleToggleMediaVisibility}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Bundle>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
} else if (status.get('spoiler_text').length === 0 && status.get('card') && !this.props.muted) {
|
||||||
|
media = (
|
||||||
|
<Card
|
||||||
|
onOpenMedia={this.handleOpenMedia}
|
||||||
|
card={status.get('card')}
|
||||||
|
compact
|
||||||
|
cacheWidth={this.props.cacheMediaWidth}
|
||||||
|
defaultWidth={this.props.cachedMediaWidth}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const identity = (status, account) => (
|
if (account === undefined || account === null) {
|
||||||
<a onClick={this.handleAccountClick} href={`/@${status.getIn(['account', 'acct'])}`} title={status.getIn(['account', 'acct'])} className='status__display-name' target='_blank' rel='noopener noreferrer'>
|
statusAvatar = <Avatar account={status.get('account')} size={46} />;
|
||||||
<div className='status__avatar'>
|
} else {
|
||||||
{statusAvatar(status, account)}
|
statusAvatar = <AvatarOverlay account={status.get('account')} friend={account} />;
|
||||||
</div>
|
}
|
||||||
|
|
||||||
<DisplayName account={status.get('account')} />
|
|
||||||
</a>
|
|
||||||
);
|
|
||||||
|
|
||||||
const visibilityIconInfo = {
|
const visibilityIconInfo = {
|
||||||
'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) },
|
'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) },
|
||||||
@ -636,7 +516,13 @@ class Status extends ImmutablePureComponent {
|
|||||||
<RelativeTimestamp timestamp={status.get('created_at')} />{status.get('edited_at') && <abbr title={intl.formatMessage(messages.edited, { date: intl.formatDate(status.get('edited_at'), { hour12: false, year: 'numeric', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }) })}> *</abbr>}
|
<RelativeTimestamp timestamp={status.get('created_at')} />{status.get('edited_at') && <abbr title={intl.formatMessage(messages.edited, { date: intl.formatDate(status.get('edited_at'), { hour12: false, year: 'numeric', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }) })}> *</abbr>}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{identity(status, account, false)}
|
<a onClick={this.handleAccountClick} href={`/@${status.getIn(['account', 'acct'])}`} title={status.getIn(['account', 'acct'])} className='status__display-name' target='_blank' rel='noopener noreferrer'>
|
||||||
|
<div className='status__avatar'>
|
||||||
|
{statusAvatar}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DisplayName account={status.get('account')} />
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<StatusContent
|
<StatusContent
|
||||||
@ -649,9 +535,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
onCollapsedToggle={this.handleCollapsedToggle}
|
onCollapsedToggle={this.handleCollapsedToggle}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{media(status)}
|
{media}
|
||||||
|
|
||||||
{quote(status, this.props.muted, quoteMuted, this.handleQuoteClick, this.handleExpandedQuoteToggle, identity, media, this.context.router, contextType)}
|
|
||||||
|
|
||||||
<StatusActionBar scrollKey={scrollKey} status={status} account={account} onFilter={matchedFilters ? this.handleFilterClick : null} {...other} />
|
<StatusActionBar scrollKey={scrollKey} status={status} account={account} onFilter={matchedFilters ? this.handleFilterClick : null} {...other} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,8 +26,6 @@ const messages = defineMessages({
|
|||||||
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
||||||
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
||||||
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
||||||
quote: { id: 'status.quote', defaultMessage: 'Quote' },
|
|
||||||
cannot_quote: { id: 'status.cannot_quote', defaultMessage: 'This post cannot be quoted' },
|
|
||||||
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
||||||
bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },
|
bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },
|
||||||
removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' },
|
removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' },
|
||||||
@ -70,7 +68,6 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
onReply: PropTypes.func,
|
onReply: PropTypes.func,
|
||||||
onFavourite: PropTypes.func,
|
onFavourite: PropTypes.func,
|
||||||
onReblog: PropTypes.func,
|
onReblog: PropTypes.func,
|
||||||
onQuote: PropTypes.func,
|
|
||||||
onDelete: PropTypes.func,
|
onDelete: PropTypes.func,
|
||||||
onDirect: PropTypes.func,
|
onDirect: PropTypes.func,
|
||||||
onMention: PropTypes.func,
|
onMention: PropTypes.func,
|
||||||
@ -141,10 +138,6 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleQuoteClick = () => {
|
|
||||||
this.props.onQuote(this.props.status, this.context.router.history);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleBookmarkClick = () => {
|
handleBookmarkClick = () => {
|
||||||
this.props.onBookmark(this.props.status);
|
this.props.onBookmark(this.props.status);
|
||||||
};
|
};
|
||||||
@ -238,14 +231,6 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
this.props.onFilter();
|
this.props.onFilter();
|
||||||
};
|
};
|
||||||
|
|
||||||
static quoteTitle = (intl, messages, publicStatus) => {
|
|
||||||
if (publicStatus) {
|
|
||||||
return intl.formatMessage(messages.quote);
|
|
||||||
} else {
|
|
||||||
return intl.formatMessage(messages.cannot_quote);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { status, relationship, intl, withDismiss, withCounters, scrollKey } = this.props;
|
const { status, relationship, intl, withDismiss, withCounters, scrollKey } = this.props;
|
||||||
const { signedIn, permissions } = this.context.identity;
|
const { signedIn, permissions } = this.context.identity;
|
||||||
@ -376,8 +361,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
<div className='status__action-bar'>
|
<div className='status__action-bar'>
|
||||||
<IconButton className='status__action-bar__button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} obfuscateCount />
|
<IconButton className='status__action-bar__button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} obfuscateCount />
|
||||||
<IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} />
|
<IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} />
|
||||||
<IconButton className='status__action-bar__button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} />
|
<IconButton className='status__action-bar__button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} />
|
||||||
<IconButton className='status__action-bar__button' disabled={!publicStatus} title={StatusActionBar.quoteTitle(intl, messages, publicStatus)} icon='quote-right' onClick={this.handleQuoteClick} />
|
|
||||||
<IconButton className='status__action-bar__button bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} />
|
<IconButton className='status__action-bar__button bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} />
|
||||||
|
|
||||||
{shareButton}
|
{shareButton}
|
||||||
|
@ -9,7 +9,6 @@ import Icon from 'mastodon/components/icon';
|
|||||||
import { autoPlayGif, languages as preloadedLanguages, translationEnabled } from 'mastodon/initial_state';
|
import { autoPlayGif, languages as preloadedLanguages, translationEnabled } from 'mastodon/initial_state';
|
||||||
|
|
||||||
const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top)
|
const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top)
|
||||||
const QUOTE_MAX_HEIGHT = 112; // 22px * 5 (+ 2px padding at the top)
|
|
||||||
|
|
||||||
class TranslateButton extends React.PureComponent {
|
class TranslateButton extends React.PureComponent {
|
||||||
|
|
||||||
@ -65,7 +64,6 @@ class StatusContent extends React.PureComponent {
|
|||||||
collapsable: PropTypes.bool,
|
collapsable: PropTypes.bool,
|
||||||
onCollapsedToggle: PropTypes.func,
|
onCollapsedToggle: PropTypes.func,
|
||||||
intl: PropTypes.object,
|
intl: PropTypes.object,
|
||||||
quote: PropTypes.bool,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -109,12 +107,12 @@ class StatusContent extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (status.get('collapsed', null) === null && onCollapsedToggle) {
|
if (status.get('collapsed', null) === null && onCollapsedToggle) {
|
||||||
const { collapsable, onClick, quote } = this.props;
|
const { collapsable, onClick } = this.props;
|
||||||
|
|
||||||
const collapsed =
|
const collapsed =
|
||||||
collapsable
|
collapsable
|
||||||
&& onClick
|
&& onClick
|
||||||
&& node.clientHeight > (quote ? QUOTE_MAX_HEIGHT : MAX_HEIGHT)
|
&& node.clientHeight > MAX_HEIGHT
|
||||||
&& status.get('spoiler_text').length === 0;
|
&& status.get('spoiler_text').length === 0;
|
||||||
|
|
||||||
onCollapsedToggle(collapsed);
|
onCollapsedToggle(collapsed);
|
||||||
@ -218,7 +216,7 @@ class StatusContent extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { status, intl, quote } = this.props;
|
const { status, intl } = this.props;
|
||||||
|
|
||||||
const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
|
const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
|
||||||
const renderReadMore = this.props.onClick && status.get('collapsed');
|
const renderReadMore = this.props.onClick && status.get('collapsed');
|
||||||
@ -247,12 +245,6 @@ class StatusContent extends React.PureComponent {
|
|||||||
<PollContainer pollId={status.get('poll')} />
|
<PollContainer pollId={status.get('poll')} />
|
||||||
);
|
);
|
||||||
|
|
||||||
if (quote) {
|
|
||||||
const doc = new DOMParser().parseFromString(content.__html, 'text/html').documentElement;
|
|
||||||
Array.from(doc.querySelectorAll('br')).forEach(nl => nl.replaceWith(' '));
|
|
||||||
content.__html = doc.outerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status.get('spoiler_text').length > 0) {
|
if (status.get('spoiler_text').length > 0) {
|
||||||
let mentionsPlaceholder = '';
|
let mentionsPlaceholder = '';
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import Status from '../components/status';
|
|||||||
import { makeGetStatus, makeGetPictureInPicture } from '../selectors';
|
import { makeGetStatus, makeGetPictureInPicture } from '../selectors';
|
||||||
import {
|
import {
|
||||||
replyCompose,
|
replyCompose,
|
||||||
quoteCompose,
|
|
||||||
mentionCompose,
|
mentionCompose,
|
||||||
directCompose,
|
directCompose,
|
||||||
} from '../actions/compose';
|
} from '../actions/compose';
|
||||||
@ -28,8 +27,6 @@ import {
|
|||||||
editStatus,
|
editStatus,
|
||||||
translateStatus,
|
translateStatus,
|
||||||
undoStatusTranslation,
|
undoStatusTranslation,
|
||||||
hideQuote,
|
|
||||||
revealQuote,
|
|
||||||
} from '../actions/statuses';
|
} from '../actions/statuses';
|
||||||
import {
|
import {
|
||||||
unmuteAccount,
|
unmuteAccount,
|
||||||
@ -61,8 +58,6 @@ const messages = defineMessages({
|
|||||||
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
||||||
editConfirm: { id: 'confirmations.edit.confirm', defaultMessage: 'Edit' },
|
editConfirm: { id: 'confirmations.edit.confirm', defaultMessage: 'Edit' },
|
||||||
editMessage: { id: 'confirmations.edit.message', defaultMessage: 'Editing now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
editMessage: { id: 'confirmations.edit.message', defaultMessage: 'Editing now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
||||||
quoteConfirm: { id: 'confirmations.quote.confirm', defaultMessage: 'Quote' },
|
|
||||||
quoteMessage: { id: 'confirmations.quote.message', defaultMessage: 'Quoting now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
|
||||||
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
|
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -112,22 +107,6 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onQuote (status, router) {
|
|
||||||
dispatch((_, getState) => {
|
|
||||||
let state = getState();
|
|
||||||
|
|
||||||
if (state.getIn(['compose', 'text']).trim().length !== 0) {
|
|
||||||
dispatch(openModal('CONFIRM', {
|
|
||||||
message: intl.formatMessage(messages.quoteMessage),
|
|
||||||
confirm: intl.formatMessage(messages.quoteConfirm),
|
|
||||||
onConfirm: () => dispatch(quoteCompose(status, router)),
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
dispatch(quoteCompose(status, router));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onFavourite (status) {
|
onFavourite (status) {
|
||||||
if (status.get('favourited')) {
|
if (status.get('favourited')) {
|
||||||
dispatch(unfavourite(status));
|
dispatch(unfavourite(status));
|
||||||
@ -255,14 +234,6 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
|
|||||||
dispatch(toggleStatusCollapse(status.get('id'), isCollapsed));
|
dispatch(toggleStatusCollapse(status.get('id'), isCollapsed));
|
||||||
},
|
},
|
||||||
|
|
||||||
onQuoteToggleHidden (status) {
|
|
||||||
if (status.get('quote_hidden')) {
|
|
||||||
dispatch(revealQuote(status.get('id')));
|
|
||||||
} else {
|
|
||||||
dispatch(hideQuote(status.get('id')));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onBlockDomain (domain) {
|
onBlockDomain (domain) {
|
||||||
dispatch(openModal('CONFIRM', {
|
dispatch(openModal('CONFIRM', {
|
||||||
message: <FormattedMessage id='confirmations.domain_block.message' defaultMessage='Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications. Your followers from that domain will be removed.' values={{ domain: <strong>{domain}</strong> }} />,
|
message: <FormattedMessage id='confirmations.domain_block.message' defaultMessage='Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications. Your followers from that domain will be removed.' values={{ domain: <strong>{domain}</strong> }} />,
|
||||||
|
@ -50,7 +50,6 @@ class Audio extends React.PureComponent {
|
|||||||
volume: PropTypes.number,
|
volume: PropTypes.number,
|
||||||
muted: PropTypes.bool,
|
muted: PropTypes.bool,
|
||||||
deployPictureInPicture: PropTypes.func,
|
deployPictureInPicture: PropTypes.func,
|
||||||
quote: PropTypes.bool,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -95,11 +94,7 @@ class Audio extends React.PureComponent {
|
|||||||
|
|
||||||
_setDimensions () {
|
_setDimensions () {
|
||||||
const width = this.player.offsetWidth;
|
const width = this.player.offsetWidth;
|
||||||
let height = this.props.fullscreen ? this.player.offsetHeight : (width / (16/9));
|
const height = this.props.fullscreen ? this.player.offsetHeight : (width / (16/9));
|
||||||
|
|
||||||
if (this.props.quote) {
|
|
||||||
height /= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.props.cacheWidth) {
|
if (this.props.cacheWidth) {
|
||||||
this.props.cacheWidth(width);
|
this.props.cacheWidth(width);
|
||||||
|
@ -29,9 +29,6 @@ const messages = defineMessages({
|
|||||||
publish: { id: 'compose_form.publish', defaultMessage: 'Publish' },
|
publish: { id: 'compose_form.publish', defaultMessage: 'Publish' },
|
||||||
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
|
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
|
||||||
saveChanges: { id: 'compose_form.save_changes', defaultMessage: 'Save changes' },
|
saveChanges: { id: 'compose_form.save_changes', defaultMessage: 'Save changes' },
|
||||||
utilBtns_goji: { id: 'compose_form.utilBtns_goji', defaultMessage: 'Typo!!!' },
|
|
||||||
utilBtns_harukin: { id: 'compose_form.utilBtns_harukin', defaultMessage: 'Burn Harukin' },
|
|
||||||
utilBtns_risa: { id: 'compose_form.utilBtns_risa', defaultMessage: 'Risa' }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default @injectIntl
|
export default @injectIntl
|
||||||
@ -68,9 +65,6 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
isInReply: PropTypes.bool,
|
isInReply: PropTypes.bool,
|
||||||
singleColumn: PropTypes.bool,
|
singleColumn: PropTypes.bool,
|
||||||
lang: PropTypes.string,
|
lang: PropTypes.string,
|
||||||
onGojiSubmit: PropTypes.func.isRequired,
|
|
||||||
onHarukinSubmit: PropTypes.func.isRequired,
|
|
||||||
onRisaSubmit: PropTypes.func.isRequired,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -96,7 +90,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
const fulltext = this.getFulltextForCharacterCounting();
|
const fulltext = this.getFulltextForCharacterCounting();
|
||||||
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
||||||
|
|
||||||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 2048 || (isOnlyWhitespace && !anyMedia));
|
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSubmit = (e) => {
|
handleSubmit = (e) => {
|
||||||
@ -212,10 +206,6 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
this.props.onPickEmoji(position, data, needsSpace);
|
this.props.onPickEmoji(position, data, needsSpace);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleOnGojiSubmit = () => this.props.onGojiSubmit(this.autosuggestTextarea.textarea);
|
|
||||||
handleOnHarukinSubmit = () => this.props.onHarukinSubmit(this.autosuggestTextarea.textarea);
|
|
||||||
handleOnRisaSubmit = () => this.props.onRisaSubmit(this.autosuggestTextarea.textarea);
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, onPaste, autoFocus } = this.props;
|
const { intl, onPaste, autoFocus } = this.props;
|
||||||
const disabled = this.props.isSubmitting;
|
const disabled = this.props.isSubmitting;
|
||||||
@ -235,7 +225,6 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
<WarningContainer />
|
<WarningContainer />
|
||||||
|
|
||||||
<ReplyIndicatorContainer />
|
<ReplyIndicatorContainer />
|
||||||
<ReplyIndicatorContainer quote />
|
|
||||||
|
|
||||||
<div className={`spoiler-input ${this.props.spoiler ? 'spoiler-input--visible' : ''}`} ref={this.setRef} aria-hidden={!this.props.spoiler}>
|
<div className={`spoiler-input ${this.props.spoiler ? 'spoiler-input--visible' : ''}`} ref={this.setRef} aria-hidden={!this.props.spoiler}>
|
||||||
<AutosuggestInput
|
<AutosuggestInput
|
||||||
@ -291,13 +280,12 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='character-counter__wrapper'>
|
<div className='character-counter__wrapper'>
|
||||||
<CharacterCounter max={2048} text={this.getFulltextForCharacterCounting()} />
|
<CharacterCounter max={500} text={this.getFulltextForCharacterCounting()} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='compose-form__publish'>
|
<div className='compose-form__publish'>
|
||||||
<div className='compose-form__publish-button-wrapper'>
|
<div className='compose-form__publish-button-wrapper'>
|
||||||
<Button className="compose-form__utilBtns-risa" text={intl.formatMessage(messages.utilBtns_risa)} onClick={this.handleOnRisaSubmit} block />
|
|
||||||
<Button
|
<Button
|
||||||
type='submit'
|
type='submit'
|
||||||
text={publishText}
|
text={publishText}
|
||||||
@ -306,10 +294,6 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="compose-form__utilBtns">
|
|
||||||
<Button className="compose-form__utilBtns-goji" text={intl.formatMessage(messages.utilBtns_goji)} onClick={this.handleOnGojiSubmit} block />
|
|
||||||
<Button className="compose-form__utilBtns-harukin" text={intl.formatMessage(messages.utilBtns_harukin)} onClick={this.handleOnHarukinSubmit} block />
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import IconButton from '../../../components/icon_button';
|
|||||||
import DisplayName from '../../../components/display_name';
|
import DisplayName from '../../../components/display_name';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import classNames from 'classnames';
|
|
||||||
import AttachmentList from 'mastodon/components/attachment_list';
|
import AttachmentList from 'mastodon/components/attachment_list';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
@ -24,7 +23,6 @@ class ReplyIndicator extends ImmutablePureComponent {
|
|||||||
status: ImmutablePropTypes.map,
|
status: ImmutablePropTypes.map,
|
||||||
onCancel: PropTypes.func.isRequired,
|
onCancel: PropTypes.func.isRequired,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
quote: PropTypes.bool,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
handleClick = () => {
|
handleClick = () => {
|
||||||
@ -39,7 +37,7 @@ class ReplyIndicator extends ImmutablePureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { status, intl, quote } = this.props;
|
const { status, intl } = this.props;
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
return null;
|
return null;
|
||||||
@ -48,7 +46,7 @@ class ReplyIndicator extends ImmutablePureComponent {
|
|||||||
const content = { __html: status.get('contentHtml') };
|
const content = { __html: status.get('contentHtml') };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames('reply-indicator', { 'quote-indicator': quote })}>
|
<div className='reply-indicator'>
|
||||||
<div className='reply-indicator__header'>
|
<div className='reply-indicator__header'>
|
||||||
<div className='reply-indicator__cancel'><IconButton title={intl.formatMessage(messages.cancel)} icon='times' onClick={this.handleClick} inverted /></div>
|
<div className='reply-indicator__cancel'><IconButton title={intl.formatMessage(messages.cancel)} icon='times' onClick={this.handleClick} inverted /></div>
|
||||||
|
|
||||||
|
@ -10,11 +10,6 @@ import {
|
|||||||
insertEmojiCompose,
|
insertEmojiCompose,
|
||||||
uploadCompose,
|
uploadCompose,
|
||||||
} from '../../../actions/compose';
|
} from '../../../actions/compose';
|
||||||
import {
|
|
||||||
submitGoji,
|
|
||||||
submitHarukin,
|
|
||||||
submitRisa
|
|
||||||
} from '../../../actions/UtilBtns';
|
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
text: state.getIn(['compose', 'text']),
|
text: state.getIn(['compose', 'text']),
|
||||||
@ -68,18 +63,6 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
dispatch(insertEmojiCompose(position, data, needsSpace));
|
dispatch(insertEmojiCompose(position, data, needsSpace));
|
||||||
},
|
},
|
||||||
|
|
||||||
onRisaSubmit (textarea) {
|
|
||||||
dispatch(submitRisa(textarea));
|
|
||||||
},
|
|
||||||
|
|
||||||
onGojiSubmit (textarea) {
|
|
||||||
dispatch(submitGoji(textarea));
|
|
||||||
},
|
|
||||||
|
|
||||||
onHarukinSubmit (textarea) {
|
|
||||||
dispatch(submitHarukin(textarea));
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);
|
export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { cancelReplyCompose, cancelQuoteCompose } from '../../../actions/compose';
|
import { cancelReplyCompose } from '../../../actions/compose';
|
||||||
import { makeGetStatus } from '../../../selectors';
|
import { makeGetStatus } from '../../../selectors';
|
||||||
import ReplyIndicator from '../components/reply_indicator';
|
import ReplyIndicator from '../components/reply_indicator';
|
||||||
|
|
||||||
const makeMapStateToProps = () => {
|
const makeMapStateToProps = () => {
|
||||||
const getStatus = makeGetStatus();
|
const getStatus = makeGetStatus();
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => {
|
const mapStateToProps = state => {
|
||||||
let statusId = state.getIn(['compose', 'id'], null);
|
let statusId = state.getIn(['compose', 'id'], null);
|
||||||
let editing = true;
|
let editing = true;
|
||||||
|
|
||||||
if (statusId === null) {
|
if (statusId === null) {
|
||||||
statusId = state.getIn(['compose', props.quote ? 'quote_from' : 'in_reply_to']);
|
statusId = state.getIn(['compose', 'in_reply_to']);
|
||||||
editing = false;
|
editing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: getStatus(state, { id: statusId }),
|
status: getStatus(state, { id: statusId }),
|
||||||
quote: props.quote,
|
|
||||||
editing,
|
editing,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -27,8 +26,8 @@ const makeMapStateToProps = () => {
|
|||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
|
|
||||||
onCancel (quote) {
|
onCancel () {
|
||||||
dispatch(quote ? cancelQuoteCompose() : cancelReplyCompose());
|
dispatch(cancelReplyCompose());
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -4,11 +4,10 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
|||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import IconButton from 'mastodon/components/icon_button';
|
import IconButton from 'mastodon/components/icon_button';
|
||||||
import StatusActionBar from 'mastodon/components/status_action_bar';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { me, boostModal } from 'mastodon/initial_state';
|
import { me, boostModal } from 'mastodon/initial_state';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
import { replyCompose, quoteCompose } from 'mastodon/actions/compose';
|
import { replyCompose } from 'mastodon/actions/compose';
|
||||||
import { reblog, favourite, unreblog, unfavourite } from 'mastodon/actions/interactions';
|
import { reblog, favourite, unreblog, unfavourite } from 'mastodon/actions/interactions';
|
||||||
import { makeGetStatus } from 'mastodon/selectors';
|
import { makeGetStatus } from 'mastodon/selectors';
|
||||||
import { initBoostModal } from 'mastodon/actions/boosts';
|
import { initBoostModal } from 'mastodon/actions/boosts';
|
||||||
@ -21,13 +20,9 @@ const messages = defineMessages({
|
|||||||
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
||||||
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
||||||
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
||||||
quote: { id: 'status.quote', defaultMessage: 'Quote' },
|
|
||||||
cannot_quote: { id: 'status.cannot_quote', defaultMessage: 'This post cannot be quoted' },
|
|
||||||
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
||||||
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
|
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
|
||||||
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
||||||
quoteConfirm: { id: 'confirmations.quote.confirm', defaultMessage: 'Quote' },
|
|
||||||
quoteMessage: { id: 'confirmations.quote.message', defaultMessage: 'Quoting now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
|
||||||
open: { id: 'status.open', defaultMessage: 'Expand this status' },
|
open: { id: 'status.open', defaultMessage: 'Expand this status' },
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -140,31 +135,6 @@ class Footer extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_performQuote = () => {
|
|
||||||
const { dispatch, status, onClose } = this.props;
|
|
||||||
const { router } = this.context;
|
|
||||||
|
|
||||||
if (onClose) {
|
|
||||||
onClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch(quoteCompose(status, router.history));
|
|
||||||
}
|
|
||||||
|
|
||||||
handleQuoteClick = () => {
|
|
||||||
const { dispatch, askReplyConfirmation, intl } = this.props;
|
|
||||||
|
|
||||||
if (askReplyConfirmation) {
|
|
||||||
dispatch(openModal('CONFIRM', {
|
|
||||||
message: intl.formatMessage(messages.quoteMessage),
|
|
||||||
confirm: intl.formatMessage(messages.quoteConfirm),
|
|
||||||
onConfirm: this._performQuote,
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
this._performQuote();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleOpenClick = e => {
|
handleOpenClick = e => {
|
||||||
const { router } = this.context;
|
const { router } = this.context;
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import IconButton from '../../../components/icon_button';
|
import IconButton from '../../../components/icon_button';
|
||||||
import StatusActionBar from '../../../components/status_action_bar';
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
|
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
@ -21,8 +20,6 @@ const messages = defineMessages({
|
|||||||
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
||||||
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
||||||
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
||||||
quote: { id: 'status.quote', defaultMessage: 'Quote' },
|
|
||||||
cannot_quote: { id: 'status.cannot_quote', defaultMessage: 'This post cannot be quoted' },
|
|
||||||
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
||||||
bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },
|
bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },
|
||||||
more: { id: 'status.more', defaultMessage: 'More' },
|
more: { id: 'status.more', defaultMessage: 'More' },
|
||||||
@ -64,7 +61,6 @@ class ActionBar extends React.PureComponent {
|
|||||||
relationship: ImmutablePropTypes.map,
|
relationship: ImmutablePropTypes.map,
|
||||||
onReply: PropTypes.func.isRequired,
|
onReply: PropTypes.func.isRequired,
|
||||||
onReblog: PropTypes.func.isRequired,
|
onReblog: PropTypes.func.isRequired,
|
||||||
onQuote: PropTypes.func,
|
|
||||||
onFavourite: PropTypes.func.isRequired,
|
onFavourite: PropTypes.func.isRequired,
|
||||||
onBookmark: PropTypes.func.isRequired,
|
onBookmark: PropTypes.func.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
@ -92,10 +88,6 @@ class ActionBar extends React.PureComponent {
|
|||||||
this.props.onReblog(this.props.status, e);
|
this.props.onReblog(this.props.status, e);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleQuoteClick = () => {
|
|
||||||
this.props.onQuote(this.props.status, this.context.router.history);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleFavouriteClick = () => {
|
handleFavouriteClick = () => {
|
||||||
this.props.onFavourite(this.props.status);
|
this.props.onFavourite(this.props.status);
|
||||||
};
|
};
|
||||||
@ -294,7 +286,6 @@ class ActionBar extends React.PureComponent {
|
|||||||
<div className='detailed-status__button'><IconButton title={intl.formatMessage(messages.reply)} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /></div>
|
<div className='detailed-status__button'><IconButton title={intl.formatMessage(messages.reply)} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /></div>
|
||||||
<div className='detailed-status__button' ><IconButton className={classNames({ reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} /></div>
|
<div className='detailed-status__button' ><IconButton className={classNames({ reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} /></div>
|
||||||
<div className='detailed-status__button'><IconButton className='star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} /></div>
|
<div className='detailed-status__button'><IconButton className='star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} /></div>
|
||||||
<div className='detailed-status__button'><IconButton disabled={!publicStatus} title={StatusActionBar.quoteTitle(intl, messages, publicStatus)} icon='quote-right' onClick={this.handleQuoteClick} /></div>
|
|
||||||
<div className='detailed-status__button'><IconButton className='bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} /></div>
|
<div className='detailed-status__button'><IconButton className='bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} /></div>
|
||||||
|
|
||||||
{shareButton}
|
{shareButton}
|
||||||
|
@ -68,7 +68,6 @@ export default class Card extends React.PureComponent {
|
|||||||
defaultWidth: PropTypes.number,
|
defaultWidth: PropTypes.number,
|
||||||
cacheWidth: PropTypes.func,
|
cacheWidth: PropTypes.func,
|
||||||
sensitive: PropTypes.bool,
|
sensitive: PropTypes.bool,
|
||||||
quote: PropTypes.bool,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -185,7 +184,7 @@ export default class Card extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { card, maxDescription, compact, quote } = this.props;
|
const { card, maxDescription, compact } = this.props;
|
||||||
const { width, embedded, revealed } = this.state;
|
const { width, embedded, revealed } = this.state;
|
||||||
|
|
||||||
if (card === null) {
|
if (card === null) {
|
||||||
@ -198,11 +197,7 @@ export default class Card extends React.PureComponent {
|
|||||||
const className = classnames('status-card', { horizontal, compact, interactive });
|
const className = classnames('status-card', { horizontal, compact, interactive });
|
||||||
const title = interactive ? <a className='status-card__title' href={card.get('url')} title={card.get('title')} rel='noopener noreferrer' target='_blank'><strong>{card.get('title')}</strong></a> : <strong className='status-card__title' title={card.get('title')}>{card.get('title')}</strong>;
|
const title = interactive ? <a className='status-card__title' href={card.get('url')} title={card.get('title')} rel='noopener noreferrer' target='_blank'><strong>{card.get('title')}</strong></a> : <strong className='status-card__title' title={card.get('title')}>{card.get('title')}</strong>;
|
||||||
const ratio = card.get('width') / card.get('height');
|
const ratio = card.get('width') / card.get('height');
|
||||||
let height = (compact && !embedded) ? (width / (16 / 9)) : (width / ratio);
|
const height = (compact && !embedded) ? (width / (16 / 9)) : (width / ratio);
|
||||||
|
|
||||||
if (quote && height) {
|
|
||||||
height /= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
const description = (
|
const description = (
|
||||||
<div className='status-card__content'>
|
<div className='status-card__content'>
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import Avatar from '../../../components/avatar';
|
import Avatar from '../../../components/avatar';
|
||||||
import DisplayName from '../../../components/display_name';
|
import DisplayName from '../../../components/display_name';
|
||||||
import { mapStateToProps, quote } from '../../../components/status';
|
|
||||||
import StatusContent from '../../../components/status_content';
|
import StatusContent from '../../../components/status_content';
|
||||||
import MediaGallery from '../../../components/media_gallery';
|
import MediaGallery from '../../../components/media_gallery';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
@ -27,7 +25,7 @@ const messages = defineMessages({
|
|||||||
direct_short: { id: 'privacy.direct.short', defaultMessage: 'Direct' },
|
direct_short: { id: 'privacy.direct.short', defaultMessage: 'Direct' },
|
||||||
});
|
});
|
||||||
|
|
||||||
export default @connect(mapStateToProps) @injectIntl
|
export default @injectIntl
|
||||||
class DetailedStatus extends ImmutablePureComponent {
|
class DetailedStatus extends ImmutablePureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@ -39,21 +37,17 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
onOpenMedia: PropTypes.func.isRequired,
|
onOpenMedia: PropTypes.func.isRequired,
|
||||||
onOpenVideo: PropTypes.func.isRequired,
|
onOpenVideo: PropTypes.func.isRequired,
|
||||||
onToggleHidden: PropTypes.func.isRequired,
|
onToggleHidden: PropTypes.func.isRequired,
|
||||||
onQuoteToggleHidden: PropTypes.func.isRequired,
|
|
||||||
onTranslate: PropTypes.func.isRequired,
|
onTranslate: PropTypes.func.isRequired,
|
||||||
measureHeight: PropTypes.bool,
|
measureHeight: PropTypes.bool,
|
||||||
onHeightChange: PropTypes.func,
|
onHeightChange: PropTypes.func,
|
||||||
domain: PropTypes.string.isRequired,
|
domain: PropTypes.string.isRequired,
|
||||||
compact: PropTypes.bool,
|
compact: PropTypes.bool,
|
||||||
quoteMuted: PropTypes.bool,
|
|
||||||
showMedia: PropTypes.bool,
|
showMedia: PropTypes.bool,
|
||||||
showQuoteMedia: PropTypes.bool,
|
|
||||||
pictureInPicture: ImmutablePropTypes.contains({
|
pictureInPicture: ImmutablePropTypes.contains({
|
||||||
inUse: PropTypes.bool,
|
inUse: PropTypes.bool,
|
||||||
available: PropTypes.bool,
|
available: PropTypes.bool,
|
||||||
}),
|
}),
|
||||||
onToggleMediaVisibility: PropTypes.func,
|
onToggleMediaVisibility: PropTypes.func,
|
||||||
onQuoteToggleMediaVisibility: PropTypes.func,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -62,9 +56,8 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
|
|
||||||
handleAccountClick = (e) => {
|
handleAccountClick = (e) => {
|
||||||
if (e.button === 0 && !(e.ctrlKey || e.metaKey) && this.context.router) {
|
if (e.button === 0 && !(e.ctrlKey || e.metaKey) && this.context.router) {
|
||||||
const acct = e.currentTarget.getAttribute('data-acct');
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.context.router.history.push(`/@${acct}`);
|
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@ -78,19 +71,6 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
this.props.onToggleHidden(this.props.status);
|
this.props.onToggleHidden(this.props.status);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleExpandedQuoteToggle = () => {
|
|
||||||
this.props.onQuoteToggleHidden(this.props.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleQuoteClick = () => {
|
|
||||||
if (!this.context.router) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { status } = this.props;
|
|
||||||
this.context.router.history.push(`/statuses/${status.getIn(['quote', 'id'])}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
_measureHeight (heightJustChanged) {
|
_measureHeight (heightJustChanged) {
|
||||||
if (this.props.measureHeight && this.node) {
|
if (this.props.measureHeight && this.node) {
|
||||||
scheduleIdleTask(() => this.node && this.setState({ height: Math.ceil(this.node.scrollHeight) + 1 }));
|
scheduleIdleTask(() => this.node && this.setState({ height: Math.ceil(this.node.scrollHeight) + 1 }));
|
||||||
@ -132,12 +112,13 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
render () {
|
render () {
|
||||||
const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
|
const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
|
||||||
const outerStyle = { boxSizing: 'border-box' };
|
const outerStyle = { boxSizing: 'border-box' };
|
||||||
const { intl, compact, pictureInPicture, quoteMuted } = this.props;
|
const { intl, compact, pictureInPicture } = this.props;
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let media = '';
|
||||||
let applicationLink = '';
|
let applicationLink = '';
|
||||||
let reblogLink = '';
|
let reblogLink = '';
|
||||||
let reblogIcon = 'retweet';
|
let reblogIcon = 'retweet';
|
||||||
@ -148,84 +129,63 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
outerStyle.height = `${this.state.height}px`;
|
outerStyle.height = `${this.state.height}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const identity = (status, _0, _1, quote = false) => (
|
if (pictureInPicture.get('inUse')) {
|
||||||
<a href={`/@${status.getIn(['account', 'acct'])}`} onClick={this.handleAccountClick} data-acct={status.getIn(['account', 'acct'])} className='detailed-status__display-name'>
|
media = <PictureInPicturePlaceholder />;
|
||||||
<div className='detailed-status__display-avatar'><Avatar account={status.get('account')} size={quote ? 18 : 46} /></div>
|
} else if (status.get('media_attachments').size > 0) {
|
||||||
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
|
if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
|
||||||
</a>
|
const attachment = status.getIn(['media_attachments', 0]);
|
||||||
);
|
|
||||||
|
|
||||||
const media = (status, quote = false) => {
|
media = (
|
||||||
if (pictureInPicture.get('inUse')) {
|
<Audio
|
||||||
return <PictureInPicturePlaceholder />;
|
src={attachment.get('url')}
|
||||||
} else if (status.get('media_attachments').size > 0) {
|
alt={attachment.get('description')}
|
||||||
if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
|
duration={attachment.getIn(['meta', 'original', 'duration'], 0)}
|
||||||
const attachment = status.getIn(['media_attachments', 0]);
|
poster={attachment.get('preview_url') || status.getIn(['account', 'avatar_static'])}
|
||||||
|
backgroundColor={attachment.getIn(['meta', 'colors', 'background'])}
|
||||||
return (
|
foregroundColor={attachment.getIn(['meta', 'colors', 'foreground'])}
|
||||||
<Audio
|
accentColor={attachment.getIn(['meta', 'colors', 'accent'])}
|
||||||
src={attachment.get('url')}
|
|
||||||
alt={attachment.get('description')}
|
|
||||||
duration={attachment.getIn(['meta', 'original', 'duration'], 0)}
|
|
||||||
poster={attachment.get('preview_url') || status.getIn(['account', 'avatar_static'])}
|
|
||||||
backgroundColor={attachment.getIn(['meta', 'colors', 'background'])}
|
|
||||||
foregroundColor={attachment.getIn(['meta', 'colors', 'foreground'])}
|
|
||||||
accentColor={attachment.getIn(['meta', 'colors', 'accent'])}
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
visible={this.props.showMedia}
|
|
||||||
blurhash={attachment.get('blurhash')}
|
|
||||||
height={150}
|
|
||||||
onToggleVisibility={this.props.onToggleMediaVisibility}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
|
||||||
const attachment = status.getIn(['media_attachments', 0]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Video
|
|
||||||
preview={attachment.get('preview_url')}
|
|
||||||
frameRate={attachment.getIn(['meta', 'original', 'frame_rate'])}
|
|
||||||
blurhash={attachment.get('blurhash')}
|
|
||||||
src={attachment.get('url')}
|
|
||||||
alt={attachment.get('description')}
|
|
||||||
width={300}
|
|
||||||
height={150}
|
|
||||||
inline
|
|
||||||
onOpenVideo={this.handleOpenVideo}
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
visible={this.props.showMedia}
|
|
||||||
onToggleVisibility={this.props.onToggleMediaVisibility}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<MediaGallery
|
|
||||||
standalone
|
|
||||||
sensitive={status.get('sensitive')}
|
|
||||||
media={status.get('media_attachments')}
|
|
||||||
height={300}
|
|
||||||
onOpenMedia={this.props.onOpenMedia}
|
|
||||||
visible={this.props.showMedia}
|
|
||||||
onToggleVisibility={this.props.onToggleMediaVisibility}
|
|
||||||
quote={quote}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else if (status.get('spoiler_text').length === 0) {
|
|
||||||
return (
|
|
||||||
<Card
|
|
||||||
sensitive={status.get('sensitive')}
|
sensitive={status.get('sensitive')}
|
||||||
|
visible={this.props.showMedia}
|
||||||
|
blurhash={attachment.get('blurhash')}
|
||||||
|
height={150}
|
||||||
|
onToggleVisibility={this.props.onToggleMediaVisibility}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
|
const attachment = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
|
media = (
|
||||||
|
<Video
|
||||||
|
preview={attachment.get('preview_url')}
|
||||||
|
frameRate={attachment.getIn(['meta', 'original', 'frame_rate'])}
|
||||||
|
blurhash={attachment.get('blurhash')}
|
||||||
|
src={attachment.get('url')}
|
||||||
|
alt={attachment.get('description')}
|
||||||
|
width={300}
|
||||||
|
height={150}
|
||||||
|
inline
|
||||||
|
onOpenVideo={this.handleOpenVideo}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
visible={this.props.showMedia}
|
||||||
|
onToggleVisibility={this.props.onToggleMediaVisibility}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
media = (
|
||||||
|
<MediaGallery
|
||||||
|
standalone
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
media={status.get('media_attachments')}
|
||||||
|
height={300}
|
||||||
onOpenMedia={this.props.onOpenMedia}
|
onOpenMedia={this.props.onOpenMedia}
|
||||||
card={status.get('card', null)}
|
visible={this.props.showMedia}
|
||||||
quote={quote}
|
onToggleVisibility={this.props.onToggleMediaVisibility}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else if (status.get('spoiler_text').length === 0) {
|
||||||
return null;
|
media = <Card sensitive={status.get('sensitive')} onOpenMedia={this.props.onOpenMedia} card={status.get('card', null)} />;
|
||||||
};
|
}
|
||||||
|
|
||||||
if (status.get('application')) {
|
if (status.get('application')) {
|
||||||
applicationLink = <React.Fragment> · <a className='detailed-status__application' href={status.getIn(['application', 'website'])} target='_blank' rel='noopener noreferrer'>{status.getIn(['application', 'name'])}</a></React.Fragment>;
|
applicationLink = <React.Fragment> · <a className='detailed-status__application' href={status.getIn(['application', 'website'])} target='_blank' rel='noopener noreferrer'>{status.getIn(['application', 'name'])}</a></React.Fragment>;
|
||||||
@ -301,7 +261,10 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
return (
|
return (
|
||||||
<div style={outerStyle}>
|
<div style={outerStyle}>
|
||||||
<div ref={this.setRef} className={classNames('detailed-status', `detailed-status-${status.get('visibility')}`, { compact })}>
|
<div ref={this.setRef} className={classNames('detailed-status', `detailed-status-${status.get('visibility')}`, { compact })}>
|
||||||
{identity(status, null, null, false)}
|
<a href={`/@${status.getIn(['account', 'acct'])}`} onClick={this.handleAccountClick} className='detailed-status__display-name'>
|
||||||
|
<div className='detailed-status__display-avatar'><Avatar account={status.get('account')} size={46} /></div>
|
||||||
|
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
|
||||||
|
</a>
|
||||||
|
|
||||||
<StatusContent
|
<StatusContent
|
||||||
status={status}
|
status={status}
|
||||||
@ -310,9 +273,7 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
onTranslate={this.handleTranslate}
|
onTranslate={this.handleTranslate}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{media(status, false)}
|
{media}
|
||||||
|
|
||||||
{quote(status, false, quoteMuted, this.handleQuoteClick, this.handleExpandedQuoteToggle, identity, media, this.context.router)}
|
|
||||||
|
|
||||||
<div className='detailed-status__meta'>
|
<div className='detailed-status__meta'>
|
||||||
<a className='detailed-status__datetime' href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} target='_blank' rel='noopener noreferrer'>
|
<a className='detailed-status__datetime' href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} target='_blank' rel='noopener noreferrer'>
|
||||||
|
@ -20,8 +20,6 @@ import {
|
|||||||
deleteStatus,
|
deleteStatus,
|
||||||
hideStatus,
|
hideStatus,
|
||||||
revealStatus,
|
revealStatus,
|
||||||
hideQuote,
|
|
||||||
revealQuote,
|
|
||||||
} from '../../../actions/statuses';
|
} from '../../../actions/statuses';
|
||||||
import { initMuteModal } from '../../../actions/mutes';
|
import { initMuteModal } from '../../../actions/mutes';
|
||||||
import { initBlockModal } from '../../../actions/blocks';
|
import { initBlockModal } from '../../../actions/blocks';
|
||||||
@ -167,14 +165,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onQuoteToggleHidden (status) {
|
|
||||||
if (status.get('quote_hidden')) {
|
|
||||||
dispatch(revealQuote(status.get('id')));
|
|
||||||
} else {
|
|
||||||
dispatch(hideQuote(status.get('id')));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(DetailedStatus));
|
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(DetailedStatus));
|
||||||
|
@ -23,7 +23,6 @@ import {
|
|||||||
} from '../../actions/interactions';
|
} from '../../actions/interactions';
|
||||||
import {
|
import {
|
||||||
replyCompose,
|
replyCompose,
|
||||||
quoteCompose,
|
|
||||||
mentionCompose,
|
mentionCompose,
|
||||||
directCompose,
|
directCompose,
|
||||||
} from '../../actions/compose';
|
} from '../../actions/compose';
|
||||||
@ -36,8 +35,6 @@ import {
|
|||||||
revealStatus,
|
revealStatus,
|
||||||
translateStatus,
|
translateStatus,
|
||||||
undoStatusTranslation,
|
undoStatusTranslation,
|
||||||
hideQuote,
|
|
||||||
revealQuote,
|
|
||||||
} from '../../actions/statuses';
|
} from '../../actions/statuses';
|
||||||
import {
|
import {
|
||||||
unblockAccount,
|
unblockAccount,
|
||||||
@ -76,8 +73,6 @@ const messages = defineMessages({
|
|||||||
detailedStatus: { id: 'status.detailed_status', defaultMessage: 'Detailed conversation view' },
|
detailedStatus: { id: 'status.detailed_status', defaultMessage: 'Detailed conversation view' },
|
||||||
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
|
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
|
||||||
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
||||||
quoteConfirm: { id: 'confirmations.quote.confirm', defaultMessage: 'Quote' },
|
|
||||||
quoteMessage: { id: 'confirmations.quote.message', defaultMessage: 'Quoting now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
|
||||||
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
|
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -210,7 +205,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
state = {
|
state = {
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
showMedia: defaultMediaVisibility(this.props.status),
|
showMedia: defaultMediaVisibility(this.props.status),
|
||||||
showQuoteMedia: defaultMediaVisibility(this.props.status ? this.props.status.get('quote', null) : null),
|
|
||||||
loadedStatusId: undefined,
|
loadedStatusId: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -233,11 +227,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nextProps.status && nextProps.status.get('id') !== this.state.loadedStatusId) {
|
if (nextProps.status && nextProps.status.get('id') !== this.state.loadedStatusId) {
|
||||||
this.setState({
|
this.setState({ showMedia: defaultMediaVisibility(nextProps.status), loadedStatusId: nextProps.status.get('id') });
|
||||||
showMedia: defaultMediaVisibility(nextProps.status),
|
|
||||||
showQuoteMedia: defaultMediaVisibility(nextProps.status.get('quote', null)),
|
|
||||||
loadedStatusId: nextProps.status.get('id'),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,10 +235,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
this.setState({ showMedia: !this.state.showMedia });
|
this.setState({ showMedia: !this.state.showMedia });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleToggleQuoteMediaVisibility = () => {
|
|
||||||
this.setState({ showQuoteMedia: !this.state.showQuoteMedia });
|
|
||||||
}
|
|
||||||
|
|
||||||
handleFavouriteClick = (status) => {
|
handleFavouriteClick = (status) => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
const { signedIn } = this.context.identity;
|
const { signedIn } = this.context.identity;
|
||||||
@ -299,19 +285,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleQuoteClick = (status) => {
|
|
||||||
let { askReplyConfirmation, dispatch, intl } = this.props;
|
|
||||||
if (askReplyConfirmation) {
|
|
||||||
dispatch(openModal('CONFIRM', {
|
|
||||||
message: intl.formatMessage(messages.quoteMessage),
|
|
||||||
confirm: intl.formatMessage(messages.quoteConfirm),
|
|
||||||
onConfirm: () => dispatch(quoteCompose(status, this.context.router.history)),
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
dispatch(quoteCompose(status, this.context.router.history));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleModalReblog = (status, privacy) => {
|
handleModalReblog = (status, privacy) => {
|
||||||
this.props.dispatch(reblog(status, privacy));
|
this.props.dispatch(reblog(status, privacy));
|
||||||
};
|
};
|
||||||
@ -415,14 +388,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleQuoteToggleHidden = (status) => {
|
|
||||||
if (status.get('quote_hidden')) {
|
|
||||||
this.props.dispatch(revealQuote(status.get('id')));
|
|
||||||
} else {
|
|
||||||
this.props.dispatch(hideQuote(status.get('id')));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleToggleAll = () => {
|
handleToggleAll = () => {
|
||||||
const { status, ancestorsIds, descendantsIds } = this.props;
|
const { status, ancestorsIds, descendantsIds } = this.props;
|
||||||
const statusIds = [status.get('id')].concat(ancestorsIds.toJS(), descendantsIds.toJS());
|
const statusIds = [status.get('id')].concat(ancestorsIds.toJS(), descendantsIds.toJS());
|
||||||
@ -675,12 +640,9 @@ class Status extends ImmutablePureComponent {
|
|||||||
onOpenMedia={this.handleOpenMedia}
|
onOpenMedia={this.handleOpenMedia}
|
||||||
onToggleHidden={this.handleToggleHidden}
|
onToggleHidden={this.handleToggleHidden}
|
||||||
onTranslate={this.handleTranslate}
|
onTranslate={this.handleTranslate}
|
||||||
onQuoteToggleHidden={this.handleQuoteToggleHidden}
|
|
||||||
domain={domain}
|
domain={domain}
|
||||||
showMedia={this.state.showMedia}
|
showMedia={this.state.showMedia}
|
||||||
showQuoteMedia={this.state.showQuoteMedia}
|
|
||||||
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
||||||
onToggleQuoteMediaVisibility={this.handleToggleQuoteMediaVisibility}
|
|
||||||
pictureInPicture={pictureInPicture}
|
pictureInPicture={pictureInPicture}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -690,7 +652,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
onReply={this.handleReplyClick}
|
onReply={this.handleReplyClick}
|
||||||
onFavourite={this.handleFavouriteClick}
|
onFavourite={this.handleFavouriteClick}
|
||||||
onReblog={this.handleReblogClick}
|
onReblog={this.handleReblogClick}
|
||||||
onQuote={this.handleQuoteClick}
|
|
||||||
onBookmark={this.handleBookmarkClick}
|
onBookmark={this.handleBookmarkClick}
|
||||||
onDelete={this.handleDeleteClick}
|
onDelete={this.handleDeleteClick}
|
||||||
onEdit={this.handleEditClick}
|
onEdit={this.handleEditClick}
|
||||||
|
@ -21,15 +21,8 @@ import {
|
|||||||
} from '../../ui/util/async-components';
|
} from '../../ui/util/async-components';
|
||||||
import ComposePanel from './compose_panel';
|
import ComposePanel from './compose_panel';
|
||||||
import NavigationPanel from './navigation_panel';
|
import NavigationPanel from './navigation_panel';
|
||||||
import TabsBar from './tabs_bar';
|
|
||||||
import { place_tab_bar_at_bottom } from 'mastodon/initial_state';
|
|
||||||
import { supportsPassiveEvents } from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
import { scrollRight } from '../../../scroll';
|
import { scrollRight } from '../../../scroll';
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import Icon from 'mastodon/components/icon';
|
|
||||||
|
|
||||||
const shouldHideFAB = path => path.match(/^\/statuses\/|^\/search|^\/getting-started/);
|
|
||||||
|
|
||||||
const componentMap = {
|
const componentMap = {
|
||||||
'COMPOSE': Compose,
|
'COMPOSE': Compose,
|
||||||
@ -145,55 +138,26 @@ export default class ColumnsArea extends ImmutablePureComponent {
|
|||||||
const { renderComposePanel } = this.state;
|
const { renderComposePanel } = this.state;
|
||||||
|
|
||||||
if (singleColumn) {
|
if (singleColumn) {
|
||||||
if (place_tab_bar_at_bottom) {
|
return (
|
||||||
return (
|
<div className='columns-area__panels'>
|
||||||
<div className='columns-area__panels tab-ber-bottom'>
|
<div className='columns-area__panels__pane columns-area__panels__pane--compositional'>
|
||||||
<div className='columns-area__panels__pane columns-area__panels__pane--compositional'>
|
<div className='columns-area__panels__pane__inner'>
|
||||||
<div className='columns-area__panels__pane__inner'>
|
{renderComposePanel && <ComposePanel />}
|
||||||
{renderComposePanel && <ComposePanel />}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='columns-area__panels__main timeline'>
|
|
||||||
<div className='tabs-bar__wrapper'><div id='tabs-bar__portal' /></div>
|
|
||||||
<div className='columns-area columns-area--mobile'>{children}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='columns-area__panels__main navber'>
|
|
||||||
{location.pathname !== '/publish' && <Link to='/publish' className='button bottom_right'><Icon id='pencil' fixedWidth /></Link>}
|
|
||||||
<TabsBar key='tabs' />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='columns-area__panels__pane columns-area__panels__pane--start columns-area__panels__pane--navigational columns-area__panels__pane-tab-ber'>
|
|
||||||
<div className='columns-area__panels__pane__inner'>
|
|
||||||
<NavigationPanel />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<div className='columns-area__panels'>
|
|
||||||
<div className='columns-area__panels__pane columns-area__panels__pane--compositional'>
|
|
||||||
<div className='columns-area__panels__pane__inner'>
|
|
||||||
{renderComposePanel && <ComposePanel />}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='columns-area__panels__main'>
|
|
||||||
<div className='tabs-bar__wrapper'><div id='tabs-bar__portal' /></div>
|
|
||||||
<div className='columns-area columns-area--mobile'>{children}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='columns-area__panels__pane columns-area__panels__pane--start columns-area__panels__pane--navigational'>
|
|
||||||
<div className='columns-area__panels__pane__inner'>
|
|
||||||
<NavigationPanel />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
|
||||||
}
|
<div className='columns-area__panels__main'>
|
||||||
|
<div className='tabs-bar__wrapper'><div id='tabs-bar__portal' /></div>
|
||||||
|
<div className='columns-area columns-area--mobile'>{children}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='columns-area__panels__pane columns-area__panels__pane--start columns-area__panels__pane--navigational'>
|
||||||
|
<div className='columns-area__panels__pane__inner'>
|
||||||
|
<NavigationPanel />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { NavLink, withRouter } from 'react-router-dom';
|
|
||||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
||||||
import NotificationsCounterIcon from './notifications_counter_icon';
|
|
||||||
import { place_tab_bar_at_bottom, show_tab_bar_label } from 'mastodon/initial_state';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { debounce } from 'lodash';
|
|
||||||
import { isUserTouching } from '../../../is_mobile';
|
|
||||||
import Icon from 'mastodon/components/icon';
|
|
||||||
|
|
||||||
export const links = [
|
|
||||||
<NavLink className='tabs-bar__link' to='/home' data-preview-title-id='column.home' data-preview-icon='home' ><Icon id='home' fixedWidth /></NavLink>,
|
|
||||||
<NavLink className='tabs-bar__link' to='/notifications' data-preview-title-id='column.notifications' data-preview-icon='bell' ><NotificationsCounterIcon /></NavLink>,
|
|
||||||
<NavLink className='tabs-bar__link' to='/public/local' data-preview-title-id='column.community' data-preview-icon='users' ><Icon id='users' fixedWidth /></NavLink>,
|
|
||||||
<NavLink className='tabs-bar__link' exact to='/public' data-preview-title-id='column.public' data-preview-icon='globe' ><Icon id='globe' fixedWidth /></NavLink>,
|
|
||||||
<NavLink className='tabs-bar__link optional' to='/search' data-preview-title-id='tabs_bar.search' data-preview-icon='bell' ><Icon id='search' fixedWidth /></NavLink>,
|
|
||||||
<NavLink className='tabs-bar__link hamburger' to='/getting-started' data-preview-title-id='getting_started.heading' data-preview-icon='bars' ><Icon id='bars' fixedWidth /></NavLink>,
|
|
||||||
];
|
|
||||||
|
|
||||||
export function getIndex (path) {
|
|
||||||
return links.findIndex(link => link.props.to === path);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getLink (index) {
|
|
||||||
return links[index].props.to;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default @injectIntl
|
|
||||||
@withRouter
|
|
||||||
class TabsBar extends React.PureComponent {
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
intl: PropTypes.object.isRequired,
|
|
||||||
history: PropTypes.object.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
setRef = ref => {
|
|
||||||
this.node = ref;
|
|
||||||
}
|
|
||||||
|
|
||||||
handleClick = (e) => {
|
|
||||||
// Only apply optimization for touch devices, which we assume are slower
|
|
||||||
// We thus avoid the 250ms delay for non-touch devices and the lag for touch devices
|
|
||||||
if (isUserTouching()) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.persist();
|
|
||||||
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
const tabs = Array(...this.node.querySelectorAll('.tabs-bar__link'));
|
|
||||||
const currentTab = tabs.find(tab => tab.classList.contains('active'));
|
|
||||||
const nextTab = tabs.find(tab => tab.contains(e.target));
|
|
||||||
const { props: { to } } = links[Array(...this.node.childNodes).indexOf(nextTab)];
|
|
||||||
|
|
||||||
|
|
||||||
if (currentTab !== nextTab) {
|
|
||||||
if (currentTab) {
|
|
||||||
currentTab.classList.remove('active');
|
|
||||||
}
|
|
||||||
|
|
||||||
const listener = debounce(() => {
|
|
||||||
nextTab.removeEventListener('transitionend', listener);
|
|
||||||
this.props.history.push(to);
|
|
||||||
}, 50);
|
|
||||||
|
|
||||||
nextTab.addEventListener('transitionend', listener);
|
|
||||||
nextTab.classList.add('active');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static contextTypes = {
|
|
||||||
router: PropTypes.object.isRequired,
|
|
||||||
identity: PropTypes.object.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
intl: PropTypes.object.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const { intl: { formatMessage } } = this.props;
|
|
||||||
return (
|
|
||||||
<div className='tabs-bar__wrapper'>
|
|
||||||
<nav className={classNames('tabs-bar', { 'bottom-bar': place_tab_bar_at_bottom })} ref={this.setRef}>
|
|
||||||
{links.map(link => React.cloneElement(link, { key: link.props.to, className: classNames(link.props.className, { 'short-label': show_tab_bar_label }), onClick: this.handleClick, 'aria-label': formatMessage({ id: link.props['data-preview-title-id'] }) }))}
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div id='tabs-bar__portal' />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -121,7 +121,6 @@ class Video extends React.PureComponent {
|
|||||||
autoPlay: PropTypes.bool,
|
autoPlay: PropTypes.bool,
|
||||||
volume: PropTypes.number,
|
volume: PropTypes.number,
|
||||||
muted: PropTypes.bool,
|
muted: PropTypes.bool,
|
||||||
quote: PropTypes.bool,
|
|
||||||
componentIndex: PropTypes.number,
|
componentIndex: PropTypes.number,
|
||||||
autoFocus: PropTypes.bool,
|
autoFocus: PropTypes.bool,
|
||||||
};
|
};
|
||||||
@ -525,7 +524,7 @@ class Video extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, editable, blurhash, autoFocus, quote } = this.props;
|
const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, editable, blurhash, autoFocus } = this.props;
|
||||||
const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;
|
const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;
|
||||||
const progress = Math.min((currentTime / duration) * 100, 100);
|
const progress = Math.min((currentTime / duration) * 100, 100);
|
||||||
const playerStyle = {};
|
const playerStyle = {};
|
||||||
@ -539,11 +538,6 @@ class Video extends React.PureComponent {
|
|||||||
playerStyle.height = height;
|
playerStyle.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quote && height) {
|
|
||||||
height /= 2;
|
|
||||||
playerStyle.height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
let preload;
|
let preload;
|
||||||
|
|
||||||
if (this.props.currentTime || fullscreen || dragging) {
|
if (this.props.currentTime || fullscreen || dragging) {
|
||||||
|
@ -135,7 +135,5 @@ export const version = getMeta('version');
|
|||||||
export const translationEnabled = getMeta('translation_enabled');
|
export const translationEnabled = getMeta('translation_enabled');
|
||||||
export const languages = initialState?.languages;
|
export const languages = initialState?.languages;
|
||||||
export const statusPageUrl = getMeta('status_page_url');
|
export const statusPageUrl = getMeta('status_page_url');
|
||||||
export const place_tab_bar_at_bottom = getMeta('place_tab_bar_at_bottom');
|
|
||||||
export const show_tab_bar_label = getMeta('show_tab_bar_label');
|
|
||||||
|
|
||||||
export default initialState;
|
export default initialState;
|
||||||
|
@ -607,14 +607,6 @@
|
|||||||
"defaultMessage": "This post cannot be boosted",
|
"defaultMessage": "This post cannot be boosted",
|
||||||
"id": "status.cannot_reblog"
|
"id": "status.cannot_reblog"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"defaultMessage": "Quote",
|
|
||||||
"id": "status.quote"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"defaultMessage": "This post cannot be quoted",
|
|
||||||
"id": "status.cannot_quote"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"defaultMessage": "Favourite",
|
"defaultMessage": "Favourite",
|
||||||
"id": "status.favourite"
|
"id": "status.favourite"
|
||||||
@ -772,14 +764,6 @@
|
|||||||
{
|
{
|
||||||
"defaultMessage": "Replied to {name}",
|
"defaultMessage": "Replied to {name}",
|
||||||
"id": "status.replied_to"
|
"id": "status.replied_to"
|
||||||
},
|
|
||||||
{
|
|
||||||
"defaultMessage": "Muted quote",
|
|
||||||
"id": "status.muted_quote"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"defaultMessage": "Unlisted quote",
|
|
||||||
"id": "status.unlisted_quote"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/components/status.json"
|
"path": "app/javascript/mastodon/components/status.json"
|
||||||
@ -3732,14 +3716,6 @@
|
|||||||
"defaultMessage": "Detailed conversation view",
|
"defaultMessage": "Detailed conversation view",
|
||||||
"id": "status.detailed_status"
|
"id": "status.detailed_status"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"defaultMessage": "Quote",
|
|
||||||
"id": "confirmations.quote.confirm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"defaultMessage": "Quoting now will overwrite the message you are currently composing. Are you sure you want to proceed?",
|
|
||||||
"id": "confirmations.quote.message"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"defaultMessage": "Reply",
|
"defaultMessage": "Reply",
|
||||||
"id": "confirmations.reply.confirm"
|
"id": "confirmations.reply.confirm"
|
||||||
@ -4359,4 +4335,4 @@
|
|||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/features/video/index.json"
|
"path": "app/javascript/mastodon/features/video/index.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -169,8 +169,6 @@
|
|||||||
"confirmations.mute.confirm": "Mute",
|
"confirmations.mute.confirm": "Mute",
|
||||||
"confirmations.mute.explanation": "This will hide posts from them and posts mentioning them, but it will still allow them to see your posts and follow you.",
|
"confirmations.mute.explanation": "This will hide posts from them and posts mentioning them, but it will still allow them to see your posts and follow you.",
|
||||||
"confirmations.mute.message": "Are you sure you want to mute {name}?",
|
"confirmations.mute.message": "Are you sure you want to mute {name}?",
|
||||||
"confirmations.quote.confirm": "Quote",
|
|
||||||
"confirmations.quote.message": "Quoting now will overwrite the message you are currently composing. Are you sure you want to proceed?",
|
|
||||||
"confirmations.redraft.confirm": "Delete & redraft",
|
"confirmations.redraft.confirm": "Delete & redraft",
|
||||||
"confirmations.redraft.message": "Are you sure you want to delete this post and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.",
|
"confirmations.redraft.message": "Are you sure you want to delete this post and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.",
|
||||||
"confirmations.reply.confirm": "Reply",
|
"confirmations.reply.confirm": "Reply",
|
||||||
@ -555,7 +553,6 @@
|
|||||||
"status.block": "Block @{name}",
|
"status.block": "Block @{name}",
|
||||||
"status.bookmark": "Bookmark",
|
"status.bookmark": "Bookmark",
|
||||||
"status.cancel_reblog_private": "Unboost",
|
"status.cancel_reblog_private": "Unboost",
|
||||||
"status.cannot_quote": "This post cannot be quoted",
|
|
||||||
"status.cannot_reblog": "This post cannot be boosted",
|
"status.cannot_reblog": "This post cannot be boosted",
|
||||||
"status.copy": "Copy link to post",
|
"status.copy": "Copy link to post",
|
||||||
"status.delete": "Delete",
|
"status.delete": "Delete",
|
||||||
@ -577,11 +574,9 @@
|
|||||||
"status.more": "More",
|
"status.more": "More",
|
||||||
"status.mute": "Mute @{name}",
|
"status.mute": "Mute @{name}",
|
||||||
"status.mute_conversation": "Mute conversation",
|
"status.mute_conversation": "Mute conversation",
|
||||||
"status.muted_quote": "Muted quote",
|
|
||||||
"status.open": "Expand this post",
|
"status.open": "Expand this post",
|
||||||
"status.pin": "Pin on profile",
|
"status.pin": "Pin on profile",
|
||||||
"status.pinned": "Pinned post",
|
"status.pinned": "Pinned post",
|
||||||
"status.quote": "Quote",
|
|
||||||
"status.read_more": "Read more",
|
"status.read_more": "Read more",
|
||||||
"status.reblog": "Boost",
|
"status.reblog": "Boost",
|
||||||
"status.reblog_private": "Boost with original visibility",
|
"status.reblog_private": "Boost with original visibility",
|
||||||
@ -604,7 +599,6 @@
|
|||||||
"status.translate": "Translate",
|
"status.translate": "Translate",
|
||||||
"status.translated_from_with": "Translated from {lang} using {provider}",
|
"status.translated_from_with": "Translated from {lang} using {provider}",
|
||||||
"status.uncached_media_warning": "Not available",
|
"status.uncached_media_warning": "Not available",
|
||||||
"status.unlisted_quote": "Unlisted quote",
|
|
||||||
"status.unmute_conversation": "Unmute conversation",
|
"status.unmute_conversation": "Unmute conversation",
|
||||||
"status.unpin": "Unpin from profile",
|
"status.unpin": "Unpin from profile",
|
||||||
"subscribed_languages.lead": "Only posts in selected languages will appear on your home and list timelines after the change. Select none to receive posts in all languages.",
|
"subscribed_languages.lead": "Only posts in selected languages will appear on your home and list timelines after the change. Select none to receive posts in all languages.",
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
"account.browse_more_on_origin_server": "リモートで表示",
|
"account.browse_more_on_origin_server": "リモートで表示",
|
||||||
"account.cancel_follow_request": "フォローリクエストの取り消し",
|
"account.cancel_follow_request": "フォローリクエストの取り消し",
|
||||||
"account.direct": "@{name}さんにダイレクトメッセージ",
|
"account.direct": "@{name}さんにダイレクトメッセージ",
|
||||||
"account.disable_notifications": "@{name}さんのトゥート時の通知を停止",
|
"account.disable_notifications": "@{name}さんの投稿時の通知を停止",
|
||||||
"account.domain_blocked": "ドメインブロック中",
|
"account.domain_blocked": "ドメインブロック中",
|
||||||
"account.edit_profile": "プロフィール編集",
|
"account.edit_profile": "プロフィール編集",
|
||||||
"account.enable_notifications": "@{name}さんのトゥート時に通知",
|
"account.enable_notifications": "@{name}さんの投稿時に通知",
|
||||||
"account.endorse": "プロフィールで紹介する",
|
"account.endorse": "プロフィールで紹介する",
|
||||||
"account.featured_tags.last_status_at": "最終トゥート {date}",
|
"account.featured_tags.last_status_at": "最終投稿 {date}",
|
||||||
"account.featured_tags.last_status_never": "トゥートがありません",
|
"account.featured_tags.last_status_never": "投稿がありません",
|
||||||
"account.featured_tags.title": "{name}の注目ハッシュタグ",
|
"account.featured_tags.title": "{name}の注目ハッシュタグ",
|
||||||
"account.follow": "フォロー",
|
"account.follow": "フォロー",
|
||||||
"account.followers": "フォロワー",
|
"account.followers": "フォロワー",
|
||||||
@ -50,14 +50,14 @@
|
|||||||
"account.mute_notifications": "@{name}さんからの通知を受け取らない",
|
"account.mute_notifications": "@{name}さんからの通知を受け取らない",
|
||||||
"account.muted": "ミュート済み",
|
"account.muted": "ミュート済み",
|
||||||
"account.open_original_page": "元のページを開く",
|
"account.open_original_page": "元のページを開く",
|
||||||
"account.posts": "トゥート",
|
"account.posts": "投稿",
|
||||||
"account.posts_with_replies": "トゥートと返信",
|
"account.posts_with_replies": "投稿と返信",
|
||||||
"account.report": "@{name}さんを通報",
|
"account.report": "@{name}さんを通報",
|
||||||
"account.requested": "フォロー承認待ちです。クリックしてキャンセル",
|
"account.requested": "フォロー承認待ちです。クリックしてキャンセル",
|
||||||
"account.requested_follow": "{name}さんがあなたにフォローリクエストしました",
|
"account.requested_follow": "{name}さんがあなたにフォローリクエストしました",
|
||||||
"account.share": "@{name}さんのプロフィールを共有する",
|
"account.share": "@{name}さんのプロフィールを共有する",
|
||||||
"account.show_reblogs": "@{name}さんからのブーストを表示",
|
"account.show_reblogs": "@{name}さんからのブーストを表示",
|
||||||
"account.statuses_counter": "{counter} トゥート",
|
"account.statuses_counter": "{counter} 投稿",
|
||||||
"account.unblock": "@{name}さんのブロックを解除",
|
"account.unblock": "@{name}さんのブロックを解除",
|
||||||
"account.unblock_domain": "{domain}のブロックを解除",
|
"account.unblock_domain": "{domain}のブロックを解除",
|
||||||
"account.unblock_short": "ブロック解除",
|
"account.unblock_short": "ブロック解除",
|
||||||
@ -111,7 +111,7 @@
|
|||||||
"column.lists": "リスト",
|
"column.lists": "リスト",
|
||||||
"column.mutes": "ミュートしたユーザー",
|
"column.mutes": "ミュートしたユーザー",
|
||||||
"column.notifications": "通知",
|
"column.notifications": "通知",
|
||||||
"column.pins": "固定されたトゥート",
|
"column.pins": "固定された投稿",
|
||||||
"column.public": "連合タイムライン",
|
"column.public": "連合タイムライン",
|
||||||
"column_back_button.label": "戻る",
|
"column_back_button.label": "戻る",
|
||||||
"column_header.hide_settings": "設定を隠す",
|
"column_header.hide_settings": "設定を隠す",
|
||||||
@ -127,9 +127,9 @@
|
|||||||
"compose.language.change": "言語を変更",
|
"compose.language.change": "言語を変更",
|
||||||
"compose.language.search": "言語を検索...",
|
"compose.language.search": "言語を検索...",
|
||||||
"compose_form.direct_message_warning_learn_more": "もっと詳しく",
|
"compose_form.direct_message_warning_learn_more": "もっと詳しく",
|
||||||
"compose_form.encryption_warning": "Mastodonのトゥートはエンドツーエンド暗号化に対応していません。安全に送受信されるべき情報をMastodonで共有しないでください。",
|
"compose_form.encryption_warning": "Mastodonの投稿はエンドツーエンド暗号化に対応していません。安全に送受信されるべき情報をMastodonで共有しないでください。",
|
||||||
"compose_form.hashtag_warning": "このトゥートは公開設定ではないのでハッシュタグの一覧に表示されません。公開トゥートだけがハッシュタグで検索できます。",
|
"compose_form.hashtag_warning": "この投稿は公開設定ではないのでハッシュタグの一覧に表示されません。公開投稿だけがハッシュタグで検索できます。",
|
||||||
"compose_form.lock_disclaimer": "あなたのアカウントは{locked}になっていません。誰でもあなたをフォローすることができ、フォロワー限定のトゥートを見ることができます。",
|
"compose_form.lock_disclaimer": "あなたのアカウントは{locked}になっていません。誰でもあなたをフォローすることができ、フォロワー限定の投稿を見ることができます。",
|
||||||
"compose_form.lock_disclaimer.lock": "承認制",
|
"compose_form.lock_disclaimer.lock": "承認制",
|
||||||
"compose_form.placeholder": "今なにしてる?",
|
"compose_form.placeholder": "今なにしてる?",
|
||||||
"compose_form.poll.add_option": "追加",
|
"compose_form.poll.add_option": "追加",
|
||||||
@ -138,8 +138,8 @@
|
|||||||
"compose_form.poll.remove_option": "この項目を削除",
|
"compose_form.poll.remove_option": "この項目を削除",
|
||||||
"compose_form.poll.switch_to_multiple": "複数選択に変更",
|
"compose_form.poll.switch_to_multiple": "複数選択に変更",
|
||||||
"compose_form.poll.switch_to_single": "単一選択に変更",
|
"compose_form.poll.switch_to_single": "単一選択に変更",
|
||||||
"compose_form.publish": "トゥート",
|
"compose_form.publish": "投稿",
|
||||||
"compose_form.publish_form": "トゥート",
|
"compose_form.publish_form": "投稿",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.save_changes": "変更を保存",
|
"compose_form.save_changes": "変更を保存",
|
||||||
"compose_form.sensitive.hide": "メディアを閲覧注意にする",
|
"compose_form.sensitive.hide": "メディアを閲覧注意にする",
|
||||||
@ -148,9 +148,6 @@
|
|||||||
"compose_form.spoiler.marked": "本文は警告の後ろに隠されます",
|
"compose_form.spoiler.marked": "本文は警告の後ろに隠されます",
|
||||||
"compose_form.spoiler.unmarked": "本文は隠されていません",
|
"compose_form.spoiler.unmarked": "本文は隠されていません",
|
||||||
"compose_form.spoiler_placeholder": "ここに警告を書いてください",
|
"compose_form.spoiler_placeholder": "ここに警告を書いてください",
|
||||||
"compose_form.utilBtns_goji": "誤字盛!",
|
|
||||||
"compose_form.utilBtns_harukin": "はるきん焼却",
|
|
||||||
"compose_form.utilBtns_risa": "りさ姉",
|
|
||||||
"confirmation_modal.cancel": "キャンセル",
|
"confirmation_modal.cancel": "キャンセル",
|
||||||
"confirmations.block.block_and_report": "ブロックし通報",
|
"confirmations.block.block_and_report": "ブロックし通報",
|
||||||
"confirmations.block.confirm": "ブロック",
|
"confirmations.block.confirm": "ブロック",
|
||||||
@ -168,12 +165,10 @@
|
|||||||
"confirmations.logout.confirm": "ログアウト",
|
"confirmations.logout.confirm": "ログアウト",
|
||||||
"confirmations.logout.message": "本当にログアウトしますか?",
|
"confirmations.logout.message": "本当にログアウトしますか?",
|
||||||
"confirmations.mute.confirm": "ミュート",
|
"confirmations.mute.confirm": "ミュート",
|
||||||
"confirmations.mute.explanation": "これにより相手のトゥートと返信は見えなくなりますが、相手はあなたをフォローし続けトゥートを見ることができます。",
|
"confirmations.mute.explanation": "これにより相手の投稿と返信は見えなくなりますが、相手はあなたをフォローし続け投稿を見ることができます。",
|
||||||
"confirmations.mute.message": "本当に{name}さんをミュートしますか?",
|
"confirmations.mute.message": "本当に{name}さんをミュートしますか?",
|
||||||
"confirmations.quote.confirm": "引用",
|
|
||||||
"confirmations.quote.message": "今引用すると現在作成中のメッセージが上書きされます。本当に実行しますか?",
|
|
||||||
"confirmations.redraft.confirm": "削除して下書きに戻す",
|
"confirmations.redraft.confirm": "削除して下書きに戻す",
|
||||||
"confirmations.redraft.message": "本当にこのトゥートを削除して下書きに戻しますか? このトゥートへのお気に入り登録やブーストは失われ、返信は孤立することになります。",
|
"confirmations.redraft.message": "本当にこの投稿を削除して下書きに戻しますか? この投稿へのお気に入り登録やブーストは失われ、返信は孤立することになります。",
|
||||||
"confirmations.reply.confirm": "返信",
|
"confirmations.reply.confirm": "返信",
|
||||||
"confirmations.reply.message": "今返信すると現在作成中のメッセージが上書きされます。本当に実行しますか?",
|
"confirmations.reply.message": "今返信すると現在作成中のメッセージが上書きされます。本当に実行しますか?",
|
||||||
"confirmations.unfollow.confirm": "フォロー解除",
|
"confirmations.unfollow.confirm": "フォロー解除",
|
||||||
@ -190,12 +185,12 @@
|
|||||||
"directory.recently_active": "最近の活動順",
|
"directory.recently_active": "最近の活動順",
|
||||||
"disabled_account_banner.account_settings": "アカウント設定",
|
"disabled_account_banner.account_settings": "アカウント設定",
|
||||||
"disabled_account_banner.text": "あなたのアカウント『{disabledAccount}』は現在無効になっています。",
|
"disabled_account_banner.text": "あなたのアカウント『{disabledAccount}』は現在無効になっています。",
|
||||||
"dismissable_banner.community_timeline": "これらは{domain}がホストしている人たちの最新の公開トゥートです。",
|
"dismissable_banner.community_timeline": "これらは{domain}がホストしている人たちの最新の公開投稿です。",
|
||||||
"dismissable_banner.dismiss": "閉じる",
|
"dismissable_banner.dismiss": "閉じる",
|
||||||
"dismissable_banner.explore_links": "これらのニュース記事は現在分散型ネットワークの他のサーバーの人たちに話されています。",
|
"dismissable_banner.explore_links": "これらのニュース記事は現在分散型ネットワークの他のサーバーの人たちに話されています。",
|
||||||
"dismissable_banner.explore_statuses": "分散型ネットワーク内の他のサーバーのこれらのトゥートは現在このサーバー上で注目されています。",
|
"dismissable_banner.explore_statuses": "分散型ネットワーク内の他のサーバーのこれらの投稿は現在このサーバー上で注目されています。",
|
||||||
"dismissable_banner.explore_tags": "これらのハッシュタグは現在分散型ネットワークの他のサーバーの人たちに話されています。",
|
"dismissable_banner.explore_tags": "これらのハッシュタグは現在分散型ネットワークの他のサーバーの人たちに話されています。",
|
||||||
"dismissable_banner.public_timeline": "これらのトゥートはこのサーバーが知っている分散型ネットワークの他のサーバーの人たちの最新の公開トゥートです。",
|
"dismissable_banner.public_timeline": "これらの投稿はこのサーバーが知っている分散型ネットワークの他のサーバーの人たちの最新の公開投稿です。",
|
||||||
"embed.instructions": "下記のコードをコピーしてウェブサイトに埋め込みます。",
|
"embed.instructions": "下記のコードをコピーしてウェブサイトに埋め込みます。",
|
||||||
"embed.preview": "表示例:",
|
"embed.preview": "表示例:",
|
||||||
"emoji_button.activity": "活動",
|
"emoji_button.activity": "活動",
|
||||||
@ -214,7 +209,7 @@
|
|||||||
"emoji_button.symbols": "記号",
|
"emoji_button.symbols": "記号",
|
||||||
"emoji_button.travel": "旅行と場所",
|
"emoji_button.travel": "旅行と場所",
|
||||||
"empty_column.account_suspended": "アカウントは停止されています",
|
"empty_column.account_suspended": "アカウントは停止されています",
|
||||||
"empty_column.account_timeline": "トゥートがありません!",
|
"empty_column.account_timeline": "投稿がありません!",
|
||||||
"empty_column.account_unavailable": "プロフィールは利用できません",
|
"empty_column.account_unavailable": "プロフィールは利用できません",
|
||||||
"empty_column.blocks": "まだ誰もブロックしていません。",
|
"empty_column.blocks": "まだ誰もブロックしていません。",
|
||||||
"empty_column.bookmarked_statuses": "まだ何もブックマーク登録していません。ブックマーク登録するとここに表示されます。",
|
"empty_column.bookmarked_statuses": "まだ何もブックマーク登録していません。ブックマーク登録するとここに表示されます。",
|
||||||
@ -230,11 +225,11 @@
|
|||||||
"empty_column.hashtag": "このハッシュタグはまだ使われていません。",
|
"empty_column.hashtag": "このハッシュタグはまだ使われていません。",
|
||||||
"empty_column.home": "ホームタイムラインはまだ空っぽです。誰かフォローして埋めてみましょう。 {suggestions}",
|
"empty_column.home": "ホームタイムラインはまだ空っぽです。誰かフォローして埋めてみましょう。 {suggestions}",
|
||||||
"empty_column.home.suggestions": "おすすめを見る",
|
"empty_column.home.suggestions": "おすすめを見る",
|
||||||
"empty_column.list": "このリストにはまだなにもありません。このリストのメンバーが新しいトゥートをするとここに表示されます。",
|
"empty_column.list": "このリストにはまだなにもありません。このリストのメンバーが新しい投稿をするとここに表示されます。",
|
||||||
"empty_column.lists": "まだリストがありません。リストを作るとここに表示されます。",
|
"empty_column.lists": "まだリストがありません。リストを作るとここに表示されます。",
|
||||||
"empty_column.mutes": "まだ誰もミュートしていません。",
|
"empty_column.mutes": "まだ誰もミュートしていません。",
|
||||||
"empty_column.notifications": "まだ通知がありません。他の人とふれ合って会話を始めましょう。",
|
"empty_column.notifications": "まだ通知がありません。他の人とふれ合って会話を始めましょう。",
|
||||||
"empty_column.public": "ここにはまだ何もありません! 公開で何かをトゥートしたり、他のサーバーのユーザーをフォローしたりしていっぱいにしましょう",
|
"empty_column.public": "ここにはまだ何もありません! 公開で何かを投稿したり、他のサーバーのユーザーをフォローしたりしていっぱいにしましょう",
|
||||||
"error.unexpected_crash.explanation": "不具合かブラウザの互換性問題のため、このページを正しく表示できませんでした。",
|
"error.unexpected_crash.explanation": "不具合かブラウザの互換性問題のため、このページを正しく表示できませんでした。",
|
||||||
"error.unexpected_crash.explanation_addons": "このページは正しく表示できませんでした。このエラーはブラウザのアドオンや自動翻訳ツールによって引き起こされることがあります。",
|
"error.unexpected_crash.explanation_addons": "このページは正しく表示できませんでした。このエラーはブラウザのアドオンや自動翻訳ツールによって引き起こされることがあります。",
|
||||||
"error.unexpected_crash.next_steps": "ページの再読み込みをお試しください。それでも解決しない場合、別のブラウザかアプリを使えば使用できることがあります。",
|
"error.unexpected_crash.next_steps": "ページの再読み込みをお試しください。それでも解決しない場合、別のブラウザかアプリを使えば使用できることがあります。",
|
||||||
@ -245,27 +240,27 @@
|
|||||||
"explore.suggested_follows": "おすすめ",
|
"explore.suggested_follows": "おすすめ",
|
||||||
"explore.title": "エクスプローラー",
|
"explore.title": "エクスプローラー",
|
||||||
"explore.trending_links": "ニュース",
|
"explore.trending_links": "ニュース",
|
||||||
"explore.trending_statuses": "トゥート",
|
"explore.trending_statuses": "投稿",
|
||||||
"explore.trending_tags": "ハッシュタグ",
|
"explore.trending_tags": "ハッシュタグ",
|
||||||
"filter_modal.added.context_mismatch_explanation": "このフィルターカテゴリーはあなたがアクセスしたトゥートのコンテキストには適用されません。このトゥートのコンテキストでもフィルターを適用するにはフィルターを編集する必要があります。",
|
"filter_modal.added.context_mismatch_explanation": "このフィルターカテゴリーはあなたがアクセスした投稿のコンテキストには適用されません。この投稿のコンテキストでもフィルターを適用するにはフィルターを編集する必要があります。",
|
||||||
"filter_modal.added.context_mismatch_title": "コンテキストが一致しません!",
|
"filter_modal.added.context_mismatch_title": "コンテキストが一致しません!",
|
||||||
"filter_modal.added.expired_explanation": "このフィルターカテゴリは有効期限が切れています。適用するには有効期限を更新してください。",
|
"filter_modal.added.expired_explanation": "このフィルターカテゴリは有効期限が切れています。適用するには有効期限を更新してください。",
|
||||||
"filter_modal.added.expired_title": "フィルターの有効期限が切れています!",
|
"filter_modal.added.expired_title": "フィルターの有効期限が切れています!",
|
||||||
"filter_modal.added.review_and_configure": "このフィルターカテゴリーを確認して設定するには、{settings_link}に移動します。",
|
"filter_modal.added.review_and_configure": "このフィルターカテゴリーを確認して設定するには、{settings_link}に移動します。",
|
||||||
"filter_modal.added.review_and_configure_title": "フィルター設定",
|
"filter_modal.added.review_and_configure_title": "フィルター設定",
|
||||||
"filter_modal.added.settings_link": "設定",
|
"filter_modal.added.settings_link": "設定",
|
||||||
"filter_modal.added.short_explanation": "このトゥートはフィルターカテゴリー『{title}』に追加されました。",
|
"filter_modal.added.short_explanation": "この投稿はフィルターカテゴリー『{title}』に追加されました。",
|
||||||
"filter_modal.added.title": "フィルターを追加しました!",
|
"filter_modal.added.title": "フィルターを追加しました!",
|
||||||
"filter_modal.select_filter.context_mismatch": "このコンテキストには当てはまりません",
|
"filter_modal.select_filter.context_mismatch": "このコンテキストには当てはまりません",
|
||||||
"filter_modal.select_filter.expired": "期限切れ",
|
"filter_modal.select_filter.expired": "期限切れ",
|
||||||
"filter_modal.select_filter.prompt_new": "新しいカテゴリー: {name}",
|
"filter_modal.select_filter.prompt_new": "新しいカテゴリー: {name}",
|
||||||
"filter_modal.select_filter.search": "検索または新規作成",
|
"filter_modal.select_filter.search": "検索または新規作成",
|
||||||
"filter_modal.select_filter.subtitle": "既存のカテゴリーを使用するか新規作成します",
|
"filter_modal.select_filter.subtitle": "既存のカテゴリーを使用するか新規作成します",
|
||||||
"filter_modal.select_filter.title": "このトゥートをフィルターする",
|
"filter_modal.select_filter.title": "この投稿をフィルターする",
|
||||||
"filter_modal.title.status": "トゥートをフィルターする",
|
"filter_modal.title.status": "投稿をフィルターする",
|
||||||
"follow_recommendations.done": "完了",
|
"follow_recommendations.done": "完了",
|
||||||
"follow_recommendations.heading": "トゥートを見たい人をフォローしてください!ここにおすすめがあります。",
|
"follow_recommendations.heading": "投稿を見たい人をフォローしてください!ここにおすすめがあります。",
|
||||||
"follow_recommendations.lead": "あなたがフォローしている人のトゥートは、ホームフィードに時系列で表示されます。いつでも簡単に解除できるので、気軽にフォローしてみてください!",
|
"follow_recommendations.lead": "あなたがフォローしている人の投稿は、ホームフィードに時系列で表示されます。いつでも簡単に解除できるので、気軽にフォローしてみてください!",
|
||||||
"follow_request.authorize": "許可",
|
"follow_request.authorize": "許可",
|
||||||
"follow_request.reject": "拒否",
|
"follow_request.reject": "拒否",
|
||||||
"follow_requests.unlocked_explanation": "あなたのアカウントは承認制ではありませんが、{domain}のスタッフはこれらのアカウントからのフォローリクエストの確認が必要であると判断しました。",
|
"follow_requests.unlocked_explanation": "あなたのアカウントは承認制ではありませんが、{domain}のスタッフはこれらのアカウントからのフォローリクエストの確認が必要であると判断しました。",
|
||||||
@ -296,18 +291,18 @@
|
|||||||
"home.column_settings.show_replies": "返信表示",
|
"home.column_settings.show_replies": "返信表示",
|
||||||
"home.hide_announcements": "お知らせを隠す",
|
"home.hide_announcements": "お知らせを隠す",
|
||||||
"home.show_announcements": "お知らせを表示",
|
"home.show_announcements": "お知らせを表示",
|
||||||
"interaction_modal.description.favourite": "Mastodonのアカウントでこのトゥートをお気に入りに入れてトゥート者に感謝を知らせたり保存することができます。",
|
"interaction_modal.description.favourite": "Mastodonのアカウントでこの投稿をお気に入りに入れて投稿者に感謝を知らせたり保存することができます。",
|
||||||
"interaction_modal.description.follow": "Mastodonのアカウントで{name}さんをフォローしてホームフィードでトゥートを受け取れます。",
|
"interaction_modal.description.follow": "Mastodonのアカウントで{name}さんをフォローしてホームフィードで投稿を受け取れます。",
|
||||||
"interaction_modal.description.reblog": "Mastodonのアカウントでこのトゥートをブーストして自分のフォロワーに共有できます。",
|
"interaction_modal.description.reblog": "Mastodonのアカウントでこの投稿をブーストして自分のフォロワーに共有できます。",
|
||||||
"interaction_modal.description.reply": "Mastodonのアカウントでこのトゥートに反応できます。",
|
"interaction_modal.description.reply": "Mastodonのアカウントでこの投稿に反応できます。",
|
||||||
"interaction_modal.on_another_server": "別のサーバー",
|
"interaction_modal.on_another_server": "別のサーバー",
|
||||||
"interaction_modal.on_this_server": "このサーバー",
|
"interaction_modal.on_this_server": "このサーバー",
|
||||||
"interaction_modal.other_server_instructions": "このURLをお気に入りのMastodonアプリやMastodonサーバーのWebインターフェースの検索フィールドにコピーして貼り付けます。",
|
"interaction_modal.other_server_instructions": "このURLをお気に入りのMastodonアプリやMastodonサーバーのWebインターフェースの検索フィールドにコピーして貼り付けます。",
|
||||||
"interaction_modal.preamble": "Mastodonは分散化されているためアカウントを持っていなくても別のMastodonサーバーまたは互換性のあるプラットフォームでホストされているアカウントを使用できます。",
|
"interaction_modal.preamble": "Mastodonは分散化されているためアカウントを持っていなくても別のMastodonサーバーまたは互換性のあるプラットフォームでホストされているアカウントを使用できます。",
|
||||||
"interaction_modal.title.favourite": "{name}さんのトゥートをお気に入り",
|
"interaction_modal.title.favourite": "{name}さんの投稿をお気に入り",
|
||||||
"interaction_modal.title.follow": "{name}さんをフォロー",
|
"interaction_modal.title.follow": "{name}さんをフォロー",
|
||||||
"interaction_modal.title.reblog": "{name}さんのトゥートをブースト",
|
"interaction_modal.title.reblog": "{name}さんの投稿をブースト",
|
||||||
"interaction_modal.title.reply": "{name}さんのトゥートにリプライ",
|
"interaction_modal.title.reply": "{name}さんの投稿にリプライ",
|
||||||
"intervals.full.days": "{number}日",
|
"intervals.full.days": "{number}日",
|
||||||
"intervals.full.hours": "{number}時間",
|
"intervals.full.hours": "{number}時間",
|
||||||
"intervals.full.minutes": "{number}分",
|
"intervals.full.minutes": "{number}分",
|
||||||
@ -315,11 +310,11 @@
|
|||||||
"keyboard_shortcuts.blocked": "ブロックしたユーザーのリストを開く",
|
"keyboard_shortcuts.blocked": "ブロックしたユーザーのリストを開く",
|
||||||
"keyboard_shortcuts.boost": "ブースト",
|
"keyboard_shortcuts.boost": "ブースト",
|
||||||
"keyboard_shortcuts.column": "左からn番目のカラムの最新に移動",
|
"keyboard_shortcuts.column": "左からn番目のカラムの最新に移動",
|
||||||
"keyboard_shortcuts.compose": "トゥートの入力欄に移動",
|
"keyboard_shortcuts.compose": "投稿の入力欄に移動",
|
||||||
"keyboard_shortcuts.description": "説明",
|
"keyboard_shortcuts.description": "説明",
|
||||||
"keyboard_shortcuts.direct": "ダイレクトメッセージのカラムを開く",
|
"keyboard_shortcuts.direct": "ダイレクトメッセージのカラムを開く",
|
||||||
"keyboard_shortcuts.down": "カラム内一つ下に移動",
|
"keyboard_shortcuts.down": "カラム内一つ下に移動",
|
||||||
"keyboard_shortcuts.enter": "トゥートの詳細を表示",
|
"keyboard_shortcuts.enter": "投稿の詳細を表示",
|
||||||
"keyboard_shortcuts.favourite": "お気に入り",
|
"keyboard_shortcuts.favourite": "お気に入り",
|
||||||
"keyboard_shortcuts.favourites": "お気に入り登録のリストを開く",
|
"keyboard_shortcuts.favourites": "お気に入り登録のリストを開く",
|
||||||
"keyboard_shortcuts.federated": "連合タイムラインを開く",
|
"keyboard_shortcuts.federated": "連合タイムラインを開く",
|
||||||
@ -333,7 +328,7 @@
|
|||||||
"keyboard_shortcuts.my_profile": "自分のプロフィールを開く",
|
"keyboard_shortcuts.my_profile": "自分のプロフィールを開く",
|
||||||
"keyboard_shortcuts.notifications": "通知カラムを開く",
|
"keyboard_shortcuts.notifications": "通知カラムを開く",
|
||||||
"keyboard_shortcuts.open_media": "メディアを開く",
|
"keyboard_shortcuts.open_media": "メディアを開く",
|
||||||
"keyboard_shortcuts.pinned": "固定したトゥートのリストを開く",
|
"keyboard_shortcuts.pinned": "固定した投稿のリストを開く",
|
||||||
"keyboard_shortcuts.profile": "プロフィールを開く",
|
"keyboard_shortcuts.profile": "プロフィールを開く",
|
||||||
"keyboard_shortcuts.reply": "返信",
|
"keyboard_shortcuts.reply": "返信",
|
||||||
"keyboard_shortcuts.requests": "フォローリクエストのリストを開く",
|
"keyboard_shortcuts.requests": "フォローリクエストのリストを開く",
|
||||||
@ -342,8 +337,8 @@
|
|||||||
"keyboard_shortcuts.start": "\"スタート\" カラムを開く",
|
"keyboard_shortcuts.start": "\"スタート\" カラムを開く",
|
||||||
"keyboard_shortcuts.toggle_hidden": "CWで隠れた文を見る/隠す",
|
"keyboard_shortcuts.toggle_hidden": "CWで隠れた文を見る/隠す",
|
||||||
"keyboard_shortcuts.toggle_sensitivity": "非表示のメディアを見る/隠す",
|
"keyboard_shortcuts.toggle_sensitivity": "非表示のメディアを見る/隠す",
|
||||||
"keyboard_shortcuts.toot": "新規トゥート",
|
"keyboard_shortcuts.toot": "新規投稿",
|
||||||
"keyboard_shortcuts.unfocus": "トゥートの入力欄・検索欄から離れる",
|
"keyboard_shortcuts.unfocus": "投稿の入力欄・検索欄から離れる",
|
||||||
"keyboard_shortcuts.up": "カラム内一つ上に移動",
|
"keyboard_shortcuts.up": "カラム内一つ上に移動",
|
||||||
"lightbox.close": "閉じる",
|
"lightbox.close": "閉じる",
|
||||||
"lightbox.compress": "画像ビューボックスを閉じる",
|
"lightbox.compress": "画像ビューボックスを閉じる",
|
||||||
@ -378,7 +373,7 @@
|
|||||||
"navigation_bar.blocks": "ブロックしたユーザー",
|
"navigation_bar.blocks": "ブロックしたユーザー",
|
||||||
"navigation_bar.bookmarks": "ブックマーク",
|
"navigation_bar.bookmarks": "ブックマーク",
|
||||||
"navigation_bar.community_timeline": "ローカルタイムライン",
|
"navigation_bar.community_timeline": "ローカルタイムライン",
|
||||||
"navigation_bar.compose": "トゥートの新規作成",
|
"navigation_bar.compose": "投稿の新規作成",
|
||||||
"navigation_bar.direct": "ダイレクトメッセージ",
|
"navigation_bar.direct": "ダイレクトメッセージ",
|
||||||
"navigation_bar.discover": "見つける",
|
"navigation_bar.discover": "見つける",
|
||||||
"navigation_bar.domain_blocks": "ブロックしたドメイン",
|
"navigation_bar.domain_blocks": "ブロックしたドメイン",
|
||||||
@ -393,7 +388,7 @@
|
|||||||
"navigation_bar.logout": "ログアウト",
|
"navigation_bar.logout": "ログアウト",
|
||||||
"navigation_bar.mutes": "ミュートしたユーザー",
|
"navigation_bar.mutes": "ミュートしたユーザー",
|
||||||
"navigation_bar.personal": "個人用",
|
"navigation_bar.personal": "個人用",
|
||||||
"navigation_bar.pins": "固定したトゥート",
|
"navigation_bar.pins": "固定した投稿",
|
||||||
"navigation_bar.preferences": "ユーザー設定",
|
"navigation_bar.preferences": "ユーザー設定",
|
||||||
"navigation_bar.public_timeline": "連合タイムライン",
|
"navigation_bar.public_timeline": "連合タイムライン",
|
||||||
"navigation_bar.search": "検索",
|
"navigation_bar.search": "検索",
|
||||||
@ -401,15 +396,15 @@
|
|||||||
"not_signed_in_indicator.not_signed_in": "この機能を使うにはログインする必要があります。",
|
"not_signed_in_indicator.not_signed_in": "この機能を使うにはログインする必要があります。",
|
||||||
"notification.admin.report": "{name}さんが{target}さんを通報しました",
|
"notification.admin.report": "{name}さんが{target}さんを通報しました",
|
||||||
"notification.admin.sign_up": "{name}さんがサインアップしました",
|
"notification.admin.sign_up": "{name}さんがサインアップしました",
|
||||||
"notification.favourite": "{name}さんがあなたのトゥートに╰( ^o^)╮-=ニ=一=三★しました",
|
"notification.favourite": "{name}さんがあなたの投稿をお気に入りに登録しました",
|
||||||
"notification.follow": "{name}さんにフォローされました",
|
"notification.follow": "{name}さんにフォローされました",
|
||||||
"notification.follow_request": "{name}さんがあなたにフォローリクエストしました",
|
"notification.follow_request": "{name}さんがあなたにフォローリクエストしました",
|
||||||
"notification.mention": "{name}さんがあなたに返信しました",
|
"notification.mention": "{name}さんがあなたに返信しました",
|
||||||
"notification.own_poll": "アンケートが終了しました",
|
"notification.own_poll": "アンケートが終了しました",
|
||||||
"notification.poll": "アンケートが終了しました",
|
"notification.poll": "アンケートが終了しました",
|
||||||
"notification.reblog": "{name}さんがあなたのトゥートをブーストしました",
|
"notification.reblog": "{name}さんがあなたの投稿をブーストしました",
|
||||||
"notification.status": "{name}さんがトゥートしました",
|
"notification.status": "{name}さんが投稿しました",
|
||||||
"notification.update": "{name}さんがトゥートを編集しました",
|
"notification.update": "{name}さんが投稿を編集しました",
|
||||||
"notifications.clear": "通知を消去",
|
"notifications.clear": "通知を消去",
|
||||||
"notifications.clear_confirmation": "本当に通知を消去しますか?",
|
"notifications.clear_confirmation": "本当に通知を消去しますか?",
|
||||||
"notifications.column_settings.admin.report": "新しい通報:",
|
"notifications.column_settings.admin.report": "新しい通報:",
|
||||||
@ -427,7 +422,7 @@
|
|||||||
"notifications.column_settings.reblog": "ブースト:",
|
"notifications.column_settings.reblog": "ブースト:",
|
||||||
"notifications.column_settings.show": "カラムに表示",
|
"notifications.column_settings.show": "カラムに表示",
|
||||||
"notifications.column_settings.sound": "通知音を再生",
|
"notifications.column_settings.sound": "通知音を再生",
|
||||||
"notifications.column_settings.status": "新しいトゥート:",
|
"notifications.column_settings.status": "新しい投稿:",
|
||||||
"notifications.column_settings.unread_notifications.category": "未読の通知:",
|
"notifications.column_settings.unread_notifications.category": "未読の通知:",
|
||||||
"notifications.column_settings.unread_notifications.highlight": "未読の通知を強調表示",
|
"notifications.column_settings.unread_notifications.highlight": "未読の通知を強調表示",
|
||||||
"notifications.column_settings.update": "編集:",
|
"notifications.column_settings.update": "編集:",
|
||||||
@ -484,20 +479,20 @@
|
|||||||
"relative_time.today": "今日",
|
"relative_time.today": "今日",
|
||||||
"reply_indicator.cancel": "キャンセル",
|
"reply_indicator.cancel": "キャンセル",
|
||||||
"report.block": "ブロック",
|
"report.block": "ブロック",
|
||||||
"report.block_explanation": "相手のトゥートが表示されなくなります。相手はあなたのトゥートを見ることやフォローすることができません。相手はブロックされていることがわかります。",
|
"report.block_explanation": "相手の投稿が表示されなくなります。相手はあなたの投稿を見ることやフォローすることができません。相手はブロックされていることがわかります。",
|
||||||
"report.categories.other": "その他",
|
"report.categories.other": "その他",
|
||||||
"report.categories.spam": "スパム",
|
"report.categories.spam": "スパム",
|
||||||
"report.categories.violation": "サーバーのルールに違反",
|
"report.categories.violation": "サーバーのルールに違反",
|
||||||
"report.category.subtitle": "近いものを選択してください",
|
"report.category.subtitle": "近いものを選択してください",
|
||||||
"report.category.title": "この{type}について教えてください",
|
"report.category.title": "この{type}について教えてください",
|
||||||
"report.category.title_account": "プロフィール",
|
"report.category.title_account": "プロフィール",
|
||||||
"report.category.title_status": "トゥート",
|
"report.category.title_status": "投稿",
|
||||||
"report.close": "完了",
|
"report.close": "完了",
|
||||||
"report.comment.title": "その他に私たちに伝えておくべき事はありますか?",
|
"report.comment.title": "その他に私たちに伝えておくべき事はありますか?",
|
||||||
"report.forward": "{target}に転送する",
|
"report.forward": "{target}に転送する",
|
||||||
"report.forward_hint": "このアカウントは別のサーバーに所属しています。通報内容を匿名で転送しますか?",
|
"report.forward_hint": "このアカウントは別のサーバーに所属しています。通報内容を匿名で転送しますか?",
|
||||||
"report.mute": "ミュート",
|
"report.mute": "ミュート",
|
||||||
"report.mute_explanation": "相手のトゥートは表示されなくなります。相手は引き続きあなたをフォローして、あなたのトゥートを表示することができますが、ミュートされていることはわかりません。",
|
"report.mute_explanation": "相手の投稿は表示されなくなります。相手は引き続きあなたをフォローして、あなたの投稿を表示することができますが、ミュートされていることはわかりません。",
|
||||||
"report.next": "次へ",
|
"report.next": "次へ",
|
||||||
"report.placeholder": "追加コメント",
|
"report.placeholder": "追加コメント",
|
||||||
"report.reasons.dislike": "興味がありません",
|
"report.reasons.dislike": "興味がありません",
|
||||||
@ -511,7 +506,7 @@
|
|||||||
"report.rules.subtitle": "当てはまるものをすべて選んでください:",
|
"report.rules.subtitle": "当てはまるものをすべて選んでください:",
|
||||||
"report.rules.title": "どのルールに違反していますか?",
|
"report.rules.title": "どのルールに違反していますか?",
|
||||||
"report.statuses.subtitle": "当てはまるものをすべて選んでください:",
|
"report.statuses.subtitle": "当てはまるものをすべて選んでください:",
|
||||||
"report.statuses.title": "この通報を裏付けるようなトゥートはありますか?",
|
"report.statuses.title": "この通報を裏付けるような投稿はありますか?",
|
||||||
"report.submit": "通報する",
|
"report.submit": "通報する",
|
||||||
"report.target": "{target}さんを通報する",
|
"report.target": "{target}さんを通報する",
|
||||||
"report.thanks.take_action": "次のような方法はいかがでしょうか?",
|
"report.thanks.take_action": "次のような方法はいかがでしょうか?",
|
||||||
@ -519,8 +514,8 @@
|
|||||||
"report.thanks.title": "見えないようにしたいですか?",
|
"report.thanks.title": "見えないようにしたいですか?",
|
||||||
"report.thanks.title_actionable": "ご報告ありがとうございます、追って確認します。",
|
"report.thanks.title_actionable": "ご報告ありがとうございます、追って確認します。",
|
||||||
"report.unfollow": "@{name}さんのフォローを解除",
|
"report.unfollow": "@{name}さんのフォローを解除",
|
||||||
"report.unfollow_explanation": "このアカウントをフォローしています。ホームフィードに彼らのトゥートを表示しないようにするには、彼らのフォローを外してください。",
|
"report.unfollow_explanation": "このアカウントをフォローしています。ホームフィードに彼らの投稿を表示しないようにするには、彼らのフォローを外してください。",
|
||||||
"report_notification.attached_statuses": "{count, plural, one {{count}件のトゥート} other {{count}件のトゥート}}が添付されました。",
|
"report_notification.attached_statuses": "{count, plural, one {{count}件の投稿} other {{count}件の投稿}}が添付されました。",
|
||||||
"report_notification.categories.other": "その他",
|
"report_notification.categories.other": "その他",
|
||||||
"report_notification.categories.spam": "スパム",
|
"report_notification.categories.spam": "スパム",
|
||||||
"report_notification.categories.violation": "ルール違反",
|
"report_notification.categories.violation": "ルール違反",
|
||||||
@ -528,17 +523,17 @@
|
|||||||
"search.placeholder": "検索",
|
"search.placeholder": "検索",
|
||||||
"search.search_or_paste": "検索またはURLを入力",
|
"search.search_or_paste": "検索またはURLを入力",
|
||||||
"search_popout.search_format": "高度な検索フォーマット",
|
"search_popout.search_format": "高度な検索フォーマット",
|
||||||
"search_popout.tips.full_text": "表示名やユーザー名、ハッシュタグのほか、あなたのトゥートやお気に入り、ブーストしたトゥート、返信に一致する単純なテキスト。",
|
"search_popout.tips.full_text": "表示名やユーザー名、ハッシュタグのほか、あなたの投稿やお気に入り、ブーストした投稿、返信に一致する単純なテキスト。",
|
||||||
"search_popout.tips.hashtag": "ハッシュタグ",
|
"search_popout.tips.hashtag": "ハッシュタグ",
|
||||||
"search_popout.tips.status": "トゥート",
|
"search_popout.tips.status": "投稿",
|
||||||
"search_popout.tips.text": "表示名やユーザー名、ハッシュタグに一致する単純なテキスト",
|
"search_popout.tips.text": "表示名やユーザー名、ハッシュタグに一致する単純なテキスト",
|
||||||
"search_popout.tips.user": "ユーザー",
|
"search_popout.tips.user": "ユーザー",
|
||||||
"search_results.accounts": "人々",
|
"search_results.accounts": "人々",
|
||||||
"search_results.all": "すべて",
|
"search_results.all": "すべて",
|
||||||
"search_results.hashtags": "ハッシュタグ",
|
"search_results.hashtags": "ハッシュタグ",
|
||||||
"search_results.nothing_found": "この検索条件では何も見つかりませんでした",
|
"search_results.nothing_found": "この検索条件では何も見つかりませんでした",
|
||||||
"search_results.statuses": "トゥート",
|
"search_results.statuses": "投稿",
|
||||||
"search_results.statuses_fts_disabled": "このサーバーではトゥート本文の検索は利用できません。",
|
"search_results.statuses_fts_disabled": "このサーバーでは投稿本文の検索は利用できません。",
|
||||||
"search_results.title": "『{q}』の検索結果",
|
"search_results.title": "『{q}』の検索結果",
|
||||||
"search_results.total": "{count, number}件の結果",
|
"search_results.total": "{count, number}件の結果",
|
||||||
"server_banner.about_active_users": "過去30日間にこのサーバーを使用している人 (月間アクティブユーザー)",
|
"server_banner.about_active_users": "過去30日間にこのサーバーを使用している人 (月間アクティブユーザー)",
|
||||||
@ -549,16 +544,15 @@
|
|||||||
"server_banner.server_stats": "サーバーの情報",
|
"server_banner.server_stats": "サーバーの情報",
|
||||||
"sign_in_banner.create_account": "アカウント作成",
|
"sign_in_banner.create_account": "アカウント作成",
|
||||||
"sign_in_banner.sign_in": "ログイン",
|
"sign_in_banner.sign_in": "ログイン",
|
||||||
"sign_in_banner.text": "ログインしてプロファイルやハッシュタグ、お気に入りをフォローしたり、トゥートを共有したり、返信したり、別のサーバーのアカウントと交流したりできます。",
|
"sign_in_banner.text": "ログインしてプロファイルやハッシュタグ、お気に入りをフォローしたり、投稿を共有したり、返信したり、別のサーバーのアカウントと交流したりできます。",
|
||||||
"status.admin_account": "@{name}さんのモデレーション画面を開く",
|
"status.admin_account": "@{name}さんのモデレーション画面を開く",
|
||||||
"status.admin_domain": "{domain}のモデレーション画面を開く",
|
"status.admin_domain": "{domain}のモデレーション画面を開く",
|
||||||
"status.admin_status": "このトゥートをモデレーション画面で開く",
|
"status.admin_status": "この投稿をモデレーション画面で開く",
|
||||||
"status.block": "@{name}さんをブロック",
|
"status.block": "@{name}さんをブロック",
|
||||||
"status.bookmark": "ブックマーク",
|
"status.bookmark": "ブックマーク",
|
||||||
"status.cancel_reblog_private": "ブースト解除",
|
"status.cancel_reblog_private": "ブースト解除",
|
||||||
"status.cannot_reblog": "このトゥートはブーストできません",
|
"status.cannot_reblog": "この投稿はブーストできません",
|
||||||
"status.copy": "トゥートへのリンクをコピー",
|
"status.copy": "投稿へのリンクをコピー",
|
||||||
"status.cannot_quote": "このトゥートは引用できません",
|
|
||||||
"status.delete": "削除",
|
"status.delete": "削除",
|
||||||
"status.detailed_status": "詳細な会話ビュー",
|
"status.detailed_status": "詳細な会話ビュー",
|
||||||
"status.direct": "@{name}さんにダイレクトメッセージ",
|
"status.direct": "@{name}さんにダイレクトメッセージ",
|
||||||
@ -567,22 +561,20 @@
|
|||||||
"status.edited_x_times": "{count}回編集",
|
"status.edited_x_times": "{count}回編集",
|
||||||
"status.embed": "埋め込み",
|
"status.embed": "埋め込み",
|
||||||
"status.favourite": "お気に入り",
|
"status.favourite": "お気に入り",
|
||||||
"status.filter": "このトゥートをフィルターする",
|
"status.filter": "この投稿をフィルターする",
|
||||||
"status.filtered": "フィルターされました",
|
"status.filtered": "フィルターされました",
|
||||||
"status.hide": "トゥートを非表示",
|
"status.hide": "投稿を非表示",
|
||||||
"status.history.created": "{name}さんが{date}に作成",
|
"status.history.created": "{name}さんが{date}に作成",
|
||||||
"status.history.edited": "{name}さんが{date}に編集",
|
"status.history.edited": "{name}さんが{date}に編集",
|
||||||
"status.load_more": "もっと見る",
|
"status.load_more": "もっと見る",
|
||||||
"status.media_hidden": "非表示のメディア",
|
"status.media_hidden": "非表示のメディア",
|
||||||
"status.mention": "@{name}さんにトゥート",
|
"status.mention": "@{name}さんに投稿",
|
||||||
"status.more": "もっと見る",
|
"status.more": "もっと見る",
|
||||||
"status.mute": "@{name}さんをミュート",
|
"status.mute": "@{name}さんをミュート",
|
||||||
"status.mute_conversation": "会話をミュート",
|
"status.mute_conversation": "会話をミュート",
|
||||||
"status.muted_quote": "ミュートされた引用",
|
|
||||||
"status.open": "詳細を表示",
|
"status.open": "詳細を表示",
|
||||||
"status.pin": "プロフィールに固定表示",
|
"status.pin": "プロフィールに固定表示",
|
||||||
"status.pinned": "固定されたトゥート",
|
"status.pinned": "固定された投稿",
|
||||||
"status.quote": "引用",
|
|
||||||
"status.read_more": "もっと見る",
|
"status.read_more": "もっと見る",
|
||||||
"status.reblog": "ブースト",
|
"status.reblog": "ブースト",
|
||||||
"status.reblog_private": "ブースト",
|
"status.reblog_private": "ブースト",
|
||||||
@ -605,10 +597,9 @@
|
|||||||
"status.translate": "翻訳",
|
"status.translate": "翻訳",
|
||||||
"status.translated_from_with": "{provider}を使って{lang}から翻訳",
|
"status.translated_from_with": "{provider}を使って{lang}から翻訳",
|
||||||
"status.uncached_media_warning": "利用できません",
|
"status.uncached_media_warning": "利用できません",
|
||||||
"status.unlisted_quote": "未収載の引用",
|
|
||||||
"status.unmute_conversation": "会話のミュートを解除",
|
"status.unmute_conversation": "会話のミュートを解除",
|
||||||
"status.unpin": "プロフィールへの固定を解除",
|
"status.unpin": "プロフィールへの固定を解除",
|
||||||
"subscribed_languages.lead": "選択した言語のトゥートだけがホームとリストのタイムラインに表示されます。全ての言語のトゥートを受け取る場合は全てのチェックを外して下さい。",
|
"subscribed_languages.lead": "選択した言語の投稿だけがホームとリストのタイムラインに表示されます。全ての言語の投稿を受け取る場合は全てのチェックを外して下さい。",
|
||||||
"subscribed_languages.save": "変更を保存",
|
"subscribed_languages.save": "変更を保存",
|
||||||
"subscribed_languages.target": "{target}さんの購読言語を変更します",
|
"subscribed_languages.target": "{target}さんの購読言語を変更します",
|
||||||
"suggestions.dismiss": "隠す",
|
"suggestions.dismiss": "隠す",
|
||||||
@ -625,10 +616,10 @@
|
|||||||
"timeline_hint.remote_resource_not_displayed": "他のサーバーの{resource}は表示されません。",
|
"timeline_hint.remote_resource_not_displayed": "他のサーバーの{resource}は表示されません。",
|
||||||
"timeline_hint.resources.followers": "フォロワー",
|
"timeline_hint.resources.followers": "フォロワー",
|
||||||
"timeline_hint.resources.follows": "フォロー",
|
"timeline_hint.resources.follows": "フォロー",
|
||||||
"timeline_hint.resources.statuses": "以前のトゥート",
|
"timeline_hint.resources.statuses": "以前の投稿",
|
||||||
"trends.counter_by_accounts": "過去{days, plural, one {{days}日} other {{days}日}}に{count, plural, one {{counter}人} other {{counter} 人}}",
|
"trends.counter_by_accounts": "過去{days, plural, one {{days}日} other {{days}日}}に{count, plural, one {{counter}人} other {{counter} 人}}",
|
||||||
"trends.trending_now": "トレンドタグ",
|
"trends.trending_now": "トレンドタグ",
|
||||||
"ui.beforeunload": "Mastodonから離れると送信前のトゥートは失われます。",
|
"ui.beforeunload": "Mastodonから離れると送信前の投稿は失われます。",
|
||||||
"units.short.billion": "{count}B",
|
"units.short.billion": "{count}B",
|
||||||
"units.short.million": "{count}M",
|
"units.short.million": "{count}M",
|
||||||
"units.short.thousand": "{count}K",
|
"units.short.thousand": "{count}K",
|
||||||
|
@ -4,8 +4,6 @@ import {
|
|||||||
COMPOSE_CHANGE,
|
COMPOSE_CHANGE,
|
||||||
COMPOSE_REPLY,
|
COMPOSE_REPLY,
|
||||||
COMPOSE_REPLY_CANCEL,
|
COMPOSE_REPLY_CANCEL,
|
||||||
COMPOSE_QUOTE,
|
|
||||||
COMPOSE_QUOTE_CANCEL,
|
|
||||||
COMPOSE_DIRECT,
|
COMPOSE_DIRECT,
|
||||||
COMPOSE_MENTION,
|
COMPOSE_MENTION,
|
||||||
COMPOSE_SUBMIT_REQUEST,
|
COMPOSE_SUBMIT_REQUEST,
|
||||||
@ -69,8 +67,6 @@ const initialState = ImmutableMap({
|
|||||||
caretPosition: null,
|
caretPosition: null,
|
||||||
preselectDate: null,
|
preselectDate: null,
|
||||||
in_reply_to: null,
|
in_reply_to: null,
|
||||||
quote_from: null,
|
|
||||||
quote_from_url: null,
|
|
||||||
is_composing: false,
|
is_composing: false,
|
||||||
is_submitting: false,
|
is_submitting: false,
|
||||||
is_changing_upload: false,
|
is_changing_upload: false,
|
||||||
@ -123,8 +119,6 @@ function clearAll(state) {
|
|||||||
map.set('is_submitting', false);
|
map.set('is_submitting', false);
|
||||||
map.set('is_changing_upload', false);
|
map.set('is_changing_upload', false);
|
||||||
map.set('in_reply_to', null);
|
map.set('in_reply_to', null);
|
||||||
map.set('quote_from', null);
|
|
||||||
map.set('quote_from_url', null);
|
|
||||||
map.set('privacy', state.get('default_privacy'));
|
map.set('privacy', state.get('default_privacy'));
|
||||||
map.set('sensitive', state.get('default_sensitive'));
|
map.set('sensitive', state.get('default_sensitive'));
|
||||||
map.set('language', state.get('default_language'));
|
map.set('language', state.get('default_language'));
|
||||||
@ -256,17 +250,6 @@ const expiresInFromExpiresAt = expires_at => {
|
|||||||
return [300, 1800, 3600, 21600, 86400, 259200, 604800].find(expires_in => expires_in >= delta) || 24 * 3600;
|
return [300, 1800, 3600, 21600, 86400, 259200, 604800].find(expires_in => expires_in >= delta) || 24 * 3600;
|
||||||
};
|
};
|
||||||
|
|
||||||
const rejectQuoteAltText = html => {
|
|
||||||
const fragment = domParser.parseFromString(html, 'text/html').documentElement;
|
|
||||||
|
|
||||||
const quote_inline = fragment.querySelector('span.quote-inline');
|
|
||||||
if (quote_inline) {
|
|
||||||
quote_inline.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
return fragment.innerHTML;
|
|
||||||
};
|
|
||||||
|
|
||||||
const mergeLocalHashtagResults = (suggestions, prefix, tagHistory) => {
|
const mergeLocalHashtagResults = (suggestions, prefix, tagHistory) => {
|
||||||
prefix = prefix.toLowerCase();
|
prefix = prefix.toLowerCase();
|
||||||
if (suggestions.length < 4) {
|
if (suggestions.length < 4) {
|
||||||
@ -340,20 +323,10 @@ export default function compose(state = initialState, action) {
|
|||||||
case COMPOSE_COMPOSING_CHANGE:
|
case COMPOSE_COMPOSING_CHANGE:
|
||||||
return state.set('is_composing', action.value);
|
return state.set('is_composing', action.value);
|
||||||
case COMPOSE_REPLY:
|
case COMPOSE_REPLY:
|
||||||
case COMPOSE_QUOTE:
|
|
||||||
return state.withMutations(map => {
|
return state.withMutations(map => {
|
||||||
map.set('id', null);
|
map.set('id', null);
|
||||||
if (action.type === COMPOSE_REPLY) {
|
map.set('in_reply_to', action.status.get('id'));
|
||||||
map.set('in_reply_to', action.status.get('id'));
|
map.set('text', statusToTextMentions(state, action.status));
|
||||||
map.set('quote_from', null);
|
|
||||||
map.set('quote_from_url', null);
|
|
||||||
map.set('text', statusToTextMentions(state, action.status));
|
|
||||||
} else {
|
|
||||||
map.set('in_reply_to', null);
|
|
||||||
map.set('quote_from', action.status.get('id'));
|
|
||||||
map.set('quote_from_url', action.status.get('url'));
|
|
||||||
map.set('text', '');
|
|
||||||
}
|
|
||||||
map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
|
map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
|
||||||
map.set('focusDate', new Date());
|
map.set('focusDate', new Date());
|
||||||
map.set('caretPosition', null);
|
map.set('caretPosition', null);
|
||||||
@ -385,7 +358,6 @@ export default function compose(state = initialState, action) {
|
|||||||
case COMPOSE_UPLOAD_CHANGE_REQUEST:
|
case COMPOSE_UPLOAD_CHANGE_REQUEST:
|
||||||
return state.set('is_changing_upload', true);
|
return state.set('is_changing_upload', true);
|
||||||
case COMPOSE_REPLY_CANCEL:
|
case COMPOSE_REPLY_CANCEL:
|
||||||
case COMPOSE_QUOTE_CANCEL:
|
|
||||||
case COMPOSE_RESET:
|
case COMPOSE_RESET:
|
||||||
case COMPOSE_SUBMIT_SUCCESS:
|
case COMPOSE_SUBMIT_SUCCESS:
|
||||||
return clearAll(state);
|
return clearAll(state);
|
||||||
@ -484,10 +456,8 @@ export default function compose(state = initialState, action) {
|
|||||||
}));
|
}));
|
||||||
case REDRAFT:
|
case REDRAFT:
|
||||||
return state.withMutations(map => {
|
return state.withMutations(map => {
|
||||||
map.set('text', action.raw_text || unescapeHTML(rejectQuoteAltText(expandMentions(action.status))));
|
map.set('text', action.raw_text || unescapeHTML(expandMentions(action.status)));
|
||||||
map.set('in_reply_to', action.status.get('in_reply_to_id'));
|
map.set('in_reply_to', action.status.get('in_reply_to_id'));
|
||||||
map.set('quote_from', action.status.getIn(['quote', 'id']));
|
|
||||||
map.set('quote_from_url', action.status.getIn(['quote', 'url']));
|
|
||||||
map.set('privacy', action.status.get('visibility'));
|
map.set('privacy', action.status.get('visibility'));
|
||||||
map.set('media_attachments', action.status.get('media_attachments').map((media) => media.set('unattached', true)));
|
map.set('media_attachments', action.status.get('media_attachments').map((media) => media.set('unattached', true)));
|
||||||
map.set('focusDate', new Date());
|
map.set('focusDate', new Date());
|
||||||
|
@ -10,7 +10,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
COMPOSE_MENTION,
|
COMPOSE_MENTION,
|
||||||
COMPOSE_REPLY,
|
COMPOSE_REPLY,
|
||||||
COMPOSE_QUOTE,
|
|
||||||
COMPOSE_DIRECT,
|
COMPOSE_DIRECT,
|
||||||
} from '../actions/compose';
|
} from '../actions/compose';
|
||||||
import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable';
|
import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable';
|
||||||
@ -38,7 +37,6 @@ export default function search(state = initialState, action) {
|
|||||||
case SEARCH_SHOW:
|
case SEARCH_SHOW:
|
||||||
return state.set('hidden', false);
|
return state.set('hidden', false);
|
||||||
case COMPOSE_REPLY:
|
case COMPOSE_REPLY:
|
||||||
case COMPOSE_QUOTE:
|
|
||||||
case COMPOSE_MENTION:
|
case COMPOSE_MENTION:
|
||||||
case COMPOSE_DIRECT:
|
case COMPOSE_DIRECT:
|
||||||
return state.set('hidden', true);
|
return state.set('hidden', true);
|
||||||
|
@ -17,8 +17,6 @@ import {
|
|||||||
STATUS_TRANSLATE_UNDO,
|
STATUS_TRANSLATE_UNDO,
|
||||||
STATUS_FETCH_REQUEST,
|
STATUS_FETCH_REQUEST,
|
||||||
STATUS_FETCH_FAIL,
|
STATUS_FETCH_FAIL,
|
||||||
QUOTE_REVEAL,
|
|
||||||
QUOTE_HIDE,
|
|
||||||
} from '../actions/statuses';
|
} from '../actions/statuses';
|
||||||
import { TIMELINE_DELETE } from '../actions/timelines';
|
import { TIMELINE_DELETE } from '../actions/timelines';
|
||||||
import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer';
|
import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer';
|
||||||
@ -85,14 +83,6 @@ export default function statuses(state = initialState, action) {
|
|||||||
});
|
});
|
||||||
case STATUS_COLLAPSE:
|
case STATUS_COLLAPSE:
|
||||||
return state.setIn([action.id, 'collapsed'], action.isCollapsed);
|
return state.setIn([action.id, 'collapsed'], action.isCollapsed);
|
||||||
case QUOTE_REVEAL:
|
|
||||||
return state.withMutations(map => {
|
|
||||||
action.ids.forEach(id => map.setIn([id, 'quote_hidden'], false));
|
|
||||||
});
|
|
||||||
case QUOTE_HIDE:
|
|
||||||
return state.withMutations(map => {
|
|
||||||
action.ids.forEach(id => map.setIn([id, 'quote_hidden'], true));
|
|
||||||
});
|
|
||||||
case TIMELINE_DELETE:
|
case TIMELINE_DELETE:
|
||||||
return deleteStatus(state, action.id, action.references);
|
return deleteStatus(state, action.id, action.references);
|
||||||
case STATUS_TRANSLATE_SUCCESS:
|
case STATUS_TRANSLATE_SUCCESS:
|
||||||
|
@ -2,7 +2,6 @@ import { createSelector } from 'reselect';
|
|||||||
import { List as ImmutableList, Map as ImmutableMap } from 'immutable';
|
import { List as ImmutableList, Map as ImmutableMap } from 'immutable';
|
||||||
import { toServerSideType } from 'mastodon/utils/filters';
|
import { toServerSideType } from 'mastodon/utils/filters';
|
||||||
import { me } from '../initial_state';
|
import { me } from '../initial_state';
|
||||||
import {reblogRequest} from '../actions/interactions';
|
|
||||||
|
|
||||||
const getAccountBase = (state, id) => state.getIn(['accounts', id], null);
|
const getAccountBase = (state, id) => state.getIn(['accounts', id], null);
|
||||||
const getAccountCounters = (state, id) => state.getIn(['accounts_counters', id], null);
|
const getAccountCounters = (state, id) => state.getIn(['accounts_counters', id], null);
|
||||||
@ -36,54 +35,22 @@ export const makeGetStatus = () => {
|
|||||||
[
|
[
|
||||||
(state, { id }) => state.getIn(['statuses', id]),
|
(state, { id }) => state.getIn(['statuses', id]),
|
||||||
(state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'reblog'])]),
|
(state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'reblog'])]),
|
||||||
(state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'quote_id'])]),
|
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['statuses', id, 'account'])]),
|
(state, { id }) => state.getIn(['accounts', state.getIn(['statuses', id, 'account'])]),
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'reblog']), 'account'])]),
|
(state, { id }) => state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'reblog']), 'account'])]),
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'quote_id']), 'account'])]),
|
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'reblog']), 'quote', 'account'])]),
|
|
||||||
(state, { id }) => state.getIn(['relationships', state.getIn(['statuses', id, 'account'])]),
|
|
||||||
(state, { id }) => state.getIn(['relationships', state.getIn(['statuses', state.getIn(['statuses', id, 'reblog']), 'account'])]),
|
|
||||||
(state, { id }) => state.getIn(['relationships', state.getIn(['statuses', state.getIn(['statuses', id, 'quote_id']), 'account'])]),
|
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['accounts', state.getIn(['statuses', id, 'account']), 'moved'])]),
|
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'reblog']), 'account']), 'moved'])]),
|
|
||||||
(state, { id }) => state.getIn(['accounts', state.getIn(['accounts', state.getIn(['statuses', state.getIn(['statuses', id, 'quote_id']), 'account']), 'moved'])]),
|
|
||||||
getFilters,
|
getFilters,
|
||||||
],
|
],
|
||||||
|
|
||||||
(statusBase, statusReblog, statusQuote, accountBase, accountReblog, accountQuote, accountReblogQuote, relationshipBase, relationshipReblog, relationshipQuote, movedBase, movedReblog, movedQuote, filters) => {
|
(statusBase, statusReblog, accountBase, accountReblog, filters) => {
|
||||||
if (!statusBase || statusBase.get('isLoading')) {
|
if (!statusBase || statusBase.get('isLoading')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
accountBase = accountBase.withMutations(map => {
|
|
||||||
map.set('relationship', relationshipBase);
|
|
||||||
map.set('moved', movedBase);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (statusReblog) {
|
if (statusReblog) {
|
||||||
accountReblog = accountReblog.withMutations(map => {
|
|
||||||
map.set('relationship', relationshipReblog);
|
|
||||||
map.set('moved', movedReblog);
|
|
||||||
});
|
|
||||||
statusReblog = statusReblog.set('account', accountReblog);
|
statusReblog = statusReblog.set('account', accountReblog);
|
||||||
} else {
|
} else {
|
||||||
statusReblog = null;
|
statusReblog = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statusQuote) {
|
|
||||||
accountQuote = accountQuote.withMutations(map => {
|
|
||||||
map.set('relationship', relationshipQuote);
|
|
||||||
map.set('moved', movedQuote);
|
|
||||||
});
|
|
||||||
statusQuote = statusQuote.set('account', accountQuote);
|
|
||||||
} else {
|
|
||||||
statusQuote = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (statusReblog && accountReblogQuote) {
|
|
||||||
statusReblog = statusReblog.setIn(['quote', 'account'], accountReblogQuote);
|
|
||||||
}
|
|
||||||
|
|
||||||
let filtered = false;
|
let filtered = false;
|
||||||
if ((accountReblog || accountBase).get('id') !== me && filters) {
|
if ((accountReblog || accountBase).get('id') !== me && filters) {
|
||||||
let filterResults = statusReblog?.get('filtered') || statusBase.get('filtered') || ImmutableList();
|
let filterResults = statusReblog?.get('filtered') || statusBase.get('filtered') || ImmutableList();
|
||||||
@ -98,7 +65,6 @@ export const makeGetStatus = () => {
|
|||||||
|
|
||||||
return statusBase.withMutations(map => {
|
return statusBase.withMutations(map => {
|
||||||
map.set('reblog', statusReblog);
|
map.set('reblog', statusReblog);
|
||||||
map.set('quote', statusQuote);
|
|
||||||
map.set('account', accountBase);
|
map.set('account', accountBase);
|
||||||
map.set('matched_filters', filtered);
|
map.set('matched_filters', filtered);
|
||||||
});
|
});
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export const uniq = (array) => array.filter((x, i, self) => self.indexOf(x) === i);
|
|
@ -322,29 +322,6 @@ function main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
delegate(document, '.quote-status', 'click', ({ target }) => {
|
|
||||||
if (target.closest('.status__content__spoiler-link') ||
|
|
||||||
target.closest('.media-gallery') ||
|
|
||||||
target.closest('.video-player') ||
|
|
||||||
target.closest('.audio-player')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
let url = target.closest('.quote-status').getAttribute('dataurl');
|
|
||||||
if (target.closest('.status__display-name')) {
|
|
||||||
url = target.closest('.status__display-name').getAttribute('href');
|
|
||||||
} else if (target.closest('.status-card')) {
|
|
||||||
url = target.closest('.status-card').getAttribute('href');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (window.location.hostname === url.split('/')[2].split(':')[0]) {
|
|
||||||
window.location.href = url;
|
|
||||||
} else {
|
|
||||||
window.open(url, 'blank');
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPolyfills()
|
loadPolyfills()
|
||||||
|
@ -23,5 +23,3 @@
|
|||||||
@import 'mastodon/dashboard';
|
@import 'mastodon/dashboard';
|
||||||
@import 'mastodon/rtl';
|
@import 'mastodon/rtl';
|
||||||
@import 'mastodon/accessibility';
|
@import 'mastodon/accessibility';
|
||||||
|
|
||||||
@import 'plugin';
|
|
@ -1,3 +0,0 @@
|
|||||||
@import 'light-pink/variables';
|
|
||||||
@import 'application';
|
|
||||||
@import 'mastodon-light/diff';
|
|
@ -1,44 +0,0 @@
|
|||||||
// Dependent colors
|
|
||||||
$black: #000000;
|
|
||||||
$white: #ffffff;
|
|
||||||
|
|
||||||
$classic-base-color: #6e202f;
|
|
||||||
$classic-primary-color: #ffa7ae;
|
|
||||||
$classic-secondary-color: #faeef1;
|
|
||||||
$classic-highlight-color: #ff375b;
|
|
||||||
|
|
||||||
// Differences
|
|
||||||
$success-green: lighten(#3c754d, 8%);
|
|
||||||
|
|
||||||
$base-overlay-background: $white !default;
|
|
||||||
$valid-value-color: $success-green !default;
|
|
||||||
|
|
||||||
$ui-base-color: $classic-secondary-color !default;
|
|
||||||
$ui-base-lighter-color: #ffe1e9;
|
|
||||||
$ui-primary-color: #f1adbf;
|
|
||||||
$ui-secondary-color: $classic-base-color !default;
|
|
||||||
$ui-highlight-color: $classic-highlight-color !default;
|
|
||||||
|
|
||||||
$primary-text-color: $black !default;
|
|
||||||
$darker-text-color: $classic-base-color !default;
|
|
||||||
$highlight-text-color: darken($ui-highlight-color, 8%) !default;
|
|
||||||
$dark-text-color: #6e202f;
|
|
||||||
$action-button-color: #ffa7ae;
|
|
||||||
|
|
||||||
$inverted-text-color: $black !default;
|
|
||||||
$lighter-text-color: $classic-base-color !default;
|
|
||||||
$light-text-color: #ffa7ae;
|
|
||||||
|
|
||||||
// Newly added colors
|
|
||||||
$account-background-color: $white !default;
|
|
||||||
|
|
||||||
// Invert darkened and lightened colors
|
|
||||||
@function darken($color, $amount) {
|
|
||||||
@return hsl(hue($color), saturation($color), lightness($color) + $amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@function lighten($color, $amount) {
|
|
||||||
@return hsl(hue($color), saturation($color), lightness($color) - $amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
$emojis-requiring-inversion: 'chains';
|
|
@ -736,29 +736,10 @@ body > [data-popper-placement] {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
padding-top: 10px;
|
|
||||||
|
|
||||||
.compose-form__publish-button-wrapper {
|
.compose-form__publish-button-wrapper {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
button {
|
|
||||||
display: inline-block;
|
|
||||||
width: auto;
|
|
||||||
|
|
||||||
margin-right: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:last-child {
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.compose-form__utilBtns {
|
|
||||||
padding-top: 10px;
|
|
||||||
|
|
||||||
* {
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -827,10 +808,6 @@ body > [data-popper-placement] {
|
|||||||
min-height: 23px;
|
min-height: 23px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
flex: 0 2 auto;
|
flex: 0 2 auto;
|
||||||
|
|
||||||
&.quote-indicator {
|
|
||||||
background: $success-green;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.reply-indicator__header {
|
.reply-indicator__header {
|
||||||
@ -1012,10 +989,6 @@ body > [data-popper-placement] {
|
|||||||
|
|
||||||
.status__content.status__content--collapsed {
|
.status__content.status__content--collapsed {
|
||||||
max-height: 22px * 15; // 15 lines is roughly above 500 characters
|
max-height: 22px * 15; // 15 lines is roughly above 500 characters
|
||||||
|
|
||||||
.quote-status & {
|
|
||||||
max-height: 22px * 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.status__content__read-more-button {
|
.status__content__read-more-button {
|
||||||
@ -1088,69 +1061,6 @@ body > [data-popper-placement] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.quote-status {
|
|
||||||
border: solid 1px $ui-base-lighter-color;
|
|
||||||
border-radius: 4px !important;
|
|
||||||
padding: 5px !important;
|
|
||||||
margin-top: 8px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.muted-quote,
|
|
||||||
.unlisted-quote button {
|
|
||||||
color: $dark-text-color;
|
|
||||||
font-size: 15px;
|
|
||||||
width: 100%;
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.muted-quote {
|
|
||||||
text-align: center;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.unlisted-quote button {
|
|
||||||
background-color: transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
appearance: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status__avatar,
|
|
||||||
.detailed-status__display-avatar {
|
|
||||||
position: absolute;
|
|
||||||
top: 5px !important;
|
|
||||||
left: 5px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-name {
|
|
||||||
padding-left: 56px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detailed-status__display-name {
|
|
||||||
margin-bottom: 0;
|
|
||||||
line-height: unset;
|
|
||||||
|
|
||||||
strong,
|
|
||||||
span {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status__content__text {
|
|
||||||
p {
|
|
||||||
display: inline;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.quote-inline {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.focusable {
|
.focusable {
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
@ -1166,12 +1076,9 @@ body > [data-popper-placement] {
|
|||||||
.status {
|
.status {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
min-height: 54px;
|
min-height: 54px;
|
||||||
|
border-bottom: 1px solid lighten($ui-base-color, 8%);
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
|
|
||||||
&:not(.quote-status) {
|
|
||||||
border-bottom: 1px solid lighten($ui-base-color, 8%);
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fade {
|
@keyframes fade {
|
||||||
0% { opacity: 0; }
|
0% { opacity: 0; }
|
||||||
100% { opacity: 1; }
|
100% { opacity: 1; }
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
.detailed-status,
|
.detailed-status,
|
||||||
.status:not(.quote-status),
|
.status,
|
||||||
.load-more {
|
.load-more {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
border-radius: 0 0 4px 4px;
|
border-radius: 0 0 4px 4px;
|
||||||
@ -63,18 +63,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.detailed-status .quote-status {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.quote-status {
|
|
||||||
margin-top: 15px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 740px) {
|
@media screen and (max-width: 740px) {
|
||||||
.detailed-status,
|
.detailed-status,
|
||||||
.status:not(.quote-status),
|
.status,
|
||||||
.load-more {
|
.load-more {
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
@ -86,10 +77,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.standalone-timeline .quote-status {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button.logo-button {
|
.button.logo-button {
|
||||||
flex: 0 auto;
|
flex: 0 auto;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
// ここから下タブバーの実装
|
|
||||||
|
|
||||||
//投稿ボタン
|
|
||||||
.columns-area__panels__main .button.bottom_right {
|
|
||||||
position: fixed;
|
|
||||||
right: 18px;
|
|
||||||
bottom: 65px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 64px;
|
|
||||||
height: 64px;
|
|
||||||
font-size: 24px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-ber-bottom .navber {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 630px) {
|
|
||||||
.tab-ber-bottom .timeline{
|
|
||||||
width:100%;
|
|
||||||
height: calc(100% - 55px);
|
|
||||||
margin: 0 0 50px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-ber-bottom .navber{
|
|
||||||
display: flex;
|
|
||||||
width:100%;
|
|
||||||
bottom: 0;
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-ber-bottom .navber .tabs-bar__wrapper{
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.columns-area__panels__pane-tab-ber{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//ここまで下タブバーの実装
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit a58c699a605784b3318f54717bfaaa804db4d2f3
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit a5c22831445f5669315434f7df49c3c1e1f70d20
|
|
@ -76,7 +76,6 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
@silenced_account_ids = []
|
@silenced_account_ids = []
|
||||||
@params = {}
|
@params = {}
|
||||||
|
|
||||||
process_quote
|
|
||||||
process_status_params
|
process_status_params
|
||||||
process_tags
|
process_tags
|
||||||
process_audience
|
process_audience
|
||||||
@ -84,16 +83,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
ApplicationRecord.transaction do
|
ApplicationRecord.transaction do
|
||||||
@status = Status.create!(@params)
|
@status = Status.create!(@params)
|
||||||
attach_tags(@status)
|
attach_tags(@status)
|
||||||
|
|
||||||
# Delete status on zero follower user and nearly created account with include some replies
|
|
||||||
if like_a_spam?
|
|
||||||
@status = nil
|
|
||||||
raise ActiveRecord::Rollback
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return if @status.nil?
|
|
||||||
|
|
||||||
resolve_thread(@status)
|
resolve_thread(@status)
|
||||||
fetch_replies(@status)
|
fetch_replies(@status)
|
||||||
distribute
|
distribute
|
||||||
@ -111,7 +102,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
def find_existing_status
|
def find_existing_status
|
||||||
status = status_from_uri(object_uri)
|
status = status_from_uri(object_uri)
|
||||||
status ||= Status.find_by(uri: @object['atomUri']) if @object['atomUri'].present?
|
status ||= Status.find_by(uri: @object['atomUri']) if @object['atomUri'].present?
|
||||||
status if status&.account_id == @account.id
|
status
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_status_params
|
def process_status_params
|
||||||
@ -135,7 +126,6 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
conversation: conversation_from_uri(@object['conversation']),
|
conversation: conversation_from_uri(@object['conversation']),
|
||||||
media_attachment_ids: process_attachments.take(4).map(&:id),
|
media_attachment_ids: process_attachments.take(4).map(&:id),
|
||||||
poll: process_poll,
|
poll: process_poll,
|
||||||
quote: @quote,
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -436,33 +426,4 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
poll.reload
|
poll.reload
|
||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_quote
|
|
||||||
if (@quote = quote_from_url(@object['quoteUrl']))
|
|
||||||
/<br><br>RE:\s<\/span><a.*<\/a>/.match(@object['content']) do |m|
|
|
||||||
@object['content'] = @object['content'].sub(m[0], "</span><span class=\"quote-inline\">#{m[0].sub(/<\/span>/, '')}</span>")
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def quote_from_url(url)
|
|
||||||
return nil if url.nil?
|
|
||||||
quote = ResolveURLService.new.call(url)
|
|
||||||
status_from_uri(quote.uri) if quote
|
|
||||||
rescue
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
SPAM_FILTER_MINIMUM_FOLLOWERS = ENV.fetch('SPAM_FILTER_MINIMUM_FOLLOWERS', 0).to_i
|
|
||||||
SPAM_FILTER_MINIMUM_CREATE_DAYS = ENV.fetch('SPAM_FILTER_MINIMUM_CREATE_DAYS', 1).to_i
|
|
||||||
SPAM_FILTER_MINIMUM_MENTIONS = ENV.fetch('SPAM_FILTER_MINIMUM_MENTIONS', 1).to_i
|
|
||||||
def like_a_spam?
|
|
||||||
(
|
|
||||||
!@status.account.local? &&
|
|
||||||
@status.account.followers_count <= SPAM_FILTER_MINIMUM_FOLLOWERS &&
|
|
||||||
@status.account.created_at > SPAM_FILTER_MINIMUM_CREATE_DAYS.day.ago &&
|
|
||||||
@mentions.count > SPAM_FILTER_MINIMUM_MENTIONS
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -14,8 +14,6 @@ module ActivityPub::CaseTransform
|
|||||||
when String
|
when String
|
||||||
camel_lower_cache[value] ||= if value.start_with?('_:')
|
camel_lower_cache[value] ||= if value.start_with?('_:')
|
||||||
'_:' + value.gsub(/\A_:/, '').underscore.camelize(:lower)
|
'_:' + value.gsub(/\A_:/, '').underscore.camelize(:lower)
|
||||||
elsif value.start_with?('_')
|
|
||||||
value
|
|
||||||
else
|
else
|
||||||
value.underscore.camelize(:lower)
|
value.underscore.camelize(:lower)
|
||||||
end
|
end
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
class ActivityPub::Parser::StatusParser
|
class ActivityPub::Parser::StatusParser
|
||||||
include JsonLdHelper
|
include JsonLdHelper
|
||||||
|
|
||||||
NORMALIZED_LOCALE_NAMES = LanguagesHelper::SUPPORTED_LOCALES.keys.index_by(&:downcase).freeze
|
|
||||||
|
|
||||||
# @param [Hash] json
|
# @param [Hash] json
|
||||||
# @param [Hash] magic_values
|
# @param [Hash] magic_values
|
||||||
# @option magic_values [String] :followers_collection
|
# @option magic_values [String] :followers_collection
|
||||||
@ -88,13 +86,6 @@ class ActivityPub::Parser::StatusParser
|
|||||||
end
|
end
|
||||||
|
|
||||||
def language
|
def language
|
||||||
lang = raw_language_code
|
|
||||||
lang.presence && NORMALIZED_LOCALE_NAMES.fetch(lang.downcase.to_sym, lang)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def raw_language_code
|
|
||||||
if content_language_map?
|
if content_language_map?
|
||||||
@object['contentMap'].keys.first
|
@object['contentMap'].keys.first
|
||||||
elsif name_language_map?
|
elsif name_language_map?
|
||||||
@ -104,6 +95,8 @@ class ActivityPub::Parser::StatusParser
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
def audience_to
|
def audience_to
|
||||||
as_array(@object['to'] || @json['to']).map { |x| value_or_id(x) }
|
as_array(@object['to'] || @json['to']).map { |x| value_or_id(x) }
|
||||||
end
|
end
|
||||||
|
@ -14,19 +14,17 @@ module ApplicationExtension
|
|||||||
# dependent: delete_all, which means the ActiveRecord callback in
|
# dependent: delete_all, which means the ActiveRecord callback in
|
||||||
# AccessTokenExtension is not run, so instead we manually announce to
|
# AccessTokenExtension is not run, so instead we manually announce to
|
||||||
# streaming that these tokens are being deleted.
|
# streaming that these tokens are being deleted.
|
||||||
before_destroy :close_streaming_sessions, prepend: true
|
before_destroy :push_to_streaming_api, prepend: true
|
||||||
end
|
end
|
||||||
|
|
||||||
def confirmation_redirect_uri
|
def confirmation_redirect_uri
|
||||||
redirect_uri.lines.first.strip
|
redirect_uri.lines.first.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def close_streaming_sessions(resource_owner = nil)
|
def push_to_streaming_api
|
||||||
# TODO: #28793 Combine into a single topic
|
# TODO: #28793 Combine into a single topic
|
||||||
payload = Oj.dump(event: :kill)
|
payload = Oj.dump(event: :kill)
|
||||||
scope = access_tokens
|
access_tokens.in_batches do |tokens|
|
||||||
scope = scope.where(resource_owner_id: resource_owner.id) unless resource_owner.nil?
|
|
||||||
scope.in_batches do |tokens|
|
|
||||||
redis.pipelined do |pipeline|
|
redis.pipelined do |pipeline|
|
||||||
tokens.ids.each do |id|
|
tokens.ids.each do |id|
|
||||||
pipeline.publish("timeline:access_token:#{id}", payload)
|
pipeline.publish("timeline:access_token:#{id}", payload)
|
||||||
|
@ -255,21 +255,16 @@ class LinkDetailsExtractor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def document
|
def document
|
||||||
@document ||= detect_encoding_and_parse_document
|
@document ||= Nokogiri::HTML(@html, nil, encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
def detect_encoding_and_parse_document
|
def encoding
|
||||||
[detect_encoding, nil, @html_charset, 'UTF-8'].uniq.each do |encoding|
|
@encoding ||= begin
|
||||||
document = Nokogiri::HTML(@html, nil, encoding)
|
guess = detector.detect(@html, @html_charset)
|
||||||
return document if document.to_s.valid_encoding?
|
guess&.fetch(:confidence, 0).to_i > 60 ? guess&.fetch(:encoding, nil) : nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def detect_encoding
|
|
||||||
guess = detector.detect(@html, @html_charset)
|
|
||||||
guess&.fetch(:confidence, 0).to_i > 60 ? guess&.fetch(:encoding, nil) : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def detector
|
def detector
|
||||||
@detector ||= CharlockHolmes::EncodingDetector.new.tap do |detector|
|
@detector ||= CharlockHolmes::EncodingDetector.new.tap do |detector|
|
||||||
detector.strip_tags = true
|
detector.strip_tags = true
|
||||||
|
@ -101,7 +101,7 @@ class SearchQueryTransformer < Parslet::Transform
|
|||||||
end
|
end
|
||||||
|
|
||||||
rule(clause: subtree(:clause)) do
|
rule(clause: subtree(:clause)) do
|
||||||
prefix = clause[:prefix][:term].to_s.downcase if clause[:prefix]
|
prefix = clause[:prefix][:term].to_s if clause[:prefix]
|
||||||
operator = clause[:operator]&.to_s
|
operator = clause[:operator]&.to_s
|
||||||
|
|
||||||
if clause[:prefix]
|
if clause[:prefix]
|
||||||
|
@ -13,8 +13,7 @@ class TextFormatter
|
|||||||
multiline: true,
|
multiline: true,
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
attr_accessor :text
|
attr_reader :text, :options
|
||||||
attr_reader :options
|
|
||||||
|
|
||||||
# @param [String] text
|
# @param [String] text
|
||||||
# @param [Hash] options
|
# @param [Hash] options
|
||||||
@ -22,7 +21,6 @@ class TextFormatter
|
|||||||
# @option options [Boolean] :with_domains
|
# @option options [Boolean] :with_domains
|
||||||
# @option options [Boolean] :with_rel_me
|
# @option options [Boolean] :with_rel_me
|
||||||
# @option options [Array<Account>] :preloaded_accounts
|
# @option options [Array<Account>] :preloaded_accounts
|
||||||
# @option options [Status] :quote
|
|
||||||
def initialize(text, options = {})
|
def initialize(text, options = {})
|
||||||
@text = text
|
@text = text
|
||||||
@options = DEFAULT_OPTIONS.merge(options)
|
@options = DEFAULT_OPTIONS.merge(options)
|
||||||
@ -33,7 +31,7 @@ class TextFormatter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
return ''.html_safe if text.blank? & !quote?
|
return ''.html_safe if text.blank?
|
||||||
|
|
||||||
html = rewrite do |entity|
|
html = rewrite do |entity|
|
||||||
if entity[:url]
|
if entity[:url]
|
||||||
@ -45,8 +43,6 @@ class TextFormatter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
html += render_quote if quote?
|
|
||||||
|
|
||||||
html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?
|
html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?
|
||||||
|
|
||||||
html.html_safe # rubocop:disable Rails/OutputSafety
|
html.html_safe # rubocop:disable Rails/OutputSafety
|
||||||
@ -130,7 +126,7 @@ class TextFormatter
|
|||||||
|
|
||||||
return "@#{h(entity[:screen_name])}" if account.nil?
|
return "@#{h(entity[:screen_name])}" if account.nil?
|
||||||
|
|
||||||
url = ap_tag_manager.url_for(account)
|
url = ActivityPub::TagManager.instance.url_for(account)
|
||||||
display_username = same_username_hits&.positive? || with_domains? ? account.pretty_acct : account.username
|
display_username = same_username_hits&.positive? || with_domains? ? account.pretty_acct : account.username
|
||||||
|
|
||||||
<<~HTML.squish
|
<<~HTML.squish
|
||||||
@ -138,13 +134,6 @@ class TextFormatter
|
|||||||
HTML
|
HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_quote
|
|
||||||
link = link_to_url({ url: ap_tag_manager.url_for(quote) })
|
|
||||||
<<~HTML.squish
|
|
||||||
<span class="quote-inline"><br/>~~~~~~~~~~<br/>[#{link}]</span>
|
|
||||||
HTML
|
|
||||||
end
|
|
||||||
|
|
||||||
def entity_cache
|
def entity_cache
|
||||||
@entity_cache ||= EntityCache.instance
|
@entity_cache ||= EntityCache.instance
|
||||||
end
|
end
|
||||||
@ -153,10 +142,6 @@ class TextFormatter
|
|||||||
@tag_manager ||= TagManager.instance
|
@tag_manager ||= TagManager.instance
|
||||||
end
|
end
|
||||||
|
|
||||||
def ap_tag_manager
|
|
||||||
@ap_tag_manager ||= ActivityPub::TagManager.instance
|
|
||||||
end
|
|
||||||
|
|
||||||
delegate :local_domain?, to: :tag_manager
|
delegate :local_domain?, to: :tag_manager
|
||||||
|
|
||||||
def multiline?
|
def multiline?
|
||||||
@ -178,12 +163,4 @@ class TextFormatter
|
|||||||
def preloaded_accounts?
|
def preloaded_accounts?
|
||||||
preloaded_accounts.present?
|
preloaded_accounts.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def quote
|
|
||||||
options[:quote]
|
|
||||||
end
|
|
||||||
|
|
||||||
def quote?
|
|
||||||
quote.present?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -39,7 +39,6 @@ class UserSettingsDecorator
|
|||||||
user.settings['trends'] = trends_preference if change?('setting_trends')
|
user.settings['trends'] = trends_preference if change?('setting_trends')
|
||||||
user.settings['crop_images'] = crop_images_preference if change?('setting_crop_images')
|
user.settings['crop_images'] = crop_images_preference if change?('setting_crop_images')
|
||||||
user.settings['always_send_emails'] = always_send_emails_preference if change?('setting_always_send_emails')
|
user.settings['always_send_emails'] = always_send_emails_preference if change?('setting_always_send_emails')
|
||||||
user.settings['place_tab_bar_at_bottom'] = place_tab_bar_at_bottom_preference if change?('setting_place_tab_bar_at_bottom')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def merged_notification_emails
|
def merged_notification_emails
|
||||||
@ -138,10 +137,6 @@ class UserSettingsDecorator
|
|||||||
boolean_cast_setting 'setting_always_send_emails'
|
boolean_cast_setting 'setting_always_send_emails'
|
||||||
end
|
end
|
||||||
|
|
||||||
def place_tab_bar_at_bottom_preference
|
|
||||||
boolean_cast_setting 'setting_place_tab_bar_at_bottom'
|
|
||||||
end
|
|
||||||
|
|
||||||
def boolean_cast_setting(key)
|
def boolean_cast_setting(key)
|
||||||
ActiveModel::Type::Boolean.new.cast(settings[key])
|
ActiveModel::Type::Boolean.new.cast(settings[key])
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,7 @@ class VideoMetadataExtractor
|
|||||||
private
|
private
|
||||||
|
|
||||||
def ffmpeg_command_output
|
def ffmpeg_command_output
|
||||||
command = Terrapin::CommandLine.new(Rails.configuration.x.ffprobe_binary, '-i :path -print_format :format -show_format -show_streams -show_error -loglevel :loglevel')
|
command = Terrapin::CommandLine.new('ffprobe', '-i :path -print_format :format -show_format -show_streams -show_error -loglevel :loglevel')
|
||||||
command.run(path: @path, format: 'json', loglevel: 'fatal')
|
command.run(path: @path, format: 'json', loglevel: 'fatal')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,13 +47,4 @@ class AdminMailer < ApplicationMailer
|
|||||||
mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trends.subject', instance: @instance)
|
mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trends.subject', instance: @instance)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_close_registrations(recipient)
|
|
||||||
@me = recipient
|
|
||||||
@instance = Rails.configuration.x.local_domain
|
|
||||||
|
|
||||||
locale_for_account(@me) do
|
|
||||||
mail to: @me.user_email, subject: I18n.t('admin_mailer.auto_close_registrations.subject', instance: @instance)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -187,7 +187,7 @@ module AccountInteractions
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unblock_domain!(other_domain)
|
def unblock_domain!(other_domain)
|
||||||
block = domain_blocks.find_by(domain: normalized_domain(other_domain))
|
block = domain_blocks.find_by(domain: other_domain)
|
||||||
block&.destroy
|
block&.destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -299,8 +299,4 @@ module AccountInteractions
|
|||||||
def remove_potential_friendship(other_account)
|
def remove_potential_friendship(other_account)
|
||||||
PotentialFriendshipTracker.remove(id, other_account.id)
|
PotentialFriendshipTracker.remove(id, other_account.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalized_domain(domain)
|
|
||||||
TagManager.instance.normalize_domain(domain)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -14,10 +14,6 @@ module Cacheable
|
|||||||
includes(@cache_associated)
|
includes(@cache_associated)
|
||||||
end
|
end
|
||||||
|
|
||||||
def preload_cacheable_associations(records)
|
|
||||||
ActiveRecord::Associations::Preloader.new.preload(records, @cache_associated)
|
|
||||||
end
|
|
||||||
|
|
||||||
def cache_ids
|
def cache_ids
|
||||||
select(:id, :updated_at)
|
select(:id, :updated_at)
|
||||||
end
|
end
|
||||||
|
@ -28,7 +28,7 @@ class Feed
|
|||||||
unhydrated = redis.zrangebyscore(key, "(#{min_id}", "(#{max_id}", limit: [0, limit], with_scores: true).map(&:first).map(&:to_i)
|
unhydrated = redis.zrangebyscore(key, "(#{min_id}", "(#{max_id}", limit: [0, limit], with_scores: true).map(&:first).map(&:to_i)
|
||||||
end
|
end
|
||||||
|
|
||||||
Status.where(id: unhydrated)
|
Status.where(id: unhydrated).cache_ids
|
||||||
end
|
end
|
||||||
|
|
||||||
def key
|
def key
|
||||||
|
@ -29,7 +29,7 @@ class PublicFeed
|
|||||||
scope.merge!(media_only_scope) if media_only?
|
scope.merge!(media_only_scope) if media_only?
|
||||||
scope.merge!(language_scope) if account&.chosen_languages.present?
|
scope.merge!(language_scope) if account&.chosen_languages.present?
|
||||||
|
|
||||||
scope.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
|
scope.cache_ids.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
# account_id :bigint(8) not null
|
# account_id :bigint(8) not null
|
||||||
# application_id :bigint(8)
|
# application_id :bigint(8)
|
||||||
# in_reply_to_account_id :bigint(8)
|
# in_reply_to_account_id :bigint(8)
|
||||||
# quote_id :bigint(8)
|
|
||||||
# poll_id :bigint(8)
|
# poll_id :bigint(8)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# edited_at :datetime
|
# edited_at :datetime
|
||||||
@ -60,7 +59,6 @@ class Status < ApplicationRecord
|
|||||||
|
|
||||||
belongs_to :thread, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :replies, optional: true
|
belongs_to :thread, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :replies, optional: true
|
||||||
belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblogs, optional: true
|
belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblogs, optional: true
|
||||||
belongs_to :quote, foreign_key: 'quote_id', class_name: 'Status', inverse_of: :quoted, optional: true
|
|
||||||
|
|
||||||
has_many :favourites, inverse_of: :status, dependent: :destroy
|
has_many :favourites, inverse_of: :status, dependent: :destroy
|
||||||
has_many :bookmarks, inverse_of: :status, dependent: :destroy
|
has_many :bookmarks, inverse_of: :status, dependent: :destroy
|
||||||
@ -71,7 +69,6 @@ class Status < ApplicationRecord
|
|||||||
has_many :mentioned_accounts, through: :mentions, source: :account, class_name: 'Account'
|
has_many :mentioned_accounts, through: :mentions, source: :account, class_name: 'Account'
|
||||||
has_many :active_mentions, -> { active }, class_name: 'Mention', inverse_of: :status
|
has_many :active_mentions, -> { active }, class_name: 'Mention', inverse_of: :status
|
||||||
has_many :media_attachments, dependent: :nullify
|
has_many :media_attachments, dependent: :nullify
|
||||||
has_many :quoted, foreign_key: 'quote_id', class_name: 'Status', inverse_of: :quote, dependent: :nullify
|
|
||||||
|
|
||||||
has_and_belongs_to_many :tags
|
has_and_belongs_to_many :tags
|
||||||
has_and_belongs_to_many :preview_cards
|
has_and_belongs_to_many :preview_cards
|
||||||
@ -87,7 +84,6 @@ class Status < ApplicationRecord
|
|||||||
validates_with DisallowedHashtagsValidator
|
validates_with DisallowedHashtagsValidator
|
||||||
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
|
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
|
||||||
validates :visibility, exclusion: { in: %w(direct limited) }, if: :reblog?
|
validates :visibility, exclusion: { in: %w(direct limited) }, if: :reblog?
|
||||||
validates :quote_visibility, inclusion: { in: %w(public unlisted) }, if: :quote?
|
|
||||||
|
|
||||||
accepts_nested_attributes_for :poll
|
accepts_nested_attributes_for :poll
|
||||||
|
|
||||||
@ -195,14 +191,6 @@ class Status < ApplicationRecord
|
|||||||
!reblog_of_id.nil?
|
!reblog_of_id.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
def quote?
|
|
||||||
!quote_id.nil? && quote
|
|
||||||
end
|
|
||||||
|
|
||||||
def quote_visibility
|
|
||||||
quote&.visibility
|
|
||||||
end
|
|
||||||
|
|
||||||
def within_realtime_window?
|
def within_realtime_window?
|
||||||
created_at >= REAL_TIME_WINDOW.ago
|
created_at >= REAL_TIME_WINDOW.ago
|
||||||
end
|
end
|
||||||
@ -267,12 +255,7 @@ class Status < ApplicationRecord
|
|||||||
fields = [spoiler_text, text]
|
fields = [spoiler_text, text]
|
||||||
fields += preloadable_poll.options unless preloadable_poll.nil?
|
fields += preloadable_poll.options unless preloadable_poll.nil?
|
||||||
|
|
||||||
quote_fields = []
|
@emojis = CustomEmoji.from_text(fields.join(' '), account.domain)
|
||||||
quote_fields += [quote.spoiler_text, quote.text] if quote?
|
|
||||||
quote_fields += quote.preloadable_poll.options unless quote&.preloadable_poll.nil?
|
|
||||||
|
|
||||||
@emojis = CustomEmoji.from_text(fields.join(' '), account.domain) +
|
|
||||||
CustomEmoji.from_text(quote_fields.join(' '), quote&.account&.domain)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def ordered_media_attachments
|
def ordered_media_attachments
|
||||||
@ -361,6 +344,38 @@ class Status < ApplicationRecord
|
|||||||
StatusPin.select('status_id').where(status_id: status_ids).where(account_id: account_id).each_with_object({}) { |p, h| h[p.status_id] = true }
|
StatusPin.select('status_id').where(status_id: status_ids).where(account_id: account_id).each_with_object({}) { |p, h| h[p.status_id] = true }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def reload_stale_associations!(cached_items)
|
||||||
|
account_ids = []
|
||||||
|
|
||||||
|
cached_items.each do |item|
|
||||||
|
account_ids << item.account_id
|
||||||
|
account_ids << item.reblog.account_id if item.reblog?
|
||||||
|
end
|
||||||
|
|
||||||
|
account_ids.uniq!
|
||||||
|
|
||||||
|
status_ids = cached_items.map { |item| item.reblog? ? item.reblog_of_id : item.id }.uniq
|
||||||
|
|
||||||
|
return if account_ids.empty?
|
||||||
|
|
||||||
|
accounts = Account.where(id: account_ids).includes(:account_stat, :user).index_by(&:id)
|
||||||
|
|
||||||
|
status_stats = StatusStat.where(status_id: status_ids).index_by(&:status_id)
|
||||||
|
|
||||||
|
cached_items.each do |item|
|
||||||
|
item.account = accounts[item.account_id]
|
||||||
|
item.reblog.account = accounts[item.reblog.account_id] if item.reblog?
|
||||||
|
|
||||||
|
if item.reblog?
|
||||||
|
status_stat = status_stats[item.reblog.id]
|
||||||
|
item.reblog.status_stat = status_stat if status_stat.present?
|
||||||
|
else
|
||||||
|
status_stat = status_stats[item.id]
|
||||||
|
item.status_stat = status_stat if status_stat.present?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def from_text(text)
|
def from_text(text)
|
||||||
return [] if text.blank?
|
return [] if text.blank?
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class StatusEdit < ApplicationRecord
|
|||||||
default_scope { order(id: :asc) }
|
default_scope { order(id: :asc) }
|
||||||
|
|
||||||
delegate :local?, :application, :edited?, :edited_at,
|
delegate :local?, :application, :edited?, :edited_at,
|
||||||
:discarded?, :visibility, :language, to: :status
|
:discarded?, :visibility, to: :status
|
||||||
|
|
||||||
def emojis
|
def emojis
|
||||||
return @emojis if defined?(@emojis)
|
return @emojis if defined?(@emojis)
|
||||||
|
@ -33,7 +33,7 @@ class TagFeed < PublicFeed
|
|||||||
scope.merge!(account_filters_scope) if account?
|
scope.merge!(account_filters_scope) if account?
|
||||||
scope.merge!(media_only_scope) if media_only?
|
scope.merge!(media_only_scope) if media_only?
|
||||||
|
|
||||||
scope.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
|
scope.cache_ids.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -94,9 +94,6 @@ class User < ApplicationRecord
|
|||||||
validates :invite_request, presence: true, on: :create, if: :invite_text_required?
|
validates :invite_request, presence: true, on: :create, if: :invite_text_required?
|
||||||
|
|
||||||
validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale?
|
validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale?
|
||||||
|
|
||||||
validates :email, presence: true, email_address: true
|
|
||||||
|
|
||||||
validates_with BlacklistedEmailValidator, if: -> { ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed? }
|
validates_with BlacklistedEmailValidator, if: -> { ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed? }
|
||||||
validates_with EmailMxValidator, if: :validate_email_dns?
|
validates_with EmailMxValidator, if: :validate_email_dns?
|
||||||
validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create
|
validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create
|
||||||
@ -139,7 +136,6 @@ class User < ApplicationRecord
|
|||||||
:expand_spoilers, :default_language, :aggregate_reblogs, :show_application,
|
:expand_spoilers, :default_language, :aggregate_reblogs, :show_application,
|
||||||
:advanced_layout, :use_blurhash, :use_pending_items, :trends, :crop_images,
|
:advanced_layout, :use_blurhash, :use_pending_items, :trends, :crop_images,
|
||||||
:disable_swiping, :always_send_emails,
|
:disable_swiping, :always_send_emails,
|
||||||
:place_tab_bar_at_bottom,
|
|
||||||
to: :settings, prefix: :setting, allow_nil: false
|
to: :settings, prefix: :setting, allow_nil: false
|
||||||
|
|
||||||
delegate :can?, to: :role
|
delegate :can?, to: :role
|
||||||
|
@ -11,9 +11,6 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||||||
:atom_uri, :in_reply_to_atom_uri,
|
:atom_uri, :in_reply_to_atom_uri,
|
||||||
:conversation
|
:conversation
|
||||||
|
|
||||||
attribute :quote_url, if: -> { object.quote? }
|
|
||||||
attribute :misskey_quote, key: :_misskey_quote, if: -> { object.quote? }
|
|
||||||
attribute :misskey_content, key: :_misskey_content, if: -> { object.quote? }
|
|
||||||
attribute :content
|
attribute :content
|
||||||
attribute :content_map, if: :language?
|
attribute :content_map, if: :language?
|
||||||
attribute :updated, if: :edited?
|
attribute :updated, if: :edited?
|
||||||
@ -141,16 +138,6 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def quote_url
|
|
||||||
ActivityPub::TagManager.instance.uri_for(object.quote) if object.quote?
|
|
||||||
end
|
|
||||||
|
|
||||||
alias misskey_quote quote_url
|
|
||||||
|
|
||||||
def misskey_content
|
|
||||||
object.text if object.quote?
|
|
||||||
end
|
|
||||||
|
|
||||||
def local?
|
def local?
|
||||||
object.account.local?
|
object.account.local?
|
||||||
end
|
end
|
||||||
|
@ -51,7 +51,6 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||||||
store[:use_pending_items] = object.current_account.user.setting_use_pending_items
|
store[:use_pending_items] = object.current_account.user.setting_use_pending_items
|
||||||
store[:trends] = Setting.trends && object.current_account.user.setting_trends
|
store[:trends] = Setting.trends && object.current_account.user.setting_trends
|
||||||
store[:crop_images] = object.current_account.user.setting_crop_images
|
store[:crop_images] = object.current_account.user.setting_crop_images
|
||||||
store[:place_tab_bar_at_bottom] = object.current_account.user.setting_place_tab_bar_at_bottom
|
|
||||||
else
|
else
|
||||||
store[:auto_play_gif] = Setting.auto_play_gif
|
store[:auto_play_gif] = Setting.auto_play_gif
|
||||||
store[:display_media] = Setting.display_media
|
store[:display_media] = Setting.display_media
|
||||||
|
@ -16,18 +16,11 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||||||
512
|
512
|
||||||
).freeze
|
).freeze
|
||||||
|
|
||||||
attributes :id, :name, :short_name,
|
attributes :name, :short_name,
|
||||||
:icons, :theme_color, :background_color,
|
:icons, :theme_color, :background_color,
|
||||||
:display, :start_url, :scope,
|
:display, :start_url, :scope,
|
||||||
:share_target, :shortcuts
|
:share_target, :shortcuts
|
||||||
|
|
||||||
def id
|
|
||||||
# This is set to `/home` because that was the old value of `start_url` and
|
|
||||||
# thus the fallback ID computed by Chrome:
|
|
||||||
# https://developer.chrome.com/blog/pwa-manifest-id/
|
|
||||||
'/home'
|
|
||||||
end
|
|
||||||
|
|
||||||
def name
|
def name
|
||||||
object.title
|
object.title
|
||||||
end
|
end
|
||||||
@ -60,7 +53,7 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def start_url
|
def start_url
|
||||||
'/'
|
'/home'
|
||||||
end
|
end
|
||||||
|
|
||||||
def scope
|
def scope
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :domain, :digest, :created_at, :severity,
|
attributes :id, :domain, :created_at, :severity,
|
||||||
:reject_media, :reject_reports,
|
:reject_media, :reject_reports,
|
||||||
:private_comment, :public_comment, :obfuscate
|
:private_comment, :public_comment, :obfuscate
|
||||||
|
|
||||||
def id
|
def id
|
||||||
object.id.to_s
|
object.id.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def digest
|
|
||||||
object.domain_digest
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -11,7 +11,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||||||
|
|
||||||
attributes :domain, :title, :version, :source_url, :description,
|
attributes :domain, :title, :version, :source_url, :description,
|
||||||
:usage, :thumbnail, :languages, :configuration,
|
:usage, :thumbnail, :languages, :configuration,
|
||||||
:registrations, :feature_quote
|
:registrations
|
||||||
|
|
||||||
has_one :contact, serializer: ContactSerializer
|
has_one :contact, serializer: ContactSerializer
|
||||||
has_many :rules, serializer: REST::RuleSerializer
|
has_many :rules, serializer: REST::RuleSerializer
|
||||||
@ -88,10 +88,6 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def feature_quote
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def registrations_enabled?
|
def registrations_enabled?
|
||||||
|
@ -18,8 +18,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||||||
attribute :content, unless: :source_requested?
|
attribute :content, unless: :source_requested?
|
||||||
attribute :text, if: :source_requested?
|
attribute :text, if: :source_requested?
|
||||||
|
|
||||||
attribute :quote_id, if: -> { object.quote? }
|
|
||||||
|
|
||||||
belongs_to :reblog, serializer: REST::StatusSerializer
|
belongs_to :reblog, serializer: REST::StatusSerializer
|
||||||
belongs_to :application, if: :show_application?
|
belongs_to :application, if: :show_application?
|
||||||
belongs_to :account, serializer: REST::AccountSerializer
|
belongs_to :account, serializer: REST::AccountSerializer
|
||||||
@ -44,10 +42,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||||||
object.in_reply_to_account_id&.to_s
|
object.in_reply_to_account_id&.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def quote_id
|
|
||||||
object.quote_id.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
def current_user?
|
def current_user?
|
||||||
!current_user.nil?
|
!current_user.nil?
|
||||||
end
|
end
|
||||||
@ -188,26 +182,3 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class REST::NestedQuoteSerializer < REST::StatusSerializer
|
|
||||||
attribute :quote do
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
attribute :quote_muted, if: :current_user?
|
|
||||||
|
|
||||||
def quote_muted
|
|
||||||
if instance_options && instance_options[:account_relationships]
|
|
||||||
!!instance_options[:account_relationships].muting[object.account_id] ||
|
|
||||||
instance_options[:account_relationships].blocking[object.account_id] ||
|
|
||||||
instance_options[:account_relationships].blocked_by[object.account_id] ||
|
|
||||||
instance_options[:account_relationships].domain_blocking[object.account_id]
|
|
||||||
else
|
|
||||||
current_user.account.muting?(object.account) || object.account.blocking?(current_user.account) || current_user.account.blocking?(object.account) || current_user.account.domain_blocking?(object.account.domain)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
class REST::StatusSerializer < ActiveModel::Serializer
|
|
||||||
belongs_to :quote, serializer: REST::NestedQuoteSerializer
|
|
||||||
end
|
|
||||||
|
@ -199,15 +199,10 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||||||
value = first_of_value(@json[key])
|
value = first_of_value(@json[key])
|
||||||
|
|
||||||
return if value.nil?
|
return if value.nil?
|
||||||
|
return value['url'] if value.is_a?(Hash)
|
||||||
|
|
||||||
if value.is_a?(String)
|
image = fetch_resource_without_id_validation(value)
|
||||||
value = fetch_resource_without_id_validation(value)
|
image['url'] if image
|
||||||
return if value.nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
value = first_of_value(value['url']) if value.is_a?(Hash) && value['type'] == 'Image'
|
|
||||||
value = value['href'] if value.is_a?(Hash)
|
|
||||||
value if value.is_a?(String)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def public_key
|
def public_key
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user