0
0
Fork 0

Change lists to reflect added and removed users retroactively (#32930)

This commit is contained in:
Eugen Rochko 2024-11-19 11:04:12 +01:00 committed by GitHub
parent f2976ec9a4
commit 2b5faa2ba3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 157 additions and 25 deletions

View file

@ -33,8 +33,15 @@ class FollowRequest < ApplicationRecord
def authorize!
follow = account.follow!(target_account, reblogs: show_reblogs, notify: notify, languages: languages, uri: uri, bypass_limit: true)
ListAccount.where(follow_request: self).update_all(follow_request_id: nil, follow_id: follow.id)
MergeWorker.perform_async(target_account.id, account.id) if account.local?
if account.local?
ListAccount.where(follow_request: self).update_all(follow_request_id: nil, follow_id: follow.id)
MergeWorker.perform_async(target_account.id, account.id, 'home')
MergeWorker.push_bulk(List.where(account: account).joins(:list_accounts).where(list_accounts: { account_id: target_account.id }).pluck(:id)) do |list_id|
[target_account.id, list_id, 'list']
end
end
destroy!
end