mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 18:01:05 +00:00
Merge 9d2e41a547
into 9a2be25199
This commit is contained in:
commit
71fd202a04
|
@ -6,12 +6,23 @@ class UnmuteService < BaseService
|
||||||
|
|
||||||
account.unmute!(target_account)
|
account.unmute!(target_account)
|
||||||
|
|
||||||
if account.following?(target_account)
|
process_merges(account, target_account) if account.following?(target_account)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def process_merges(account, target_account)
|
||||||
MergeWorker.perform_async(target_account.id, account.id, 'home')
|
MergeWorker.perform_async(target_account.id, account.id, 'home')
|
||||||
|
|
||||||
MergeWorker.push_bulk(account.owned_lists.with_list_account(target_account).pluck(:id)) do |list_id|
|
MergeWorker.push_bulk(mergeable_list_ids(account, target_account)) do |list_id|
|
||||||
[target_account.id, list_id, 'list']
|
[target_account.id, list_id, 'list']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mergeable_list_ids(account, target_account)
|
||||||
|
account
|
||||||
|
.owned_lists
|
||||||
|
.with_list_account(target_account)
|
||||||
|
.pluck(:id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user