|
|
@ -76,38 +76,55 @@ class RoomController extends AbstractController |
|
|
|
// Get room feed |
|
|
|
// Get room feed |
|
|
|
$feed = []; |
|
|
|
$feed = []; |
|
|
|
|
|
|
|
|
|
|
|
foreach ((array) $client->kevaFilter($request->get('namespace')) as $post) |
|
|
|
// Get pending paradise |
|
|
|
|
|
|
|
foreach ((array) $client->kevaPending() as $pending) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Skip values with meta keys |
|
|
|
// Ignore pending posts from other rooms |
|
|
|
if (false !== stripos($post['key'], '_KEVA_')) |
|
|
|
if ($pending['namespace'] !== $request->get('namespace')) |
|
|
|
{ |
|
|
|
{ |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Set identicon if not anonymous user |
|
|
|
// Ignore everything in pending queue but keva_put nodes |
|
|
|
if ($post['key'] === '@anonymous') |
|
|
|
if ($pending['op'] !== 'keva_put') |
|
|
|
{ |
|
|
|
{ |
|
|
|
$icon = false; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
// Skip values with meta keys |
|
|
|
|
|
|
|
if (false !== stripos($pending['key'], '_KEVA_')) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$identicon = new \Jdenticon\Identicon(); |
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
$identicon->setValue( |
|
|
|
|
|
|
|
$post['key'] |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$identicon->setSize(12); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$identicon->setStyle( |
|
|
|
// Get more info |
|
|
|
|
|
|
|
if ($transaction = $client->getRawTransaction($pending['txid'])) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$feed[] = |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'pending' => true, |
|
|
|
|
|
|
|
'key' => $pending['key'], |
|
|
|
|
|
|
|
'value' => $pending['value'], |
|
|
|
|
|
|
|
'txid' => $pending['txid'], |
|
|
|
|
|
|
|
'transaction' => |
|
|
|
[ |
|
|
|
[ |
|
|
|
'backgroundColor' => 'rgba(255, 255, 255, 0)', |
|
|
|
'time' => date('c', $transaction['time']), |
|
|
|
'padding' => 0 |
|
|
|
'timestamp' => $transaction['time'], |
|
|
|
] |
|
|
|
'confirmations' => $transaction['confirmations'], |
|
|
|
); |
|
|
|
], |
|
|
|
|
|
|
|
'icon' => $this->_identicon($pending['key']), |
|
|
|
|
|
|
|
'sort' => 0//$transaction['time'] // sort order field |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$icon = $identicon->getImageDataUri('webp'); |
|
|
|
// Get regular posts |
|
|
|
|
|
|
|
foreach ((array) $client->kevaFilter($request->get('namespace')) as $post) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Skip values with meta keys |
|
|
|
|
|
|
|
if (false !== stripos($post['key'], '_KEVA_')) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get more info |
|
|
|
// Get more info |
|
|
@ -115,18 +132,19 @@ class RoomController extends AbstractController |
|
|
|
{ |
|
|
|
{ |
|
|
|
$feed[] = |
|
|
|
$feed[] = |
|
|
|
[ |
|
|
|
[ |
|
|
|
# 'key' => $post['key'], |
|
|
|
'pending' => false, |
|
|
|
'value' => $post['value'], |
|
|
|
'key' => $post['key'], |
|
|
|
'height' => $post['height'], |
|
|
|
'value' => $post['value'], |
|
|
|
# 'vout' => $post['vout'], |
|
|
|
'height' => $post['height'], |
|
|
|
'txid' => $post['txid'], |
|
|
|
# 'vout' => $post['vout'], |
|
|
|
|
|
|
|
'txid' => $post['txid'], |
|
|
|
'transaction' => |
|
|
|
'transaction' => |
|
|
|
[ |
|
|
|
[ |
|
|
|
'time' => date('c', $transaction['time']), |
|
|
|
'time' => date('c', $transaction['time']), |
|
|
|
'timestamp' => $transaction['time'], |
|
|
|
'timestamp' => $transaction['time'], |
|
|
|
'confirmations' => $transaction['confirmations'], |
|
|
|
'confirmations' => $transaction['confirmations'], |
|
|
|
], |
|
|
|
], |
|
|
|
'icon' => $icon, |
|
|
|
'icon' => $this->_identicon($post['key']), |
|
|
|
'sort' => $transaction['time'] // sort order field |
|
|
|
'sort' => $transaction['time'] // sort order field |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
@ -371,4 +389,30 @@ class RoomController extends AbstractController |
|
|
|
] |
|
|
|
] |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private function _identicon(string $key) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if ($key === 'anonymous') |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$identicon = new \Jdenticon\Identicon(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$identicon->setValue($key); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$identicon->setSize(12); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$identicon->setStyle( |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'backgroundColor' => 'rgba(255, 255, 255, 0)', |
|
|
|
|
|
|
|
'padding' => 0 |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $identicon->getImageDataUri('webp'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |