Merge remote-tracking branch 'parent/main' into upstream-20240327

This commit is contained in:
KMY 2024-03-27 12:13:55 +09:00
commit ace193fda3
75 changed files with 435 additions and 462 deletions

View file

@ -12,6 +12,7 @@ class AfterBlockDomainFromAccountService < BaseService
@domain_block_event = nil
clear_notifications!
clear_notification_permissions!
remove_follows!
reject_existing_followers!
reject_pending_follow_requests!
@ -31,6 +32,10 @@ class AfterBlockDomainFromAccountService < BaseService
Notification.where(account: @account).where(from_account: Account.where(domain: @domain)).in_batches.delete_all
end
def clear_notification_permissions!
NotificationPermission.where(account: @account, from_account: Account.where(domain: @domain)).in_batches.delete_all
end
def reject_existing_followers!
@account.passive_relationships.where(account: Account.where(domain: @domain)).includes(:account).reorder(nil).in_batches do |follows|
domain_block_event.import_from_passive_follows!(follows)

View file

@ -10,6 +10,8 @@ class BlockService < BaseService
UnfollowService.new.call(target_account, account) if target_account.following?(account)
RejectFollowService.new.call(target_account, account) if target_account.requested?(account)
NotificationPermission.where(account: account, from_account: target_account).destroy_all
block = account.block!(target_account)
BlockWorker.perform_async(account.id, target_account.id)