Merge branch 'kb_migration' into kb_migration_development
This commit is contained in:
commit
c47f85eddf
3 changed files with 16 additions and 3 deletions
|
@ -18,7 +18,7 @@ class StatusPolicy < ApplicationPolicy
|
|||
elsif private?
|
||||
owned? || following_author? || mention_exists?
|
||||
else
|
||||
current_account.nil? || (!author_blocking? && !author_blocking_domain?)
|
||||
current_account.nil? || (!author_blocking? && !author_blocking_domain? && !server_blocking_domain?)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -99,4 +99,18 @@ class StatusPolicy < ApplicationPolicy
|
|||
def author
|
||||
record.account
|
||||
end
|
||||
|
||||
def server_blocking_domain?
|
||||
@domain_block = DomainBlock.find_by(domain: current_account&.domain)
|
||||
if @domain_block
|
||||
(@domain_block.reject_send_not_public_searchability && record.compute_searchability != 'public') ||
|
||||
(@domain_block.reject_send_unlisted_dissubscribable && record.unlisted_visibility? && record.account.dissubscribable) ||
|
||||
(@domain_block.reject_send_public_unlisted && record.public_unlisted_visibility?) ||
|
||||
(@domain_block.reject_send_dissubscribable && record.account.dissubscribable) ||
|
||||
(@domain_block.reject_send_media && record.with_media?) ||
|
||||
(@domain_block.reject_send_sensitive && ((record.with_media? && record.sensitive) || record.spoiler_text))
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -131,7 +131,6 @@ class FanOutOnWriteService < BaseService
|
|||
antennas.in_batches do |ans|
|
||||
ans.each do |antenna|
|
||||
next if !antenna.enabled?
|
||||
next if antenna.keywords.any? && !([nil, :public].include?(@status.searchability&.to_sym))
|
||||
next if antenna.keywords.any? && !antenna.keywords.any? { |keyword| @status.text.include?(keyword) }
|
||||
next if antenna.exclude_keywords&.any? { |keyword| @status.text.include?(keyword) }
|
||||
next if antenna.exclude_accounts&.include?(@status.account_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue