Undo notification permissions on individual and domain blocks (#29570)
This commit is contained in:
parent
7508472d84
commit
9c24f2d6b1
4 changed files with 18 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue