chore: Change primary actor to Conversation for all the notification types. (#8435)

This commit is contained in:
Muhsin Keloth
2023-12-06 10:43:09 +05:30
committed by GitHub
parent 17faa6c3b2
commit 76711d95ff
12 changed files with 91 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
class NotificationBuilder
pattr_initialize [:notification_type!, :user!, :account!, :primary_actor!]
pattr_initialize [:notification_type!, :user!, :account!, :primary_actor!, :secondary_actor]
def perform
return unless user_subscribed_to_notification?
@@ -9,7 +9,7 @@ class NotificationBuilder
private
def secondary_actor
def current_user
Current.user
end
@@ -29,7 +29,8 @@ class NotificationBuilder
notification_type: notification_type,
account: account,
primary_actor: primary_actor,
secondary_actor: secondary_actor
# secondary_actor is secondary_actor if present, else current_user
secondary_actor: secondary_actor || current_user
)
end
end