mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Clean up arg handling for notification worker (#37587)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user