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

@@ -11,19 +11,9 @@ json.data do
json.notification_type notification.notification_type
json.push_message_title notification.push_message_title
# TODO: front end assumes primary actor to be conversation. should fix in future
if %w[
assigned_conversation_new_message
participating_conversation_new_message
conversation_mention
].include? notification.notification_type
json.primary_actor_type 'Conversation'
json.primary_actor_id notification.conversation.id
json.primary_actor notification.conversation.push_event_data
else
json.primary_actor_type notification.primary_actor_type
json.primary_actor_id notification.primary_actor_id
json.primary_actor notification.primary_actor.push_event_data
end
json.primary_actor_type notification.primary_actor_type
json.primary_actor_id notification.primary_actor_id
json.primary_actor notification.primary_actor.push_event_data
json.read_at notification.read_at
# Secondary actor could be nil for cases like system assigning conversation
json.secondary_actor notification.secondary_actor&.push_event_data