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:
@@ -330,12 +330,17 @@ class BlueskyBridge extends BridgeAbstract
|
||||
}
|
||||
|
||||
//reply
|
||||
if ($replyContext && isset($post['reply']) && !isset($post['reply']['parent']['notFound'])) {
|
||||
if ($replyContext && isset($post['reply']) && isset($post['reply']['parent'])) {
|
||||
$replyPost = $post['reply']['parent'];
|
||||
$replyPostRecord = $replyPost['record'];
|
||||
$description .= '<hr/>';
|
||||
$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'];
|
||||
$replyPostAuthorHandle = $replyPost['author']['handle'] !== 'handle.invalid' ? '<i>@' . $replyPost['author']['handle'] . '</i> ' : '';
|
||||
$replyPostDisplayName = $replyPost['author']['displayName'] ?? '';
|
||||
@@ -483,6 +488,7 @@ class BlueskyBridge extends BridgeAbstract
|
||||
$description .= '</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$item['content'] = $description;
|
||||
$this->items[] = $item;
|
||||
@@ -496,7 +502,7 @@ class BlueskyBridge extends BridgeAbstract
|
||||
$videoMime = $video['mimeType'];
|
||||
$thumbnail = "poster=\"https://video.bsky.app/watch/$authorDID/$videoCID/thumbnail.jpg\"" ?? '';
|
||||
$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)
|
||||
|
Reference in New Issue
Block a user