mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 17:14:15 -05:00
Merge pull request #1264 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
This commit is contained in:
commit
a8c109baca
@ -116,13 +116,6 @@ jobs:
|
||||
environment: *ruby_environment
|
||||
<<: *install_ruby_dependencies
|
||||
|
||||
install-ruby2.4:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: circleci/ruby:2.4-buster-node
|
||||
environment: *ruby_environment
|
||||
<<: *install_ruby_dependencies
|
||||
|
||||
build:
|
||||
<<: *defaults
|
||||
steps:
|
||||
@ -187,17 +180,6 @@ jobs:
|
||||
- image: circleci/redis:5-alpine
|
||||
<<: *test_steps
|
||||
|
||||
test-ruby2.4:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: circleci/ruby:2.4-buster-node
|
||||
environment: *ruby_environment
|
||||
- image: circleci/postgres:10.6-alpine
|
||||
environment:
|
||||
POSTGRES_USER: root
|
||||
- image: circleci/redis:5-alpine
|
||||
<<: *test_steps
|
||||
|
||||
test-webui:
|
||||
<<: *defaults
|
||||
docker:
|
||||
@ -232,10 +214,6 @@ workflows:
|
||||
requires:
|
||||
- install
|
||||
- install-ruby2.7
|
||||
- install-ruby2.4:
|
||||
requires:
|
||||
- install
|
||||
- install-ruby2.7
|
||||
- build:
|
||||
requires:
|
||||
- install-ruby2.7
|
||||
@ -254,10 +232,6 @@ workflows:
|
||||
requires:
|
||||
- install-ruby2.5
|
||||
- build
|
||||
- test-ruby2.4:
|
||||
requires:
|
||||
- install-ruby2.4
|
||||
- build
|
||||
- test-webui:
|
||||
requires:
|
||||
- install
|
||||
|
11
Gemfile
11
Gemfile
@ -60,7 +60,7 @@ gem 'htmlentities', '~> 4.3'
|
||||
gem 'http', '~> 4.3'
|
||||
gem 'http_accept_language', '~> 2.1'
|
||||
gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2', submodules: true
|
||||
gem 'httplog', '~> 1.3'
|
||||
gem 'httplog', '~> 1.4'
|
||||
gem 'idn-ruby', require: 'idn'
|
||||
gem 'kaminari', '~> 1.1'
|
||||
gem 'link_header', '~> 0.0'
|
||||
@ -69,7 +69,7 @@ gem 'nilsimsa', git: 'https://github.com/witgo/nilsimsa', ref: 'fd184883048b922b
|
||||
gem 'nokogiri', '~> 1.10'
|
||||
gem 'nsa', '~> 0.2'
|
||||
gem 'oj', '~> 3.10'
|
||||
gem 'ox', '~> 2.11'
|
||||
gem 'ox', '~> 2.12'
|
||||
gem 'parslet'
|
||||
gem 'parallel', '~> 1.19'
|
||||
gem 'posix-spawn', git: 'https://github.com/rtomayko/posix-spawn', ref: '58465d2e213991f8afb13b984854a49fcdcc980c'
|
||||
@ -100,7 +100,7 @@ gem 'tzinfo-data', '~> 1.2019'
|
||||
gem 'webpacker', '~> 4.2'
|
||||
gem 'webpush'
|
||||
|
||||
gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', ref: 'e742697a0906e74e8bb777ef98137bc3955d981d'
|
||||
gem 'json-ld'
|
||||
gem 'json-ld-preloaded', '~> 3.0'
|
||||
gem 'rdf-normalize', '~> 0.4'
|
||||
|
||||
@ -127,7 +127,7 @@ group :test do
|
||||
gem 'rails-controller-testing', '~> 1.0'
|
||||
gem 'rspec-sidekiq', '~> 3.0'
|
||||
gem 'simplecov', '~> 0.17', require: false
|
||||
gem 'webmock', '~> 3.7'
|
||||
gem 'webmock', '~> 3.8'
|
||||
gem 'parallel_tests', '~> 2.30'
|
||||
end
|
||||
|
||||
@ -140,7 +140,7 @@ group :development do
|
||||
gem 'letter_opener', '~> 1.7'
|
||||
gem 'letter_opener_web', '~> 1.3'
|
||||
gem 'memory_profiler'
|
||||
gem 'rubocop', '~> 0.78', require: false
|
||||
gem 'rubocop', '~> 0.79', require: false
|
||||
gem 'rubocop-rails', '~> 2.4', require: false
|
||||
gem 'brakeman', '~> 4.7', require: false
|
||||
gem 'bundler-audit', '~> 0.6', require: false
|
||||
@ -150,7 +150,6 @@ group :development do
|
||||
gem 'capistrano-rbenv', '~> 2.1'
|
||||
gem 'capistrano-yarn', '~> 2.0'
|
||||
|
||||
gem 'derailed_benchmarks'
|
||||
gem 'stackprof'
|
||||
end
|
||||
|
||||
|
87
Gemfile.lock
87
Gemfile.lock
@ -13,19 +13,6 @@ GIT
|
||||
specs:
|
||||
posix-spawn (0.3.13)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/ruby-rdf/json-ld.git
|
||||
revision: e742697a0906e74e8bb777ef98137bc3955d981d
|
||||
ref: e742697a0906e74e8bb777ef98137bc3955d981d
|
||||
specs:
|
||||
json-ld (3.0.2)
|
||||
htmlentities (~> 4.3)
|
||||
json-canonicalization (~> 0.1)
|
||||
link_header (~> 0.0, >= 0.0.8)
|
||||
multi_json (~> 1.13)
|
||||
rack (>= 1.6, < 3.0)
|
||||
rdf (~> 3.0, >= 3.0.8)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/tmm1/http_parser.rb
|
||||
revision: 54b17ba8c7d8d20a16dfc65d1775241833219cf2
|
||||
@ -93,7 +80,7 @@ GEM
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
airbrussh (1.3.4)
|
||||
airbrussh (1.4.0)
|
||||
sshkit (>= 1.6.1, != 1.7.0)
|
||||
annotate (3.0.3)
|
||||
activerecord (>= 3.2, < 7.0)
|
||||
@ -121,7 +108,6 @@ GEM
|
||||
aws-sigv4 (1.1.0)
|
||||
aws-eventstream (~> 1.0, >= 1.0.2)
|
||||
bcrypt (3.1.12)
|
||||
benchmark-ips (2.7.2)
|
||||
better_errors (2.5.1)
|
||||
coderay (>= 1.0.0)
|
||||
erubi (>= 1.0.0)
|
||||
@ -133,7 +119,7 @@ GEM
|
||||
bootsnap (1.4.5)
|
||||
msgpack (~> 1.0)
|
||||
brakeman (4.7.2)
|
||||
browser (2.7.1)
|
||||
browser (3.0.3)
|
||||
builder (3.2.4)
|
||||
bullet (6.1.0)
|
||||
activesupport (>= 3.0.0)
|
||||
@ -153,7 +139,7 @@ GEM
|
||||
capistrano-rails (1.4.0)
|
||||
capistrano (~> 3.1)
|
||||
capistrano-bundler (~> 1.1)
|
||||
capistrano-rbenv (2.1.4)
|
||||
capistrano-rbenv (2.1.6)
|
||||
capistrano (~> 3.1)
|
||||
sshkit (~> 1.3)
|
||||
capistrano-yarn (2.0.2)
|
||||
@ -184,19 +170,10 @@ GEM
|
||||
connection_pool (2.2.2)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
crass (1.0.5)
|
||||
crass (1.0.6)
|
||||
css_parser (1.7.1)
|
||||
addressable
|
||||
debug_inspector (0.0.3)
|
||||
derailed_benchmarks (1.4.3)
|
||||
benchmark-ips (~> 2)
|
||||
get_process_mem (~> 0)
|
||||
heapy (~> 0)
|
||||
memory_profiler (~> 0)
|
||||
rack (>= 1)
|
||||
rake (> 10, < 14)
|
||||
ruby-statistics (>= 2.1)
|
||||
thor (~> 0.19)
|
||||
devise (4.7.1)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
@ -241,8 +218,8 @@ GEM
|
||||
tzinfo
|
||||
excon (0.71.0)
|
||||
fabrication (2.21.0)
|
||||
faker (2.10.0)
|
||||
i18n (>= 1.6, < 1.8)
|
||||
faker (2.10.1)
|
||||
i18n (>= 1.6, < 2)
|
||||
faraday (1.0.0)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
fast_blank (1.0.0)
|
||||
@ -270,8 +247,6 @@ GEM
|
||||
fuubar (2.5.0)
|
||||
rspec-core (~> 3.0)
|
||||
ruby-progressbar (~> 1.4)
|
||||
get_process_mem (0.2.5)
|
||||
ffi (~> 1.0)
|
||||
globalid (0.4.2)
|
||||
activesupport (>= 4.2.0)
|
||||
goldfinger (2.1.1)
|
||||
@ -292,8 +267,7 @@ GEM
|
||||
concurrent-ruby (~> 1.0)
|
||||
hashdiff (1.0.0)
|
||||
hashie (3.6.0)
|
||||
heapy (0.1.4)
|
||||
highline (2.0.1)
|
||||
highline (2.0.3)
|
||||
hiredis (0.6.3)
|
||||
hkdf (0.3.0)
|
||||
html2text (0.2.1)
|
||||
@ -310,12 +284,12 @@ GEM
|
||||
http-parser (1.2.1)
|
||||
ffi-compiler (>= 1.0, < 2.0)
|
||||
http_accept_language (2.1.1)
|
||||
httplog (1.3.3)
|
||||
httplog (1.4.0)
|
||||
rack (>= 1.0)
|
||||
rainbow (>= 2.0.0)
|
||||
i18n (1.7.0)
|
||||
i18n (1.8.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-tasks (0.9.29)
|
||||
i18n-tasks (0.9.30)
|
||||
activesupport (>= 4.0.2)
|
||||
ast (>= 2.1.0)
|
||||
erubi
|
||||
@ -331,7 +305,14 @@ GEM
|
||||
jaro_winkler (1.5.4)
|
||||
jmespath (1.4.0)
|
||||
json (2.3.0)
|
||||
json-canonicalization (0.1.0)
|
||||
json-canonicalization (0.2.0)
|
||||
json-ld (3.1.0)
|
||||
htmlentities (~> 4.3)
|
||||
json-canonicalization (~> 0.1)
|
||||
link_header (~> 0.0, >= 0.0.8)
|
||||
multi_json (~> 1.14)
|
||||
rack (~> 2.0)
|
||||
rdf (~> 3.1)
|
||||
json-ld-preloaded (3.0.6)
|
||||
json-ld (~> 3.0)
|
||||
multi_json (~> 1.12)
|
||||
@ -386,7 +367,7 @@ GEM
|
||||
mimemagic (0.3.3)
|
||||
mini_mime (1.0.2)
|
||||
mini_portile2 (2.4.0)
|
||||
minitest (5.13.0)
|
||||
minitest (5.14.0)
|
||||
msgpack (1.3.1)
|
||||
multi_json (1.14.1)
|
||||
multipart-post (2.1.1)
|
||||
@ -405,7 +386,7 @@ GEM
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
sidekiq (>= 3.5)
|
||||
statsd-ruby (~> 1.4, >= 1.4.0)
|
||||
oj (3.10.0)
|
||||
oj (3.10.1)
|
||||
omniauth (1.9.0)
|
||||
hashie (>= 3.4.6, < 3.7.0)
|
||||
rack (>= 1.6.2, < 3)
|
||||
@ -417,7 +398,7 @@ GEM
|
||||
omniauth (~> 1.3, >= 1.3.2)
|
||||
ruby-saml (~> 1.7)
|
||||
orm_adapter (0.5.0)
|
||||
ox (2.11.0)
|
||||
ox (2.12.1)
|
||||
paperclip (6.0.0)
|
||||
activemodel (>= 4.2.0)
|
||||
activesupport (>= 4.2.0)
|
||||
@ -428,7 +409,7 @@ GEM
|
||||
av (~> 0.9.0)
|
||||
paperclip (>= 2.5.2)
|
||||
parallel (1.19.1)
|
||||
parallel_tests (2.30.0)
|
||||
parallel_tests (2.30.1)
|
||||
parallel
|
||||
parser (2.7.0.2)
|
||||
ast (~> 2.4.0)
|
||||
@ -436,7 +417,7 @@ GEM
|
||||
pastel (0.7.3)
|
||||
equatable (~> 0.6)
|
||||
tty-color (~> 0.5)
|
||||
pg (1.2.1)
|
||||
pg (1.2.2)
|
||||
pghero (2.4.1)
|
||||
activerecord (>= 5)
|
||||
pkg-config (1.4.0)
|
||||
@ -508,7 +489,7 @@ GEM
|
||||
thor (>= 0.19.0, < 2.0)
|
||||
rainbow (3.0.0)
|
||||
rake (13.0.1)
|
||||
rdf (3.1.0)
|
||||
rdf (3.1.1)
|
||||
hamster (~> 3.0)
|
||||
link_header (~> 0.0, >= 0.0.8)
|
||||
rdf-normalize (0.4.0)
|
||||
@ -565,10 +546,10 @@ GEM
|
||||
rspec-core (~> 3.0, >= 3.0.0)
|
||||
sidekiq (>= 2.4.0)
|
||||
rspec-support (3.9.0)
|
||||
rubocop (0.78.0)
|
||||
rubocop (0.79.0)
|
||||
jaro_winkler (~> 1.5.1)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 2.6)
|
||||
parser (>= 2.7.0.1)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 1.7)
|
||||
@ -578,7 +559,6 @@ GEM
|
||||
ruby-progressbar (1.10.1)
|
||||
ruby-saml (1.9.0)
|
||||
nokogiri (>= 1.5.10)
|
||||
ruby-statistics (2.1.1)
|
||||
rufus-scheduler (3.5.2)
|
||||
fugit (~> 1.1, >= 1.1.5)
|
||||
safe_yaml (1.0.5)
|
||||
@ -660,11 +640,11 @@ GEM
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.6)
|
||||
unicode-display_width (1.6.0)
|
||||
unicode-display_width (1.6.1)
|
||||
uniform_notifier (1.13.0)
|
||||
warden (1.2.8)
|
||||
rack (>= 2.0.6)
|
||||
webmock (3.7.6)
|
||||
webmock (3.8.0)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
@ -710,7 +690,6 @@ DEPENDENCIES
|
||||
climate_control (~> 0.2)
|
||||
concurrent-ruby
|
||||
connection_pool
|
||||
derailed_benchmarks
|
||||
devise (~> 4.7)
|
||||
devise-two-factor (~> 3.1)
|
||||
devise_pam_authenticatable2 (~> 9.2)
|
||||
@ -734,11 +713,11 @@ DEPENDENCIES
|
||||
http (~> 4.3)
|
||||
http_accept_language (~> 2.1)
|
||||
http_parser.rb (~> 0.6)!
|
||||
httplog (~> 1.3)
|
||||
httplog (~> 1.4)
|
||||
i18n-tasks (~> 0.9)
|
||||
idn-ruby
|
||||
iso-639
|
||||
json-ld!
|
||||
json-ld
|
||||
json-ld-preloaded (~> 3.0)
|
||||
kaminari (~> 1.1)
|
||||
letter_opener (~> 1.7)
|
||||
@ -758,7 +737,7 @@ DEPENDENCIES
|
||||
omniauth (~> 1.9)
|
||||
omniauth-cas (~> 1.1)
|
||||
omniauth-saml (~> 1.10)
|
||||
ox (~> 2.11)
|
||||
ox (~> 2.12)
|
||||
paperclip (~> 6.0)
|
||||
paperclip-av-transcoder (~> 0.6)
|
||||
parallel (~> 1.19)
|
||||
@ -788,7 +767,7 @@ DEPENDENCIES
|
||||
rqrcode (~> 1.1)
|
||||
rspec-rails (~> 3.9)
|
||||
rspec-sidekiq (~> 3.0)
|
||||
rubocop (~> 0.78)
|
||||
rubocop (~> 0.79)
|
||||
rubocop-rails (~> 2.4)
|
||||
ruby-progressbar (~> 1.10)
|
||||
sanitize (~> 5.1)
|
||||
@ -811,6 +790,6 @@ DEPENDENCIES
|
||||
tty-prompt (~> 0.20)
|
||||
twitter-text (~> 1.14)
|
||||
tzinfo-data (~> 1.2019)
|
||||
webmock (~> 3.7)
|
||||
webmock (~> 3.8)
|
||||
webpacker (~> 4.2)
|
||||
webpush
|
||||
|
@ -109,21 +109,7 @@ module Admin
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.permit(
|
||||
:local,
|
||||
:remote,
|
||||
:by_domain,
|
||||
:active,
|
||||
:pending,
|
||||
:disabled,
|
||||
:silenced,
|
||||
:suspended,
|
||||
:username,
|
||||
:display_name,
|
||||
:email,
|
||||
:ip,
|
||||
:staff
|
||||
)
|
||||
params.slice(*AccountFilter::KEYS).permit(*AccountFilter::KEYS)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -48,7 +48,7 @@ module Admin
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.slice(:local, :remote, :by_domain, :shortcode, :page).permit(:local, :remote, :by_domain, :shortcode, :page)
|
||||
params.slice(:page, *CustomEmojiFilter::KEYS).permit(:page, *CustomEmojiFilter::KEYS)
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
@ -62,7 +62,7 @@ module Admin
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.permit(:limited, :by_domain)
|
||||
params.slice(*InstanceFilter::KEYS).permit(*InstanceFilter::KEYS)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ module Admin
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.permit(:available, :expired)
|
||||
params.slice(*InviteFilter::KEYS).permit(*InviteFilter::KEYS)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -52,12 +52,7 @@ module Admin
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.permit(
|
||||
:account_id,
|
||||
:resolved,
|
||||
:target_account_id,
|
||||
:by_target_domain
|
||||
)
|
||||
params.slice(*ReportFilter::KEYS).permit(*ReportFilter::KEYS)
|
||||
end
|
||||
|
||||
def set_report
|
||||
|
@ -73,7 +73,7 @@ module Admin
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.slice(:directory, :reviewed, :unreviewed, :pending_review, :page, :popular, :active, :name).permit(:directory, :reviewed, :unreviewed, :pending_review, :page, :popular, :active, :name)
|
||||
params.slice(:page, *TagFilter::KEYS).permit(:page, *TagFilter::KEYS)
|
||||
end
|
||||
|
||||
def tag_params
|
||||
|
@ -3,6 +3,8 @@
|
||||
class Api::OEmbedController < Api::BaseController
|
||||
respond_to :json
|
||||
|
||||
skip_before_action :require_authenticated_user!
|
||||
|
||||
def show
|
||||
@status = status_finder.status
|
||||
render json: @status, serializer: OEmbedSerializer, width: maxwidth_or_default, height: maxheight_or_default
|
||||
|
@ -86,7 +86,7 @@ class RelationshipsController < ApplicationController
|
||||
end
|
||||
|
||||
def current_params
|
||||
params.slice(:page, :status, :relationship, :by_domain, :activity, :order).permit(:page, :status, :relationship, :by_domain, :activity, :order)
|
||||
params.slice(:page, *RelationshipFilter::KEYS).permit(:page, *RelationshipFilter::KEYS)
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
@ -1,15 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin::FilterHelper
|
||||
ACCOUNT_FILTERS = %i(local remote by_domain active pending silenced suspended username display_name email ip staff).freeze
|
||||
REPORT_FILTERS = %i(resolved account_id target_account_id by_target_domain).freeze
|
||||
INVITE_FILTER = %i(available expired).freeze
|
||||
CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze
|
||||
TAGS_FILTERS = %i(directory reviewed unreviewed pending_review popular active name).freeze
|
||||
INSTANCES_FILTERS = %i(limited by_domain).freeze
|
||||
FOLLOWERS_FILTERS = %i(relationship status by_domain activity order).freeze
|
||||
|
||||
FILTERS = ACCOUNT_FILTERS + REPORT_FILTERS + INVITE_FILTER + CUSTOM_EMOJI_FILTERS + TAGS_FILTERS + INSTANCES_FILTERS + FOLLOWERS_FILTERS
|
||||
FILTERS = [
|
||||
AccountFilter::KEYS,
|
||||
CustomEmojiFilter::KEYS,
|
||||
ReportFilter::KEYS,
|
||||
TagFilter::KEYS,
|
||||
InstanceFilter::KEYS,
|
||||
InviteFilter::KEYS,
|
||||
RelationshipFilter::KEYS,
|
||||
].flatten.freeze
|
||||
|
||||
def filter_link_to(text, link_to_params, link_class_params = link_to_params)
|
||||
new_url = filtered_url_for(link_to_params)
|
||||
|
@ -32,6 +32,7 @@ module SettingsHelper
|
||||
hy: 'Հայերեն',
|
||||
id: 'Bahasa Indonesia',
|
||||
io: 'Ido',
|
||||
is: 'Íslenska',
|
||||
it: 'Italiano',
|
||||
ja: '日本語',
|
||||
ka: 'ქართული',
|
||||
|
@ -43,6 +43,7 @@ class Item extends React.PureComponent {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
displayWidth: PropTypes.number,
|
||||
visible: PropTypes.bool.isRequired,
|
||||
autoplay: PropTypes.bool,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@ -68,9 +69,13 @@ class Item extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
getAutoPlay() {
|
||||
return this.props.autoplay || autoPlayGif;
|
||||
}
|
||||
|
||||
hoverToPlay () {
|
||||
const { attachment } = this.props;
|
||||
return !autoPlayGif && attachment.get('type') === 'gifv';
|
||||
return !this.getAutoPlay() && attachment.get('type') === 'gifv';
|
||||
}
|
||||
|
||||
handleClick = (e) => {
|
||||
@ -222,7 +227,7 @@ class Item extends React.PureComponent {
|
||||
</a>
|
||||
);
|
||||
} else if (attachment.get('type') === 'gifv') {
|
||||
const autoPlay = !isIOS() && autoPlayGif;
|
||||
const autoPlay = !isIOS() && this.getAutoPlay();
|
||||
|
||||
thumbnail = (
|
||||
<div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}>
|
||||
@ -271,6 +276,7 @@ class MediaGallery extends React.PureComponent {
|
||||
defaultWidth: PropTypes.number,
|
||||
cacheWidth: PropTypes.func,
|
||||
visible: PropTypes.bool,
|
||||
autoplay: PropTypes.bool,
|
||||
onToggleVisibility: PropTypes.func,
|
||||
};
|
||||
|
||||
@ -328,7 +334,7 @@ class MediaGallery extends React.PureComponent {
|
||||
}
|
||||
|
||||
render () {
|
||||
const { media, intl, sensitive, letterbox, fullwidth, defaultWidth } = this.props;
|
||||
const { media, intl, sensitive, letterbox, fullwidth, defaultWidth, autoplay } = this.props;
|
||||
const { visible } = this.state;
|
||||
const size = media.take(4).size;
|
||||
const uncached = media.every(attachment => attachment.get('type') === 'unknown');
|
||||
@ -350,9 +356,9 @@ class MediaGallery extends React.PureComponent {
|
||||
}
|
||||
|
||||
if (this.isStandaloneEligible()) {
|
||||
children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />;
|
||||
children = <Item standalone autoplay={autoplay} onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />;
|
||||
} else {
|
||||
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} index={i} size={size} letterbox={letterbox} displayWidth={width} visible={visible || uncached} />);
|
||||
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} autoplay={autoplay} onClick={this.handleClick} attachment={attachment} index={i} size={size} letterbox={letterbox} displayWidth={width} visible={visible || uncached} />);
|
||||
}
|
||||
|
||||
if (uncached) {
|
||||
|
7
app/javascript/flavours/glitch/locales/ast.js
Normal file
7
app/javascript/flavours/glitch/locales/ast.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ast.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/bn.js
Normal file
7
app/javascript/flavours/glitch/locales/bn.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/bn.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/br.js
Normal file
7
app/javascript/flavours/glitch/locales/br.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/br.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/co.js
Normal file
7
app/javascript/flavours/glitch/locales/co.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/co.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/cs.js
Normal file
7
app/javascript/flavours/glitch/locales/cs.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/cs.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/cy.js
Normal file
7
app/javascript/flavours/glitch/locales/cy.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/cy.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/da.js
Normal file
7
app/javascript/flavours/glitch/locales/da.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/da.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/el.js
Normal file
7
app/javascript/flavours/glitch/locales/el.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/el.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/es-AR.js
Normal file
7
app/javascript/flavours/glitch/locales/es-AR.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/es-AR.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/et.js
Normal file
7
app/javascript/flavours/glitch/locales/et.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/et.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/eu.js
Normal file
7
app/javascript/flavours/glitch/locales/eu.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/eu.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ga.js
Normal file
7
app/javascript/flavours/glitch/locales/ga.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ga.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/gl.js
Normal file
7
app/javascript/flavours/glitch/locales/gl.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/gl.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/hi.js
Normal file
7
app/javascript/flavours/glitch/locales/hi.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/hi.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/hy.js
Normal file
7
app/javascript/flavours/glitch/locales/hy.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/hy.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/is.js
Normal file
7
app/javascript/flavours/glitch/locales/is.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/is.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ka.js
Normal file
7
app/javascript/flavours/glitch/locales/ka.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ka.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/kab.js
Normal file
7
app/javascript/flavours/glitch/locales/kab.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/kab.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/kk.js
Normal file
7
app/javascript/flavours/glitch/locales/kk.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/kk.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/kn.js
Normal file
7
app/javascript/flavours/glitch/locales/kn.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/kn.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/lt.js
Normal file
7
app/javascript/flavours/glitch/locales/lt.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/lt.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/lv.js
Normal file
7
app/javascript/flavours/glitch/locales/lv.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/lv.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/mk.js
Normal file
7
app/javascript/flavours/glitch/locales/mk.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/mk.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ml.js
Normal file
7
app/javascript/flavours/glitch/locales/ml.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ml.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/mr.js
Normal file
7
app/javascript/flavours/glitch/locales/mr.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/mr.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ms.js
Normal file
7
app/javascript/flavours/glitch/locales/ms.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ms.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/nn.js
Normal file
7
app/javascript/flavours/glitch/locales/nn.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/nn.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ro.js
Normal file
7
app/javascript/flavours/glitch/locales/ro.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ro.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/sk.js
Normal file
7
app/javascript/flavours/glitch/locales/sk.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/sk.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/sl.js
Normal file
7
app/javascript/flavours/glitch/locales/sl.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/sl.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/sq.js
Normal file
7
app/javascript/flavours/glitch/locales/sq.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/sq.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/sr-Latn.js
Normal file
7
app/javascript/flavours/glitch/locales/sr-Latn.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/sr-Latn.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/sr.js
Normal file
7
app/javascript/flavours/glitch/locales/sr.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/sr.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ta.js
Normal file
7
app/javascript/flavours/glitch/locales/ta.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ta.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/te.js
Normal file
7
app/javascript/flavours/glitch/locales/te.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/te.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/ur.js
Normal file
7
app/javascript/flavours/glitch/locales/ur.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/ur.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
7
app/javascript/flavours/glitch/locales/vi.js
Normal file
7
app/javascript/flavours/glitch/locales/vi.js
Normal file
@ -0,0 +1,7 @@
|
||||
import inherited from 'mastodon/locales/vi.json';
|
||||
|
||||
const messages = {
|
||||
// No translations available.
|
||||
};
|
||||
|
||||
export default Object.assign({}, inherited, messages);
|
@ -97,15 +97,6 @@ function main() {
|
||||
|
||||
delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original'));
|
||||
delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static'));
|
||||
|
||||
delegate(document, '.blocks-table button.icon-button', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const classList = this.firstElementChild.classList;
|
||||
classList.toggle('fa-chevron-down');
|
||||
classList.toggle('fa-chevron-up');
|
||||
this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
|
||||
});
|
||||
});
|
||||
|
||||
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||
|
@ -23,6 +23,7 @@ class Item extends React.PureComponent {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
displayWidth: PropTypes.number,
|
||||
visible: PropTypes.bool.isRequired,
|
||||
autoplay: PropTypes.bool,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@ -48,9 +49,13 @@ class Item extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
getAutoPlay() {
|
||||
return this.props.autoplay || autoPlayGif;
|
||||
}
|
||||
|
||||
hoverToPlay () {
|
||||
const { attachment } = this.props;
|
||||
return !autoPlayGif && attachment.get('type') === 'gifv';
|
||||
return !this.getAutoPlay() && attachment.get('type') === 'gifv';
|
||||
}
|
||||
|
||||
handleClick = (e) => {
|
||||
@ -201,7 +206,7 @@ class Item extends React.PureComponent {
|
||||
</a>
|
||||
);
|
||||
} else if (attachment.get('type') === 'gifv') {
|
||||
const autoPlay = !isIOS() && autoPlayGif;
|
||||
const autoPlay = !isIOS() && this.getAutoPlay();
|
||||
|
||||
thumbnail = (
|
||||
<div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}>
|
||||
@ -248,6 +253,7 @@ class MediaGallery extends React.PureComponent {
|
||||
defaultWidth: PropTypes.number,
|
||||
cacheWidth: PropTypes.func,
|
||||
visible: PropTypes.bool,
|
||||
autoplay: PropTypes.bool,
|
||||
onToggleVisibility: PropTypes.func,
|
||||
};
|
||||
|
||||
@ -297,7 +303,7 @@ class MediaGallery extends React.PureComponent {
|
||||
}
|
||||
|
||||
render () {
|
||||
const { media, intl, sensitive, height, defaultWidth, standalone } = this.props;
|
||||
const { media, intl, sensitive, height, defaultWidth, standalone, autoplay } = this.props;
|
||||
const { visible } = this.state;
|
||||
|
||||
const width = this.state.width || defaultWidth;
|
||||
@ -320,9 +326,9 @@ class MediaGallery extends React.PureComponent {
|
||||
const uncached = media.every(attachment => attachment.get('type') === 'unknown');
|
||||
|
||||
if (standalone && this.isFullSizeEligible()) {
|
||||
children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />;
|
||||
children = <Item standalone autoplay={autoplay} onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />;
|
||||
} else {
|
||||
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} index={i} size={size} displayWidth={width} visible={visible || uncached} />);
|
||||
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} autoplay={autoplay} onClick={this.handleClick} attachment={attachment} index={i} size={size} displayWidth={width} visible={visible || uncached} />);
|
||||
}
|
||||
|
||||
if (uncached) {
|
||||
|
@ -296,7 +296,7 @@ export default class ScrollableList extends PureComponent {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) {
|
||||
} else if (isLoading || childrenCount > 0 || numPending > 0 || hasMore || !emptyMessage) {
|
||||
scrollableArea = (
|
||||
<div className={classNames('scrollable', { fullscreen })} ref={this.setRef} onMouseMove={this.handleMouseMove}>
|
||||
<div role='feed' className='item-list'>
|
||||
|
@ -101,15 +101,6 @@ function main() {
|
||||
|
||||
delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original'));
|
||||
delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static'));
|
||||
|
||||
delegate(document, '.blocks-table button.icon-button', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const classList = this.firstElementChild.classList;
|
||||
classList.toggle('fa-chevron-down');
|
||||
classList.toggle('fa-chevron-up');
|
||||
this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
|
||||
});
|
||||
});
|
||||
|
||||
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||
|
@ -143,7 +143,7 @@ class SpamCheck
|
||||
end
|
||||
|
||||
def trusted?
|
||||
@account.trust_level > Account::TRUST_LEVELS[:untrusted]
|
||||
@account.trust_level > Account::TRUST_LEVELS[:untrusted] || (@account.local? && @account.user_staff?)
|
||||
end
|
||||
|
||||
def no_unsolicited_mentions?
|
||||
|
@ -1,6 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AccountFilter
|
||||
KEYS = %i(
|
||||
local
|
||||
remote
|
||||
by_domain
|
||||
active
|
||||
pending
|
||||
silenced
|
||||
suspended
|
||||
username
|
||||
display_name
|
||||
email
|
||||
ip
|
||||
staff
|
||||
).freeze
|
||||
|
||||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
@ -50,7 +65,7 @@ class AccountFilter
|
||||
when 'email'
|
||||
accounts_with_users.merge User.matches_email(value)
|
||||
when 'ip'
|
||||
valid_ip?(value) ? accounts_with_users.where('users.current_sign_in_ip <<= ?', value) : Account.none
|
||||
valid_ip?(value) ? accounts_with_users.merge(User.matches_ip(value)) : Account.none
|
||||
when 'staff'
|
||||
accounts_with_users.merge User.staff
|
||||
else
|
||||
|
@ -1,6 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CustomEmojiFilter
|
||||
KEYS = %i(
|
||||
local
|
||||
remote
|
||||
by_domain
|
||||
shortcode
|
||||
).freeze
|
||||
|
||||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
|
@ -1,6 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class InstanceFilter
|
||||
KEYS = %i(
|
||||
limited
|
||||
by_domain
|
||||
).freeze
|
||||
|
||||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
|
@ -1,6 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class InviteFilter
|
||||
KEYS = %i(
|
||||
available
|
||||
expired
|
||||
).freeze
|
||||
|
||||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
|
11
app/models/relationship_filter.rb
Normal file
11
app/models/relationship_filter.rb
Normal file
@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RelationshipFilter
|
||||
KEYS = %i(
|
||||
relationship
|
||||
status
|
||||
by_domain
|
||||
activity
|
||||
order
|
||||
).freeze
|
||||
end
|
@ -1,6 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ReportFilter
|
||||
KEYS = %i(
|
||||
resolved
|
||||
account_id
|
||||
target_account_id
|
||||
by_target_domain
|
||||
).freeze
|
||||
|
||||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
|
@ -1,6 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TagFilter
|
||||
KEYS = %i(
|
||||
directory
|
||||
reviewed
|
||||
unreviewed
|
||||
pending_review
|
||||
popular
|
||||
active
|
||||
name
|
||||
).freeze
|
||||
|
||||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
|
@ -93,6 +93,7 @@ class User < ApplicationRecord
|
||||
scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) }
|
||||
scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended_at: nil }) }
|
||||
scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) }
|
||||
scope :matches_ip, ->(value) { left_joins(:session_activations).where('users.current_sign_in_ip <<= ?', value).or(left_joins(:session_activations).where('users.last_sign_in_ip <<= ?', value)).or(left_joins(:session_activations).where('session_activations.ip <<= ?', value)) }
|
||||
scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) }
|
||||
|
||||
before_validation :sanitize_languages
|
||||
@ -290,6 +291,21 @@ class User < ApplicationRecord
|
||||
setting_display_media == 'hide_all'
|
||||
end
|
||||
|
||||
def recent_ips
|
||||
@recent_ips ||= begin
|
||||
arr = []
|
||||
|
||||
session_activations.each do |session_activation|
|
||||
arr << [session_activation.updated_at, session_activation.ip]
|
||||
end
|
||||
|
||||
arr << [current_sign_in_at, current_sign_in_ip] if current_sign_in_ip.present?
|
||||
arr << [last_sign_in_at, last_sign_in_ip] if last_sign_in_ip.present?
|
||||
|
||||
arr.sort_by(&:first).uniq(&:last).reverse!
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
= form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::ACCOUNT_FILTERS.each do |key|
|
||||
- AccountFilter::KEYS.each do |key|
|
||||
- if params[key].present?
|
||||
= hidden_field_tag key, params[key]
|
||||
|
||||
|
@ -139,12 +139,12 @@
|
||||
%time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
|
||||
%td
|
||||
|
||||
%tr
|
||||
%th= t('admin.accounts.most_recent_ip')
|
||||
%td= @account.user_current_sign_in_ip
|
||||
%td
|
||||
- if @account.user_current_sign_in_ip
|
||||
= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: @account.user_current_sign_in_ip)
|
||||
- @account.user.recent_ips.each_with_index do |(_, ip), i|
|
||||
%tr
|
||||
- if i.zero?
|
||||
%th{ rowspan: @account.user.recent_ips.size }= t('admin.accounts.most_recent_ip')
|
||||
%td= ip
|
||||
%td= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: ip)
|
||||
|
||||
%tr
|
||||
%th= t('admin.accounts.most_recent_activity')
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
= form_tag admin_custom_emojis_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key|
|
||||
- CustomEmojiFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(shortcode by_domain).each do |key|
|
||||
@ -36,7 +36,7 @@
|
||||
= form_for(@form, url: batch_admin_custom_emojis_path) do |f|
|
||||
= hidden_field_tag :page, params[:page] || 1
|
||||
|
||||
- Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key|
|
||||
- CustomEmojiFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
.batch-table
|
||||
|
@ -4,7 +4,7 @@
|
||||
- content_for :heading_actions do
|
||||
= link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button'
|
||||
|
||||
- if @email_domain_blocks.count == 0
|
||||
- if @email_domain_blocks.empty?
|
||||
%div.muted-hint.center-text=t 'admin.email_domain_blocks.empty'
|
||||
- else
|
||||
.table-wrapper
|
||||
|
@ -19,9 +19,8 @@
|
||||
- unless whitelist_mode?
|
||||
= form_tag admin_instances_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::INSTANCES_FILTERS.each do |key|
|
||||
- if params[key].present?
|
||||
= hidden_field_tag key, params[key]
|
||||
- InstanceFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(by_domain).each do |key|
|
||||
.input.string.optional
|
||||
|
@ -14,9 +14,12 @@
|
||||
- unless status.proper.media_attachments.empty?
|
||||
- if status.proper.media_attachments.first.video?
|
||||
- video = status.proper.media_attachments.first
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.proper.sensitive?, visible: false, width: 610, height: 343, inline: true, alt: video.description
|
||||
- elsif status.proper.media_attachments.first.audio?
|
||||
- audio = status.proper.media_attachments.first
|
||||
= react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration)
|
||||
- else
|
||||
= react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
|
||||
= react_component :media_gallery, height: 343, sensitive: status.proper.sensitive?, visible: false, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
|
||||
|
||||
.detailed-status__meta
|
||||
= link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do
|
||||
|
@ -10,9 +10,8 @@
|
||||
|
||||
= form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::REPORT_FILTERS.each do |key|
|
||||
- if params[key].present?
|
||||
= hidden_field_tag key, params[key]
|
||||
- ReportFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(by_target_domain).each do |key|
|
||||
.input.string.optional
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
= form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::TAGS_FILTERS.each do |key|
|
||||
- TagFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(name).each do |key|
|
||||
@ -40,9 +40,8 @@
|
||||
|
||||
= form_for(@form, url: batch_admin_tags_path) do |f|
|
||||
= hidden_field_tag :page, params[:page] || 1
|
||||
= hidden_field_tag :name, params[:name] if params[:name].present?
|
||||
|
||||
- Admin::FilterHelper::TAGS_FILTERS.each do |key|
|
||||
- TagFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
.batch-table.optional
|
||||
|
@ -4,7 +4,7 @@
|
||||
- content_for :heading_actions do
|
||||
= link_to t('filters.new.title'), new_filter_path, class: 'button'
|
||||
|
||||
- if @filters.count == 0
|
||||
- if @filters.empty?
|
||||
%div.muted-hint.center-text= t 'filters.index.empty'
|
||||
- else
|
||||
.table-wrapper
|
||||
|
@ -1,3 +1,6 @@
|
||||
- content_for :header_tags do
|
||||
= render_initial_state
|
||||
|
||||
- content_for :content do
|
||||
.admin-wrapper
|
||||
.sidebar-wrapper
|
||||
|
@ -10,6 +10,7 @@
|
||||
- if storage_host?
|
||||
%link{ rel: 'dns-prefetch', href: storage_host }/
|
||||
|
||||
= render_initial_state
|
||||
= javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous'
|
||||
- if @theme
|
||||
- if @theme[:supported_locales].include? I18n.locale.to_s
|
||||
@ -21,3 +22,6 @@
|
||||
|
||||
%body.embed
|
||||
= yield
|
||||
|
||||
%div{ style: 'display: none'}
|
||||
= render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg')
|
||||
|
@ -30,10 +30,9 @@
|
||||
|
||||
= form_for(@form, url: relationships_path, method: :patch) do |f|
|
||||
= hidden_field_tag :page, params[:page] || 1
|
||||
= hidden_field_tag :relationship, params[:relationship]
|
||||
= hidden_field_tag :status, params[:status]
|
||||
= hidden_field_tag :activity, params[:activity]
|
||||
= hidden_field_tag :order, params[:order]
|
||||
|
||||
- RelationshipFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
.batch-table
|
||||
.batch-table__toolbar
|
||||
|
@ -4,7 +4,7 @@
|
||||
- content_for :heading_actions do
|
||||
= link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
|
||||
|
||||
- if @applications.count == 0
|
||||
- if @applications.empty?
|
||||
%div.muted-hint.center-text=t 'doorkeeper.applications.index.empty'
|
||||
- else
|
||||
.table-wrapper
|
||||
|
@ -29,14 +29,14 @@
|
||||
- if !status.media_attachments.empty?
|
||||
- if status.media_attachments.first.video?
|
||||
- video = status.media_attachments.first
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 670, height: 380, detailed: true, inline: true, alt: video.description do
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.sensitive?, width: 670, height: 380, detailed: true, inline: true, alt: video.description do
|
||||
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
|
||||
- elsif status.media_attachments.first.audio?
|
||||
- audio = status.media_attachments.first
|
||||
= react_component :audio, src: audio.file.url(:original), height: 130, alt: audio.description, preload: true, duration: audio.file.meta.dig(:original, :duration) do
|
||||
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
|
||||
- else
|
||||
= react_component :media_gallery, height: 380, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, standalone: true, 'autoPlayGif': current_account&.user&.setting_auto_play_gif || autoplay, 'reduceMotion': current_account&.user&.setting_reduce_motion, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
|
||||
= react_component :media_gallery, height: 380, sensitive: status.sensitive?, standalone: true, autoplay: autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
|
||||
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
|
||||
- elsif status.preview_card
|
||||
= react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json
|
||||
|
@ -33,14 +33,14 @@
|
||||
- if !status.media_attachments.empty?
|
||||
- if status.media_attachments.first.video?
|
||||
- video = status.media_attachments.first
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description do
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.sensitive?, width: 610, height: 343, inline: true, alt: video.description do
|
||||
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
|
||||
- elsif status.media_attachments.first.audio?
|
||||
- audio = status.media_attachments.first
|
||||
= react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration) do
|
||||
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
|
||||
- else
|
||||
= react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif || autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
|
||||
= react_component :media_gallery, height: 343, sensitive: status.sensitive?, autoplay: autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
|
||||
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
|
||||
- elsif status.preview_card
|
||||
= react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json
|
||||
|
@ -70,6 +70,7 @@ module Mastodon
|
||||
:hy,
|
||||
:id,
|
||||
:io,
|
||||
:is,
|
||||
:it,
|
||||
:ja,
|
||||
:ka,
|
||||
|
@ -38,6 +38,7 @@ en:
|
||||
application: Application
|
||||
callback_url: Callback URL
|
||||
delete: Delete
|
||||
empty: You have no applications.
|
||||
name: Name
|
||||
new: New application
|
||||
scopes: Scopes
|
||||
|
@ -163,14 +163,14 @@ en:
|
||||
text: Why do you want to join?
|
||||
notification_emails:
|
||||
digest: Send digest e-mails
|
||||
favourite: Send e-mail when someone favourites your status
|
||||
follow: Send e-mail when someone follows you
|
||||
follow_request: Send e-mail when someone requests to follow you
|
||||
mention: Send e-mail when someone mentions you
|
||||
pending_account: Send e-mail when a new account needs review
|
||||
reblog: Send e-mail when someone boosts your status
|
||||
report: Send e-mail when a new report is submitted
|
||||
trending_tag: Send e-mail when an unreviewed hashtag is trending
|
||||
favourite: Someone favourited your status
|
||||
follow: Someone followed you
|
||||
follow_request: Someone requested to follow you
|
||||
mention: Someone mentioned you
|
||||
pending_account: New account needs review
|
||||
reblog: Someone boosted your status
|
||||
report: New report is submitted
|
||||
trending_tag: An unreviewed hashtag is trending
|
||||
tag:
|
||||
listable: Allow this hashtag to appear in searches and on the profile directory
|
||||
name: Hashtag
|
||||
|
@ -233,7 +233,7 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
resource :role do
|
||||
resource :role, only: [] do
|
||||
member do
|
||||
post :promote
|
||||
post :demote
|
||||
|
32
package.json
32
package.json
@ -60,21 +60,21 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.7.7",
|
||||
"@babel/plugin-proposal-class-properties": "^7.7.4",
|
||||
"@babel/plugin-proposal-decorators": "^7.7.4",
|
||||
"@babel/plugin-transform-react-inline-elements": "^7.7.4",
|
||||
"@babel/core": "^7.8.3",
|
||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||
"@babel/plugin-proposal-decorators": "^7.8.3",
|
||||
"@babel/plugin-transform-react-inline-elements": "^7.8.0",
|
||||
"@babel/plugin-transform-runtime": "^7.7.6",
|
||||
"@babel/preset-env": "^7.7.7",
|
||||
"@babel/preset-react": "^7.7.4",
|
||||
"@babel/runtime": "^7.7.7",
|
||||
"@babel/preset-env": "^7.8.3",
|
||||
"@babel/preset-react": "^7.8.3",
|
||||
"@babel/runtime": "^7.8.3",
|
||||
"@gamestdio/websocket": "^0.3.2",
|
||||
"@clusterws/cws": "^0.17.3",
|
||||
"array-includes": "^3.1.1",
|
||||
"atrament": "^0.2.3",
|
||||
"arrow-key-navigation": "^1.1.0",
|
||||
"autoprefixer": "^9.7.3",
|
||||
"axios": "^0.19.0",
|
||||
"autoprefixer": "^9.7.4",
|
||||
"axios": "^0.19.1",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-plugin-lodash": "^3.3.4",
|
||||
"babel-plugin-preval": "^4.0.0",
|
||||
@ -83,10 +83,10 @@
|
||||
"babel-runtime": "^6.26.0",
|
||||
"blurhash": "^1.1.3",
|
||||
"classnames": "^2.2.5",
|
||||
"compression-webpack-plugin": "^3.0.1",
|
||||
"compression-webpack-plugin": "^3.1.0",
|
||||
"copy-webpack-plugin": "^5.1.1",
|
||||
"cross-env": "^6.0.3",
|
||||
"css-loader": "^3.4.1",
|
||||
"css-loader": "^3.4.2",
|
||||
"cssnano": "^4.1.10",
|
||||
"detect-passive-events": "^1.0.2",
|
||||
"dotenv": "^8.2.0",
|
||||
@ -142,7 +142,7 @@
|
||||
"react-router-scroll-4": "^1.0.0-beta.1",
|
||||
"react-select": "^3.0.8",
|
||||
"react-sparklines": "^1.7.0",
|
||||
"react-swipeable-views": "^0.13.3",
|
||||
"react-swipeable-views": "^0.13.4",
|
||||
"react-textarea-autosize": "^7.1.2",
|
||||
"react-toggle": "^4.1.1",
|
||||
"redis": "^2.7.1",
|
||||
@ -154,15 +154,15 @@
|
||||
"reselect": "^4.0.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"sass": "^1.24.2",
|
||||
"sass-loader": "^8.0.0",
|
||||
"sass-loader": "^8.0.2",
|
||||
"stringz": "^2.0.0",
|
||||
"substring-trie": "^1.0.2",
|
||||
"terser-webpack-plugin": "^2.3.1",
|
||||
"terser-webpack-plugin": "^2.3.2",
|
||||
"tesseract.js": "^2.0.0-alpha.16",
|
||||
"throng": "^4.0.0",
|
||||
"tiny-queue": "^0.2.1",
|
||||
"uuid": "^3.3.3",
|
||||
"wavesurfer.js": "^3.3.0",
|
||||
"wavesurfer.js": "^3.3.1",
|
||||
"webpack": "^4.41.5",
|
||||
"webpack-assets-manifest": "^3.1.1",
|
||||
"webpack-bundle-analyzer": "^3.6.0",
|
||||
@ -176,7 +176,7 @@
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.2",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-plugin-import": "~2.19.1",
|
||||
"eslint-plugin-import": "~2.20.0",
|
||||
"eslint-plugin-jsx-a11y": "~6.2.3",
|
||||
"eslint-plugin-promise": "~4.2.1",
|
||||
"eslint-plugin-react": "~7.17.0",
|
||||
|
Loading…
Reference in New Issue
Block a user