friendship ended with social-app. php is my new best friend

more fiddling with post behavior

Changed files
+1 -11
js
lib
+1 -2
js/post.mjs
···
document.addEventListener('click', (e) => {
if (e.target.closest('.post .postSharing a')) {
e.preventDefault();
-
console.log(e);
const link = e.target.closest('.post .postSharing a');
const url = link.getAttribute('data-share');
navigator.clipboard.writeText(url);
···
window.addEventListener('load', (_e) => {
document.querySelectorAll('[data-status="unloaded"]').forEach(async (post) => {
-
loadPost(post, true);
+
loadPost(post, document.querySelector("main").classList.contains("post"));
});
});
-9
lib/bskyToucher.php
···
return $this->sanitizePublicApiPost($post, false);
}
-
function getInteractions(string $uri, bool $getReplies = true): object {
-
return (object) [
-
'replies' => $getReplies ? $this->getReplies($uri) : (object) ['count' => -1, 'records' => []],
-
'reposts' => $this->getReposts($uri),
-
'likes' => $this->getLikes($uri),
-
'quotes' => $getReplies ? $this->getQuotes($uri) : (object) ['count' => -1, 'records' => []]
-
];
-
}
-
function sanitizeSlingshotRecordPost(object $post, ?string $cursor = null, $getReplies = true):object|bool {
preg_match('/at:\/\/(did:plc:[a-z0-9]+)\/[a-zA-Z\.]+\/([a-z0-9]+)/', $post->uri, $uriComponents);
if (!$uriComponents) return false;