use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
+use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
'$type' => 'app.bsky.embed.external',
'external' => [
'uri' => $msg['url'],
- 'title' => $msg['title'],
- 'description' => $msg['description'],
+ 'title' => $msg['title'] ?? '',
+ 'description' => $msg['description'] ?? '',
]
];
if (!empty($msg['image'])) {
$uri = bluesky_get_uri($embed->record);
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => $item['uid']]);
if (empty($shared)) {
+ if (empty($embed->record->value)) {
+ Logger::info('Record has got no value', ['record' => $embed->record]);
+ break;
+ }
$shared = bluesky_get_header($embed->record, $uri, 0, $fetch_uid);
$shared = bluesky_get_content($shared, $embed->record->value, $uri, $item['uid'], $level);
if (!empty($shared)) {
function bluesky_get_uri(stdClass $post): string
{
+ if (empty($post->cid)) {
+ Logger::info('Invalid URI', ['post' => $post, 'callstack' => System::callstack(10, 0, true)]);
+ return '';
+ }
return $post->uri . ':' . $post->cid;
}