Bluesky: Fetch quoted post for "uid=0"

This commit is contained in:
Michael 2024-11-24 09:11:25 +00:00
parent 6a2c0d974e
commit 32f66c5738

View file

@ -1060,7 +1060,6 @@ function bluesky_process_reason(stdClass $reason, string $uri, int $uid)
'wall' => false, 'wall' => false,
'uri' => $reason->by->did . '/app.bsky.feed.repost/' . $reason->indexedAt, 'uri' => $reason->by->did . '/app.bsky.feed.repost/' . $reason->indexedAt,
'private' => Item::UNLISTED, 'private' => Item::UNLISTED,
'verb' => Activity::POST,
'contact-id' => $contact['id'], 'contact-id' => $contact['id'],
'author-name' => $contact['name'], 'author-name' => $contact['name'],
'author-link' => $contact['url'], 'author-link' => $contact['url'],
@ -1485,7 +1484,12 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le
break; break;
} }
} }
$uri = bluesky_fetch_missing_post($uri, $item['uid'], $fetch_uid, Item::PR_FETCHED, $item['contact-id'], $level, $last_poll); $fetched_uri = bluesky_fetch_post($uri, $item['uid']);
if (!$fetched_uri) {
$uri = bluesky_fetch_missing_post($uri, 0, $fetch_uid, Item::PR_FETCHED, $item['contact-id'], $level, $last_poll);
} else {
$uri = $fetched_uri;
}
if ($uri) { if ($uri) {
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => [$item['uid'], 0]]); $shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => [$item['uid'], 0]]);
$uri_id = $shared['uri-id'] ?? 0; $uri_id = $shared['uri-id'] ?? 0;