Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • omadrid/engine
  • javanick/engine
  • minds/engine
  • joe59/engine
  • eiennohi/engine
  • edgebal/engine
  • msantang78/engine
  • maruthi-adithya/engine
  • duyquoc/engine
  • benhayward.ben/engine
  • rlperez/engine
  • priestd09/engine
  • dknunn/engine
  • ascenderking/engine
  • catastrop/engine
  • jim-toth/engine
  • project_connection/engine
  • manishoo/engine
  • murbo98/engine
  • namesty/engine
  • Moikapy/engine
  • bedriguler/engine
  • CodingNagger/engine
  • jun784/engine
  • alexgleason/engine
  • gigasim97/engine
  • auxchar/engine
  • pestixaba/engine
  • m994/engine
  • webprodev/minds_engine
  • fabiolalombardim/engine
  • zackwy/engine
  • linleyj7/engine
  • fiatjaf/minds-engine
  • ppitestsblishaokai/engine
  • VARUN-KUSH/engine
  • brainr386/engine
  • th2tran/engine
38 results
Show changes
Commits on Source (2)
......@@ -173,12 +173,10 @@ class notifications implements Interfaces\Api
/**
* Polyfill notifications to be readed by legacy clients
* @return array
*/
protected function polyfillResponse($notifications)
protected function polyfillResponse($notifications) : array
{
//if (!is_array($notifications)) {
// return $notifications;
// }
$return = [];
// Formatting for legacy notification handling in frontend
foreach ($notifications as $key => $entity) {
......@@ -202,15 +200,15 @@ class notifications implements Interfaces\Api
}
$notification = [
'guid' => $entity->getUUID(),
'uuid' => $entity->getUUID(),
'guid' => $entity->getUuid(),
'uuid' => $entity->getUuid(),
'description' => $data['description'],
'entityObj' => $entityObj ? $entityObj->export() : null,
'filter' => $entity->getType(),
'fromObj' => $fromObj ? $fromObj->export() : null,
'from_guid' => $entity->getFromGuid(),
'to' => $toObj ? $toObj->export() : null,
'guid' => $entity->getUUID(),
'guid' => $entity->getUuid(),
'notification_view' => $entity->getType(),
'params' => $data, // possibly some deeper polyfilling needed here,
'time_created' => $entity->getCreatedTimestamp(),
......
......@@ -5,6 +5,7 @@
namespace Minds\Core\Notification;
use Minds\Core\Data\Cassandra\Client;
use Minds\Core\Di\Di;
use Minds\Common\Repository\Response;
use Cassandra\Bigint;
......@@ -17,7 +18,7 @@ class CassandraRepository
{
const NOTIFICATION_TTL = ((60 * 60) * 24) * 30; // 30 days
/** @var $cql */
/** @var Client $cql */
private $cql;
public function __construct($cql = null, $urn = null)
......@@ -82,8 +83,8 @@ class CassandraRepository
foreach ($result as $row) {
$notification = new Notification();
$notification->setUuid($row['uuid']->uuid() ?: null)
->setToGuid($row['to_guid'] ? (int) $row['to_guid']->value(): null)
->setFromGuid($row['from_guid'] ? (int) $row['from_guid']->value(): null)
->setToGuid(isset($row['to_guid']) ? (int) $row['to_guid']->value() : null)
->setFromGuid(isset($row['from_guid']) ? (int) $row['from_guid']->value() : null)
->setEntityGuid((string) $row['entity_guid']) // REMOVE ONCE FULLY ON CASSANDRA
->setEntityUrn($row['entity_urn'])
->setCreatedTimestamp($row['created_timestamp'] ? $row['created_timestamp']->time() : null)
......