Clean up arg handling for notification worker (#37587)
This commit is contained in:
parent
48c102aabe
commit
a20519d671
@ -3,14 +3,9 @@
|
|||||||
class LocalNotificationWorker
|
class LocalNotificationWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
def perform(receiver_account_id, activity_id = nil, activity_class_name = nil, type = nil, options = {})
|
def perform(receiver_account_id, activity_id, activity_class_name, type = nil, options = {})
|
||||||
if activity_id.nil? && activity_class_name.nil?
|
receiver = Account.find(receiver_account_id)
|
||||||
activity = Mention.find(receiver_account_id)
|
activity = activity_class_name.constantize.find(activity_id)
|
||||||
receiver = activity.account
|
|
||||||
else
|
|
||||||
receiver = Account.find(receiver_account_id)
|
|
||||||
activity = activity_class_name.constantize.find(activity_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
# For most notification types, only one notification should exist, and the older one is
|
# 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
|
# preferred. For updates, such as when a status is edited, the new notification
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user