1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-04 23:57:29 +02:00

[BlueskyBridge] Fix cases for missing reply post context and QoL fix for video loading (#4635)

* added fix for missing reply post context

* qol fix - no preload on videos
This commit is contained in:
mruac
2025-08-04 08:20:12 +09:30
committed by GitHub
parent e241f3dcde
commit c65fbd5543

View File

@@ -330,12 +330,17 @@ class BlueskyBridge extends BridgeAbstract
} }
//reply //reply
if ($replyContext && isset($post['reply']) && !isset($post['reply']['parent']['notFound'])) { if ($replyContext && isset($post['reply']) && isset($post['reply']['parent'])) {
$replyPost = $post['reply']['parent']; $replyPost = $post['reply']['parent'];
$replyPostRecord = $replyPost['record'];
$description .= '<hr/>'; $description .= '<hr/>';
$description .= '<p>'; $description .= '<p>';
if (isset($replyPost['notFound']) && $replyPost['notFound']) { //deleted post
$description .= 'Replied to post was deleted.';
} elseif (isset($replyPost['blocked']) && $replyPost['blocked']) { //blocked by quote author
$description .= 'Author of replied to post has blocked OP.';
} else {
$replyPostRecord = $replyPost['record'];
$replyPostAuthorDID = $replyPost['author']['did']; $replyPostAuthorDID = $replyPost['author']['did'];
$replyPostAuthorHandle = $replyPost['author']['handle'] !== 'handle.invalid' ? '<i>@' . $replyPost['author']['handle'] . '</i> ' : ''; $replyPostAuthorHandle = $replyPost['author']['handle'] !== 'handle.invalid' ? '<i>@' . $replyPost['author']['handle'] . '</i> ' : '';
$replyPostDisplayName = $replyPost['author']['displayName'] ?? ''; $replyPostDisplayName = $replyPost['author']['displayName'] ?? '';
@@ -483,6 +488,7 @@ class BlueskyBridge extends BridgeAbstract
$description .= '</p>'; $description .= '</p>';
} }
} }
}
$item['content'] = $description; $item['content'] = $description;
$this->items[] = $item; $this->items[] = $item;
@@ -496,7 +502,7 @@ class BlueskyBridge extends BridgeAbstract
$videoMime = $video['mimeType']; $videoMime = $video['mimeType'];
$thumbnail = "poster=\"https://video.bsky.app/watch/$authorDID/$videoCID/thumbnail.jpg\"" ?? ''; $thumbnail = "poster=\"https://video.bsky.app/watch/$authorDID/$videoCID/thumbnail.jpg\"" ?? '';
$videoURL = "https://bsky.social/xrpc/com.atproto.sync.getBlob?did=$authorDID&cid=$videoCID"; $videoURL = "https://bsky.social/xrpc/com.atproto.sync.getBlob?did=$authorDID&cid=$videoCID";
return "<figure><video loop $thumbnail controls src=\"$videoURL\" type=\"$videoMime\"/></figure>"; return "<figure><video loop $thumbnail preload=\"none\" controls src=\"$videoURL\" type=\"$videoMime\"/></figure>";
} }
private function getPostImageDescription(array $image) private function getPostImageDescription(array $image)