0
0
Fork 0

Undo notification permissions on individual and domain blocks (#29570)

This commit is contained in:
Claire 2024-03-26 15:46:38 +01:00 committed by GitHub
parent 7508472d84
commit 9c24f2d6b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 12 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)