Remove: メディアを配送しない設定の削除 (#445)
This commit is contained in:
parent
92a16218c9
commit
407a53aa33
12 changed files with 7 additions and 23 deletions
|
@ -88,17 +88,17 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_params
|
def update_params
|
||||||
params.require(:domain_block).permit(:severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_media, :reject_send_sensitive, :reject_hashtag,
|
params.require(:domain_block).permit(:severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_sensitive, :reject_hashtag,
|
||||||
:reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
|
:reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.require(:domain_block).permit(:domain, :severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_media, :reject_send_sensitive, :reject_hashtag,
|
params.require(:domain_block).permit(:domain, :severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_sensitive, :reject_hashtag,
|
||||||
:reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
|
:reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
|
||||||
end
|
end
|
||||||
|
|
||||||
def form_domain_block_batch_params
|
def form_domain_block_batch_params
|
||||||
params.require(:form_domain_block_batch).permit(domain_blocks_attributes: [:enabled, :domain, :severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_media,
|
params.require(:form_domain_block_batch).permit(domain_blocks_attributes: [:enabled, :domain, :severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers,
|
||||||
:reject_send_sensitive, :reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden])
|
:reject_send_sensitive, :reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_block_params
|
def domain_block_params
|
||||||
params.permit(:severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_reports, :reject_send_media, :reject_send_sensitive, :reject_hashtag, :reject_straight_follow,
|
params.permit(:severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_reports, :reject_send_sensitive, :reject_hashtag, :reject_straight_follow,
|
||||||
:reject_new_follow, :reject_friend, :detect_invalid_subscription, :private_comment, :public_comment, :obfuscate, :hidden)
|
:reject_new_follow, :reject_friend, :detect_invalid_subscription, :private_comment, :public_comment, :obfuscate, :hidden)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_params
|
def resource_params
|
||||||
params.permit(:domain, :severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_media, :reject_send_sensitive, :reject_hashtag, :reject_straight_follow,
|
params.permit(:domain, :severity, :reject_media, :reject_favourite, :reject_reply, :reject_reply_exclude_followers, :reject_send_sensitive, :reject_hashtag, :reject_straight_follow,
|
||||||
:reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
|
:reject_new_follow, :reject_friend, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -45,7 +45,7 @@ class AccountStatusesFilter
|
||||||
def initial_scope
|
def initial_scope
|
||||||
return Status.none if account.unavailable?
|
return Status.none if account.unavailable?
|
||||||
|
|
||||||
if domain_block&.reject_send_media || blocked?
|
if blocked?
|
||||||
Status.none
|
Status.none
|
||||||
elsif anonymous?
|
elsif anonymous?
|
||||||
account.statuses.where(visibility: %i(public unlisted public_unlisted))
|
account.statuses.where(visibility: %i(public unlisted public_unlisted))
|
||||||
|
|
|
@ -195,7 +195,6 @@ class StatusReachFinder
|
||||||
[]
|
[]
|
||||||
else
|
else
|
||||||
blocks = DomainBlock.where(domain: nil)
|
blocks = DomainBlock.where(domain: nil)
|
||||||
blocks = blocks.or(DomainBlock.where(reject_send_media: true)) if status.with_media?
|
|
||||||
blocks = blocks.or(DomainBlock.where(reject_send_sensitive: true)) if (status.with_media? && status.sensitive) || status.spoiler_text?
|
blocks = blocks.or(DomainBlock.where(reject_send_sensitive: true)) if (status.with_media? && status.sensitive) || status.spoiler_text?
|
||||||
blocks.pluck(:domain).uniq
|
blocks.pluck(:domain).uniq
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,7 +69,6 @@ class DomainBlock < ApplicationRecord
|
||||||
reject_favourite? ? :reject_favourite : nil,
|
reject_favourite? ? :reject_favourite : nil,
|
||||||
reject_reply? ? :reject_reply : nil,
|
reject_reply? ? :reject_reply : nil,
|
||||||
reject_reply_exclude_followers? ? :reject_reply_exclude_followers : nil,
|
reject_reply_exclude_followers? ? :reject_reply_exclude_followers : nil,
|
||||||
reject_send_media? ? :reject_send_media : nil,
|
|
||||||
reject_send_sensitive? ? :reject_send_sensitive : nil,
|
reject_send_sensitive? ? :reject_send_sensitive : nil,
|
||||||
reject_hashtag? ? :reject_hashtag : nil,
|
reject_hashtag? ? :reject_hashtag : nil,
|
||||||
reject_straight_follow? ? :reject_straight_follow : nil,
|
reject_straight_follow? ? :reject_straight_follow : nil,
|
||||||
|
|
|
@ -149,7 +149,6 @@ class StatusPolicy < ApplicationPolicy
|
||||||
else
|
else
|
||||||
(@domain_block.detect_invalid_subscription && status.public_unlisted_visibility? && status.account.user&.setting_reject_public_unlisted_subscription) ||
|
(@domain_block.detect_invalid_subscription && status.public_unlisted_visibility? && status.account.user&.setting_reject_public_unlisted_subscription) ||
|
||||||
(@domain_block.detect_invalid_subscription && status.public_visibility? && status.account.user&.setting_reject_unlisted_subscription) ||
|
(@domain_block.detect_invalid_subscription && status.public_visibility? && status.account.user&.setting_reject_unlisted_subscription) ||
|
||||||
(@domain_block.reject_send_media && status.with_media?) ||
|
|
||||||
(@domain_block.reject_send_sensitive && ((status.with_media? && status.sensitive) || status.spoiler_text?))
|
(@domain_block.reject_send_sensitive && ((status.with_media? && status.sensitive) || status.spoiler_text?))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :domain, :created_at, :severity,
|
attributes :id, :domain, :created_at, :severity,
|
||||||
:reject_media, :reject_favourite, :reject_reply, :reject_reports,
|
:reject_media, :reject_favourite, :reject_reply, :reject_reports,
|
||||||
:reject_reply_exclude_followers,
|
:reject_reply_exclude_followers, :reject_send_sensitive,
|
||||||
:reject_send_media, :reject_send_sensitive,
|
|
||||||
:reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription,
|
:reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription,
|
||||||
:private_comment, :public_comment, :obfuscate
|
:private_comment, :public_comment, :obfuscate
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,5 @@
|
||||||
|
|
||||||
%h4= I18n.t('admin.domain_blocks.headers.disagreement')
|
%h4= I18n.t('admin.domain_blocks.headers.disagreement')
|
||||||
|
|
||||||
.fields-group
|
|
||||||
= f.input :reject_send_media, as: :boolean, kmyblue: true, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_send_media'), hint: I18n.t('admin.domain_blocks.reject_send_media_hint')
|
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :reject_send_sensitive, as: :boolean, kmyblue: true, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_send_sensitive'), hint: I18n.t('admin.domain_blocks.reject_send_sensitive_hint')
|
= f.input :reject_send_sensitive, as: :boolean, kmyblue: true, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_send_sensitive'), hint: I18n.t('admin.domain_blocks.reject_send_sensitive_hint')
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
= f.hidden_field :reject_favourite
|
= f.hidden_field :reject_favourite
|
||||||
= f.hidden_field :reject_reply
|
= f.hidden_field :reject_reply
|
||||||
= f.hidden_field :reject_reply_exclude_followers
|
= f.hidden_field :reject_reply_exclude_followers
|
||||||
= f.hidden_field :reject_send_media
|
|
||||||
= f.hidden_field :reject_send_sensitive
|
= f.hidden_field :reject_send_sensitive
|
||||||
= f.hidden_field :reject_hashtag
|
= f.hidden_field :reject_hashtag
|
||||||
= f.hidden_field :reject_straight_follow
|
= f.hidden_field :reject_straight_follow
|
||||||
|
|
|
@ -454,8 +454,6 @@ en:
|
||||||
reject_reply_exclude_followers_hint: Reject replies exclude followers in the future
|
reject_reply_exclude_followers_hint: Reject replies exclude followers in the future
|
||||||
reject_reports: Reject reports
|
reject_reports: Reject reports
|
||||||
reject_reports_hint: Ignore all reports coming from this domain. Irrelevant for suspensions
|
reject_reports_hint: Ignore all reports coming from this domain. Irrelevant for suspensions
|
||||||
reject_send_media: 画像付き投稿を配送しない
|
|
||||||
reject_send_media_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です
|
|
||||||
reject_send_sensitive: センシティブな投稿を配送しない
|
reject_send_sensitive: センシティブな投稿を配送しない
|
||||||
reject_send_sensitive_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です
|
reject_send_sensitive_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です
|
||||||
reject_send_unlisted_dissubscribable: 購読拒否アカウントの未収載投稿を配送しない
|
reject_send_unlisted_dissubscribable: 購読拒否アカウントの未収載投稿を配送しない
|
||||||
|
|
|
@ -449,8 +449,6 @@ ja:
|
||||||
reject_reply_exclude_followers_hint: 今後のリプライを拒否します。停止とは無関係です
|
reject_reply_exclude_followers_hint: 今後のリプライを拒否します。停止とは無関係です
|
||||||
reject_reports: 通報を拒否
|
reject_reports: 通報を拒否
|
||||||
reject_reports_hint: このドメインからの通報をすべて無視します。停止とは無関係です
|
reject_reports_hint: このドメインからの通報をすべて無視します。停止とは無関係です
|
||||||
reject_send_media: 画像付き投稿を配送しない
|
|
||||||
reject_send_media_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です
|
|
||||||
reject_send_sensitive: センシティブな投稿を配送しない
|
reject_send_sensitive: センシティブな投稿を配送しない
|
||||||
reject_send_sensitive_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です
|
reject_send_sensitive_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です
|
||||||
reject_send_unlisted_dissubscribable: 購読拒否アカウントの未収載投稿を配送しない
|
reject_send_unlisted_dissubscribable: 購読拒否アカウントの未収載投稿を配送しない
|
||||||
|
@ -562,7 +560,6 @@ ja:
|
||||||
reject_reply: リプライを拒否
|
reject_reply: リプライを拒否
|
||||||
reject_reply_exclude_followers: フォロー相手以外からのリプライを拒否
|
reject_reply_exclude_followers: フォロー相手以外からのリプライを拒否
|
||||||
reject_reports: 通報を拒否
|
reject_reports: 通報を拒否
|
||||||
reject_send_media: メディア付き投稿配送なし
|
|
||||||
reject_send_sensitive: センシティブ投稿配送なし
|
reject_send_sensitive: センシティブ投稿配送なし
|
||||||
reject_send_unlisted_dissubscribable: 購読拒否未収載投稿配送なし
|
reject_send_unlisted_dissubscribable: 購読拒否未収載投稿配送なし
|
||||||
reject_straight_follow: フォローを制限
|
reject_straight_follow: フォローを制限
|
||||||
|
|
|
@ -62,7 +62,6 @@ RSpec.describe 'Domain Blocks' do
|
||||||
reject_new_follow: domain_block.reject_new_follow,
|
reject_new_follow: domain_block.reject_new_follow,
|
||||||
reject_reply: domain_block.reject_reply,
|
reject_reply: domain_block.reject_reply,
|
||||||
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||||
reject_send_media: domain_block.reject_send_media,
|
|
||||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||||
reject_straight_follow: domain_block.reject_straight_follow,
|
reject_straight_follow: domain_block.reject_straight_follow,
|
||||||
reject_friend: domain_block.reject_friend,
|
reject_friend: domain_block.reject_friend,
|
||||||
|
@ -112,7 +111,6 @@ RSpec.describe 'Domain Blocks' do
|
||||||
reject_new_follow: domain_block.reject_new_follow,
|
reject_new_follow: domain_block.reject_new_follow,
|
||||||
reject_reply: domain_block.reject_reply,
|
reject_reply: domain_block.reject_reply,
|
||||||
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||||
reject_send_media: domain_block.reject_send_media,
|
|
||||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||||
reject_straight_follow: domain_block.reject_straight_follow,
|
reject_straight_follow: domain_block.reject_straight_follow,
|
||||||
reject_friend: domain_block.reject_friend,
|
reject_friend: domain_block.reject_friend,
|
||||||
|
@ -144,7 +142,6 @@ RSpec.describe 'Domain Blocks' do
|
||||||
reject_new_follow: domain_block.reject_new_follow,
|
reject_new_follow: domain_block.reject_new_follow,
|
||||||
reject_reply: domain_block.reject_reply,
|
reject_reply: domain_block.reject_reply,
|
||||||
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||||
reject_send_media: domain_block.reject_send_media,
|
|
||||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||||
reject_straight_follow: domain_block.reject_straight_follow,
|
reject_straight_follow: domain_block.reject_straight_follow,
|
||||||
reject_friend: domain_block.reject_friend,
|
reject_friend: domain_block.reject_friend,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue