Merge branch 'kb_development' into kb_migration

This commit is contained in:
KMY 2023-04-28 14:33:09 +09:00
commit c4367544d7
27 changed files with 349 additions and 40 deletions

View file

@ -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)

View file

@ -21,12 +21,16 @@ class UpdateAccountService < BaseService
def authorize_all_follow_requests(account)
follow_requests = FollowRequest.where(target_account: account)
follow_requests = follow_requests.preload(:account).select { |req| !req.account.silenced? }
follow_requests = follow_requests.preload(:account).select { |req| !req.account.silenced? && !reject_straight_follow_domains.include?(req.account.domain) }
AuthorizeFollowWorker.push_bulk(follow_requests, limit: 1_000) do |req|
[req.account_id, req.target_account_id]
end
end
def reject_straight_follow_domains
DomainBlock.where(reject_straight_follow: true).pluck(:domain)
end
def check_links(account)
VerifyAccountLinksWorker.perform_async(account.id) if account.fields.any?(&:requires_verification?)
end