+5
css/_partials/_post.scss
+5
css/_partials/_post.scss
+89
-35
index.php
+89
-35
index.php
······Flight::route('/u/@handle:[a-z0-9\.]+/@rkey:[a-z0-9]+', function (string $handle, string $rkey): void {·········-if (!preg_match('/^did:plc:([a-z0-9]+)$/', $_GET['user'], $_out)) Flight::json(["error" => "malformed user DID"]);-$latte->render('./templates/_partials/feedPosts.latte', array_merge(Flight::get('standardParams'), [+$latte->render('./templates/_partials/post.latte', array_merge(Flight::get('standardParams'), [-if (!preg_match('/^at:\/\/(did:plc:[a-z0-9]+)\/app.bsky.feed.generator\/([a-z0-9]+)$/', $_GET['feed'], $_out)) Flight::json(["error" => "malformed at-uri representing feed", "feed" => $_GET['feed']]);-$html = $latte->renderToString('./templates/_partials/feedPosts.latte', array_merge(Flight::get('standardParams'), [+$output = $latte->renderToString('./templates/_partials/interaction_list.latte', array_merge(Flight::get('standardParams'), [+$output = $latte->renderToString('./templates/_partials/interaction_list.latte', array_merge(Flight::get('standardParams'), [+$output = $latte->renderToString('./templates/_partials/feedPosts.latte', array_merge(Flight::get('standardParams'), [+$output = $latte->renderToString('./templates/_partials/interaction_list.latte', array_merge(Flight::get('standardParams'), [
+49
js/post.mjs
+49
js/post.mjs
···+const urlComponents = post.getAttribute('data-uri').split(/at:\/\/(did:plc:[a-z0-9]+)\/app\.bsky\.feed\.post\/([a-z0-9]+)/);···
+3
-88
lib/bskyToucher.php
+3
-88
lib/bskyToucher.php
···-preg_match('/at:\/\/(did:plc:[a-z0-9]+)\/app.bsky.feed.post\/([a-z0-9]+)/', $rec->post, $uriComponents);-preg_match('/at:\/\/(did:plc:[a-z0-9]+)\/app.bsky.feed.post\/([a-z0-9]+)/', $rec->post, $uriComponents);-preg_match('/at:\/\/(did:plc:[a-z0-9]+)\/app.bsky.feed.post\/([a-z0-9]+)/', $rec->post, $uriComponents);···-function getUserPosts(string $did, ?string $cursor = null, bool $auth = false, bool $newer = false): array|bool {+function getUserPosts(string $did, ?string $cursor = null, bool $auth = false, bool $newer = false): object|bool {······$facets = property_exists($post->value, 'facets') ? $this->sanitizeFacets($post->value->facets) : [];···'content' => property_exists($post->value, 'text') ? $this->applyFacets($post->value->text, $facets) : '','embedType' => property_exists($post->value, 'embed') ? $post->value->embed->{'$type'} : null,'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorInfo) : [],···$embedType = property_exists($post->record, 'embed') ? $post->record->embed->{'$type'} : '';$embeds = property_exists($post->record, 'embed') ? $this->sanitizeEmbeds($post->record->embed, $authorData) : [];\updatePostCache($rkeyMatch[2], $authorData->did, $processedText, $embedType, json_encode($embeds), $post->record->createdAt);·········
+17
-31
lib/maria-db.php
+17
-31
lib/maria-db.php
···$result = $db->query('select * from user_cache where '.$field.'="'.$db->real_escape_string($value).'";');···$result = $db->query('select * from minidoc_cache where '.$field.'="'.$db->real_escape_string($value).'";');···$result = $db->query('select * from post_cache where rkey="'.$db->real_escape_string($rkey).'";');···$result = $db->query('select * from plc_cache where did="'.$db->real_escape_string($did).'";');···$result = $db->query('select * from feed_cache where at_uri="'.$db->real_escape_string($at_uri).'";');···function updateUserCache(string $handle, string $did, ?string $display_name, string $pds, ?string $avatar, ?string $banner, string $description, ?string $pinned): void {$db->query('update user_cache set handle="'.$db->real_escape_string($handle).'", display_name="'.$db->real_escape_string($display_name).'", description="'.$db->real_escape_string($description).'", avatar="'.$db->real_escape_string($avatar).'", banner="'.$db->real_escape_string($banner).'", pds="'.$db->real_escape_string($pds).'", pinned_post="'.$db->real_escape_string($pinned).'", expires='.$expires.' where did="'.$db->real_escape_string($did).'";');···$db->query('update minidoc_cache set handle="'.$db->real_escape_string($handle).'", pds="'.$db->real_escape_string($pds).'", expires='.$expires.' where did="'.$db->real_escape_string($did).'";');···$db->query('update plc_cache set plcdoc="'.$db->real_escape_string($plcdoc).'", expires='.$expires.' where did="'.$db->real_escape_string($did).'";');···function updateFeedCache(string $atUri, string $title, ?string $description, ?string $avatar, string $creator_did): void {$db->query('update feed_cache set title="'.$db->real_escape_string($title).'", description="'.$db->real_escape_string($description).'", avatar="'.$db->real_escape_string($avatar).'", creator_did="'.$db->real_escape_string($creator_did).'", expires='.$expires.' where at_uri="'.$db->real_escape_string($atUri).'";');···function updatePostCache(string $rkey, string $did, string $text, string $embedType, string $embedData, string $createdAt): void {
+2
-2
templates/_partials/feedPosts.latte
+2
-2
templates/_partials/feedPosts.latte
···-<div class="noposts">There was an error retrieving posts. You can try refreshing the page, or otherwise filing a bug report.</div>
+5
templates/_partials/interaction_list.latte
+5
templates/_partials/interaction_list.latte
+27
-31
templates/_partials/post.latte
+27
-31
templates/_partials/post.latte
···-<a href="{$post->author->profileLink}"><img src="{$post->author->avatar}" alt="{$post->author->displayName}'s user icon" /></a>-<div class="displayName"><a href="{$post->author->profileLink}">{$post->author->displayName|noescape}</a></div>+<a href="{$post->author->profileLink}"><img src="{$post->author->avatar}" alt="{$post->author->displayName}'s user icon" /></a>+<div class="displayName"><a href="{$post->author->profileLink}">{$post->author->displayName|noescape}</a></div>+<button type="button" data-action="repost">repost (<span class="repost-count"></span>)</button>
+5
templates/_partials/post_shell.latte
+5
templates/_partials/post_shell.latte
+4
-33
templates/single.latte
+4
-33
templates/single.latte
···<button type="button" popovertarget="likes" class="btn-invis">See Likes</button> <button type="button" popovertarget="reposts" class="btn-invis">See Reposts</button> <button type="button" popovertarget="quotes" class="btn-invis">See Quotes</button>-{include '_partials/profile_mini.latte', displayName: $like->displayName, handle: $like->handle, did: $like->did, avatar: $like->avatar, profileLink: '/u/'.$like->handle}-{include '_partials/profile_mini.latte', displayName: $repost->displayName, handle: $repost->handle, did: $repost->did, avatar: $repost->avatar, profileLink: '/u/'.$repost->handle}