Clean up arg handling for notification worker (#37587)

This commit is contained in:
Claire
2026-01-27 16:59:51 +01:00
committed by GitHub
parent 48c102aabe
commit a20519d671

View File

@@ -3,14 +3,9 @@
class LocalNotificationWorker
include Sidekiq::Worker
def perform(receiver_account_id, activity_id = nil, activity_class_name = nil, type = nil, options = {})
if activity_id.nil? && activity_class_name.nil?
activity = Mention.find(receiver_account_id)
receiver = activity.account
else
receiver = Account.find(receiver_account_id)
activity = activity_class_name.constantize.find(activity_id)
end
def perform(receiver_account_id, activity_id, activity_class_name, type = nil, options = {})
receiver = Account.find(receiver_account_id)
activity = activity_class_name.constantize.find(activity_id)
# For most notification types, only one notification should exist, and the older one is
# preferred. For updates, such as when a status is edited, the new notification