···
preg_match('/at:\/\/(did:plc:[a-z0-9]+)\/app.bsky.feed.post\/([a-z0-9]+)/', $feed->post, $uriComponents);
$did = $uriComponents[1];
$rkey = $uriComponents[2];
239
-
return async(fn() => $this->getPost($did, $rkey, true));
239
+
return $this->getPost($did, $rkey, true);
···
function getReplyRecords(string $post):array {
423
-
$ret = $this->getConstellationLinkData($post, "app.bsky.feed.post", ".reply.root.uri");
423
+
/*$ret = $this->getConstellationLinkData($post, "app.bsky.feed.post", ".reply.root.uri");
425
-
return await(all(array_map(function ($rec) {
426
-
return async(fn() => $this->sanitizePost($this->getSlingshotData($rec->did, $rec->collection, $rec->rkey, ['reverse' => true]), true));
427
-
}, $ret->linking_records)));
425
+
return array_map(function ($rec) {
426
+
$slingshotRecord = $this->getSlingshotData($rec->did, $rec->collection, $rec->rkey, ['reverse' => true]);
427
+
return $this->sanitizePost($slingshotRecord, true);
428
+
}, $ret->linking_records);
···
$uriComponents = $this->splitAtUri($p->uri);
$cache = \requestPostCache($uriComponents->rkey);
if ($cache) return $this->sanitizeCachedPost($cache);
445
-
return async(fn() => $this->getPost($uriComponents->did, $uriComponents->rkey, true));
446
+
$post = $this->getPost($uriComponents->did, $uriComponents->rkey, true);
}, $postData->records)));
···
$rkey = $uriComponents[2];
$authorInfo = $this->getUserInfo($did, 'did');
$facets = property_exists($post->value, 'facets') ? $this->sanitizeFacets($post->value->facets) : [];
545
-
$waitingFor = await(all([
546
-
'authorInfo' => async(fn() => $this->getUserInfo($did, 'did')),
547
-
'replyCount' => async(fn() => $this->getReplies($post->uri)),
548
-
'repostCount' => async(fn() => $this->getReposts($post->uri)),
549
-
'likeCount' => async(fn() => $this->getLikes($post->uri)),
550
-
'quoteCount' => async(fn() => $this->getQuotes($post->uri))
554
-
'displayName' => $waitingFor['authorInfo']->displayName,
555
-
'handle' => $waitingFor['authorInfo']->handle,
556
-
'avatar' => $waitingFor['authorInfo']->avatar,
549
+
'displayName' => $authorInfo->displayName,
550
+
'handle' => $authorInfo->handle,
551
+
'avatar' => $authorInfo->avatar,
558
-
'profileLink' => '/u/'.$waitingFor['authorInfo']->handle,
553
+
'profileLink' => '/u/'.$authorInfo->handle,
'pds' => $authorInfo->pds,
'postLink' => '/u/'.$authorInfo->handle.'/'.$rkey,
'content' => property_exists($post->value, 'text') ? $this->applyFacets($post->value->text, $facets) : '',
565
-
'replyCount' => $waitingFor['replyCount'],
566
-
'repostCount' => $waitingFor['repostCount'],
567
-
'likeCount' => $waitingFor['likeCount'],
568
-
'quoteCount' => $waitingFor['quoteCount'],
560
+
'replyCount' => $this->getReplies($post->uri),
561
+
'repostCount' => $this->getReposts($post->uri),
562
+
'likeCount' => $this->getLikes($post->uri),
563
+
'quoteCount' => $this->getQuotes($post->uri),
'createdAt' => $post->value->createdAt,
'embedType' => property_exists($post->value, 'embed') ? $post->value->embed->{'$type'} : null,
'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorInfo) : [],