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

fix post cache stuff

Changed files
+3 -3
lib
+2 -2
lib/bskyToucher.php
···
'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorInfo) : [],
'cursor' => $cursor
];
-
\updatePostCache($rkey, $did, $ret->content, $ret->embedType, json_encode($ret->embeds), $post->value->createdAt);
return $ret;
}
···
$authorData = $this->getUserInfo($post->author->did, 'did');
$facets = property_exists($post->record, 'facets') ? $this->sanitizeFacets($post->record->facets) : [];
$processedText = $this->applyFacets($post->record->text, $facets);
-
$embedType = property_exists($post->record, 'embed') ? $post->record->embed->{'$type'} : null;
$embeds = property_exists($post->record, 'embed') ? $this->sanitizeEmbeds($post->record->embed, $authorData) : [];
$interactions = $this->getInteractions($post->uri, $getReplies);
$replies = $interactions->replies;
···
'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorInfo) : [],
'cursor' => $cursor
];
+
\updatePostCache($rkey, $did, $ret->content, $ret->embedType ? $ret->embedType : '', json_encode($ret->embeds), $post->value->createdAt);
return $ret;
}
···
$authorData = $this->getUserInfo($post->author->did, 'did');
$facets = property_exists($post->record, 'facets') ? $this->sanitizeFacets($post->record->facets) : [];
$processedText = $this->applyFacets($post->record->text, $facets);
+
$embedType = property_exists($post->record, 'embed') ? $post->record->embed->{'$type'} : '';
$embeds = property_exists($post->record, 'embed') ? $this->sanitizeEmbeds($post->record->embed, $authorData) : [];
$interactions = $this->getInteractions($post->uri, $getReplies);
$replies = $interactions->replies;
+1 -1
lib/maria-db.php
···
$db->close();
}
-
function updatePostCache(string $rkey, string $did, string $text, ?string $embedType, ?string $embedData, string $createdAt): void {
$db = mysqli_init();
$db->real_connect(DB_HOST, DB_USERNAME, DB_PASS);
$db->real_query('use '.DB_NAME.';');
···
$db->close();
}
+
function updatePostCache(string $rkey, string $did, string $text, string $embedType, string $embedData, string $createdAt): void {
$db = mysqli_init();
$db->real_connect(DB_HOST, DB_USERNAME, DB_PASS);
$db->real_query('use '.DB_NAME.';');