Skip to content
Snippets Groups Projects
Commit 3622e800 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro
Browse files

(feat) add focused urn for comments

parent 0e93555d
No related branches found
No related tags found
1 merge request!363WIP: (feat) add additional data for push notifications
......@@ -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]) ?:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment