Compare commits

...

2 Commits

Author SHA1 Message Date
Matt Jankowski
a06cd16c25
Merge 9d2e41a547 into 624c024766 2025-09-03 10:05:12 +00:00
Matt Jankowski
9d2e41a547 Fix Style/GuardClause in unmute service 2025-08-15 08:53:54 -04:00

View File

@ -6,12 +6,23 @@ class UnmuteService < BaseService
account.unmute!(target_account)
if account.following?(target_account)
MergeWorker.perform_async(target_account.id, account.id, 'home')
process_merges(account, target_account) if account.following?(target_account)
end
MergeWorker.push_bulk(account.owned_lists.with_list_account(target_account).pluck(:id)) do |list_id|
[target_account.id, list_id, 'list']
end
private
def process_merges(account, target_account)
MergeWorker.perform_async(target_account.id, account.id, 'home')
MergeWorker.push_bulk(mergeable_list_ids(account, target_account)) do |list_id|
[target_account.id, list_id, 'list']
end
end
def mergeable_list_ids(account, target_account)
account
.owned_lists
.with_list_account(target_account)
.pluck(:id)
end
end