Commit 3622e800 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(feat) add focused urn for comments

1 merge request!363WIP: (feat) add additional data for push notifications
Pipeline #90222084 passed with stages
in 11 minutes and 19 seconds
......@@ -46,6 +46,7 @@ class Push implements Interfaces\NotificationExtensionInterface
$entity_type = 'object';
$child_guid = '';
$parent_guid = '';
$focusedUrn = '';
if (method_exists($entity, 'getGuid')) {
$entity_guid = $entity->getGuid();
......@@ -59,6 +60,14 @@ class Push implements Interfaces\NotificationExtensionInterface
$parent_guid = $entity->parent_guid;
}
if ($entity->type === 'comment') {
if (method_exists($entity, 'getUrn')) {
$focusedUrn = $entity->getUrn();
} elseif (isset($entity->urn)) {
$focusedUrn = $entity->urn;
}
}
if (isset($entity->entity_guid)) {
$child_guid = $entity->entity_guid;
}
......@@ -90,7 +99,8 @@ class Push implements Interfaces\NotificationExtensionInterface
'parent_guid' => $parent_guid,
'type' => $notification['params']['notification_view'],
'uri' => $notification['uri'],
'badge' => $notification['count']
'badge' => $notification['count'],
'focusedUrn' => $focusedUrn
];
$from_user = EntitiesFactory::build($notification['from'], [ 'cache' => true]) ?:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment