From cf435277a78139312e557a13466c95b4d3764b10 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 9 Jul 2023 13:38:06 +0000 Subject: [PATCH] Bluesky: Fix for quoted posts with media --- bluesky/bluesky.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index d96766d7..3e3e2aaf 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -1150,16 +1150,12 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le $shared = bluesky_get_header($embed->record->record, $uri, 0, $fetch_uid); $shared = bluesky_get_content($shared, $embed->record->record->value, $uri, $item['uid'], $level); if (!empty($shared)) { - if (!empty($embed->record->embeds)) { + if (!empty($embed->record->record->embeds)) { foreach ($embed->record->record->embeds as $single) { $shared = bluesky_add_media($single, $shared, $fetch_uid, $level); } } - if (!empty($embed->media)) { - bluesky_add_media($embed->media, $item, $fetch_uid, $level); - } - $id = Item::insert($shared); $shared = Post::selectFirst(['uri-id'], ['id' => $id]); } @@ -1167,6 +1163,10 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le if (!empty($shared)) { $item['quote-uri-id'] = $shared['uri-id']; } + + if (!empty($embed->media)) { + bluesky_add_media($embed->media, $item, $fetch_uid, $level); + } break; default: -- 2.39.5