Remove enable_block_emoji_reaction_settings

This commit is contained in:
KMY 2023-09-12 16:58:45 +09:00
parent 673e607e94
commit 18a0908878
7 changed files with 4 additions and 16 deletions

View file

@ -364,7 +364,6 @@ class Account < ApplicationRecord
end
def emoji_reaction_policy
return :allow unless Setting.enable_block_emoji_reaction_settings || !local?
return settings['emoji_reaction_policy']&.to_sym || :allow if settings.present?
return :allow if user.nil?
@ -381,12 +380,8 @@ class Account < ApplicationRecord
'hide_followers_count' => hide_followers_count?,
'translatable_private' => translatable_private?,
'link_preview' => link_preview?,
'emoji_reaction_policy' => user&.setting_emoji_reaction_policy,
}
if Setting.enable_block_emoji_reaction_settings
config = config.merge({
'emoji_reaction_policy' => user&.setting_emoji_reaction_policy,
})
end
config = config.merge(settings) if settings.present?
config
end

View file

@ -37,7 +37,6 @@ class Form::AdminSettings
status_page_url
captcha_enabled
ng_words
enable_block_emoji_reaction_settings
hide_local_users_for_anonymous
post_hash_tags_max
sensitive_words
@ -64,7 +63,6 @@ class Form::AdminSettings
noindex
require_invite_text
captcha_enabled
enable_block_emoji_reaction_settings
hide_local_users_for_anonymous
authorized_fetch
).freeze

View file

@ -22,7 +22,6 @@ class EmojiReactionValidator < ActiveModel::Validator
end
def deny_emoji_reactions?(emoji_reaction)
return false unless Setting.enable_block_emoji_reaction_settings
return false if emoji_reaction.status.account.user.nil?
return deny_from_all?(emoji_reaction) if emoji_reaction.status.account_id == emoji_reaction.account_id
return false if emoji_reaction.status.account.emoji_reaction_policy == :allow

View file

@ -13,9 +13,6 @@
.fields-group
= f.input :post_hash_tags_max, wrapper: :with_label, as: :integer, label: t('admin.ng_words.post_hash_tags_max')
.fields-group
= f.input :enable_block_emoji_reaction_settings, wrapper: :with_label, as: :boolean, label: t('admin.ng_words.enable_block_emoji_reaction_settings')
.fields-group
= f.input :hide_local_users_for_anonymous, wrapper: :with_label, as: :boolean, label: t('admin.ng_words.hide_local_users_for_anonymous')

View file

@ -20,8 +20,9 @@
.fields-group
= ff.input :default_sensitive, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_default_sensitive'), hint: I18n.t('simple_form.hints.defaults.setting_default_sensitive')
- if Setting.enable_block_emoji_reaction_settings
= ff.input :emoji_reaction_policy, kmyblue: true, collection: ['allow', 'outside_only', 'followers_only', 'followees_only', 'mutuals_only', 'block', 'block_and_hide'], label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.setting_emoji_reaction_policy_items.#{item}")]) }, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label, label: I18n.t('simple_form.labels.defaults.setting_emoji_reaction_policy')
.fields-row
.fields-group.fields-row__column.fields-row__column-12
= ff.input :emoji_reaction_policy, kmyblue: true, collection: ['allow', 'outside_only', 'followers_only', 'followees_only', 'mutuals_only', 'block', 'block_and_hide'], label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.setting_emoji_reaction_policy_items.#{item}")]) }, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', include_blank: false, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_emoji_reaction_policy')
- if @dtl_enabled

View file

@ -597,7 +597,6 @@ en:
media_attachments:
title: Media attachments
ng_words:
enable_block_emoji_reaction_settings: Enable block emoji reactions settings for users
hide_local_users_for_anonymous: Hide timeline local user posts from anonymous
keywords: Reject keywords
keywords_hint: The first character of the line is "?". to use regular expressions

View file

@ -595,7 +595,6 @@ ja:
media_attachments:
title: 投稿された画像
ng_words:
enable_block_emoji_reaction_settings: 各ユーザーにスタンプ機能のブロック設定項目を解放する
hide_local_users_for_anonymous: ログインしていない状態でローカルユーザーの投稿をタイムラインから取得できないようにする
keywords: 投稿できないキーワード
keywords_hint: 行を「?」で始めると、正規表現が使えます