Change lists to reflect added and removed users retroactively (#32930)
This commit is contained in:
parent
f2976ec9a4
commit
2b5faa2ba3
12 changed files with 157 additions and 25 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue