Addo domein block extra supports

This commit is contained in:
KMY 2023-04-28 13:31:02 +09:00
parent bb7fa1d060
commit 9ad92e6a09
24 changed files with 331 additions and 35 deletions

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