gem 'goldfinger', '~> 2.1'
gem 'hiredis', '~> 0.6'
gem 'redis-namespace', '~> 1.5'
+ gem 'health_check', '~> 3.0'
+gem 'html2text'
gem 'htmlentities', '~> 4.3'
gem 'http', '~> 3.3'
gem 'http_accept_language', '~> 2.1'
fuubar (~> 2.4)
goldfinger (~> 2.1)
hamlit-rails (~> 0.2)
+ health_check (~> 3.0)
hiredis (~> 0.6)
+ html2text
htmlentities (~> 4.3)
http (~> 3.3)
http_accept_language (~> 2.1)
# frozen_string_literal: true
- class Api::V2::SearchController < Api::V1::SearchController
+ class Api::V2::SearchController < Api::BaseController
+ include Authorization
+
- RESULTS_LIMIT = 20
++ RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i
+
+ before_action -> { doorkeeper_authorize! :read, :'read:search' }
+ before_action :require_user!
+
+ respond_to :json
+
def index
@search = Search.new(search_results)
- render json: @search, serializer: REST::V2::SearchSerializer
+ render json: @search, serializer: REST::SearchSerializer
+ end
+
+ private
+
+ def search_results
+ SearchService.new.call(
+ params[:q],
+ current_account,
+ limit_param(RESULTS_LIMIT),
+ search_params.merge(resolve: truthy_param?(:resolve))
+ )
+ end
+
+ def search_params
+ params.permit(:type, :offset, :min_id, :max_id, :account_id)
end
end
"navigation_bar.personal": "個人用",
"navigation_bar.pins": "固定したトゥート",
"navigation_bar.preferences": "ユーザー設定",
- "navigation_bar.profile_directory": "ディレクトリ",
"navigation_bar.public_timeline": "連合タイムライン",
+ "navigation_bar.misc": "その他",
"navigation_bar.security": "セキュリティ",
"notification.and_n_others": "and {count, plural, one {# other} other {# others}}",
"notification.favourite": "{name}さんがあなたのトゥートをお気に入りに登録しました",
module Settings
class ScopedSettings
DEFAULTING_TO_UNSCOPED = %w(
- theme
+ flavour
+ skin
+ noindex
).freeze
def initialize(object)
show_known_fediverse_at_about_page
preview_sensitive_media
profile_directory
+ hide_followers_count
+ enable_keybase
+ show_reblogs_in_public_timelines
+ show_replies_in_public_timelines
spam_check_enabled
trends
+ noindex
).freeze
UPLOAD_KEYS = %i(
redis.publish('timeline:public:local:media', @payload) if @status.local?
end
+ def remove_from_direct
+ @mentions.each do |mention|
+ FeedManager.instance.unpush_from_direct(mention.account, @status) if mention.account.local?
+ end
+ end
+
def remove_media
- return if @options[:redraft]
+ return if @options[:redraft] || (!@options[:immediate] && @status.reported?)
@status.media_attachments.destroy_all
end
.fields-group
= f.input :trends, as: :boolean, wrapper: :with_label, label: t('admin.settings.trends.title'), hint: t('admin.settings.trends.desc_html')
+ .fields-group
+ = f.input :noindex, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_noindex.title'), hint: t('admin.settings.default_noindex.desc_html')
+
+ .fields-group
+ = f.input :hide_followers_count, as: :boolean, wrapper: :with_label, label: t('admin.settings.hide_followers_count.title'), hint: t('admin.settings.hide_followers_count.desc_html')
+
+ .fields-group
+ = f.input :enable_keybase, as: :boolean, wrapper: :with_label, label: t('admin.settings.enable_keybase.title'), hint: t('admin.settings.enable_keybase.desc_html')
+
+ .fields-group
+ = f.input :show_reblogs_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_reblogs_in_public_timelines.title'), hint: t('admin.settings.show_reblogs_in_public_timelines.desc_html')
+
+ .fields-group
+ = f.input :show_replies_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_replies_in_public_timelines.title'), hint: t('admin.settings.show_replies_in_public_timelines.desc_html')
+
.fields-group
= f.input :spam_check_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.spam_check_enabled.title'), hint: t('admin.settings.spam_check_enabled.desc_html')
all: All
changes_saved_msg: Changes successfully saved!
copy: Copy
+ no_batch_actions_available: No batch actions available on this page
order_by: Order by
save_changes: Save changes
+ use_this: Use this
validation_errors:
one: Something isn't quite right yet! Please review the error below
other: Something isn't quite right yet! Please review %{count} errors below
end
end
- get '/search', to: 'search#index', as: :search
-
resources :media, only: [:create, :update]
resources :blocks, only: [:index]
- resources :mutes, only: [:index]
+ resources :mutes, only: [:index] do
+ collection do
+ get 'details'
+ end
+ end
resources :favourites, only: [:index]
+ resources :bookmarks, only: [:index]
resources :reports, only: [:create]
resources :trends, only: [:index]
resources :filters, only: [:index, :create, :show, :update, :destroy]
current_user = Fabricate(:user)
sign_in current_user
- allow(Setting).to receive(:[]).with('theme').and_return 'contrast'
+ allow(Setting).to receive(:[]).with('skin').and_return 'default'
+ allow(Setting).to receive(:[]).with('flavour').and_return 'vanilla'
+ allow(Setting).to receive(:[]).with('noindex').and_return false
- expect(controller.view_context.current_theme).to eq 'contrast'
+ expect(controller.view_context.current_flavour).to eq 'vanilla'
end
- it 'returns user\'s theme when it is set' do
+ it 'returns user\'s flavour when it is set' do
current_user = Fabricate(:user)
- current_user.settings['theme'] = 'mastodon-light'
+ current_user.settings['flavour'] = 'glitch'
sign_in current_user
- allow(Setting).to receive(:[]).with('theme').and_return 'contrast'
+ allow(Setting).to receive(:[]).with('skin').and_return 'default'
+ allow(Setting).to receive(:[]).with('flavour').and_return 'vanilla'
- expect(controller.view_context.current_theme).to eq 'mastodon-light'
+ expect(controller.view_context.current_flavour).to eq 'glitch'
end
end