diff --git a/bridges/BlueskyBridge.php b/bridges/BlueskyBridge.php index 89e5f3bc..67bb5af9 100644 --- a/bridges/BlueskyBridge.php +++ b/bridges/BlueskyBridge.php @@ -255,6 +255,10 @@ class BlueskyBridge extends BridgeAbstract $description .= 'Quoted post detached.'; } elseif (isset($quotedRecord['blocked']) && $quotedRecord['blocked']) { //blocked by quote author $description .= 'Author of quoted post has blocked OP.'; + } elseif (($quotedRecord['$type'] ?? '') === 'app.bsky.feed.defs#generatorView') { + $description .= '
'; + $description .= $this->getGeneratorViewDescription($quotedRecord); + $description .= ''; } else { $quotedAuthorDid = $quotedRecord['author']['did']; $quotedDisplayName = $quotedRecord['author']['displayName'] ?? ''; @@ -399,6 +403,10 @@ class BlueskyBridge extends BridgeAbstract $description .= 'Quoted post detached.'; } elseif (isset($replyQuotedRecord['blocked']) && $replyQuotedRecord['blocked']) { //blocked by quote author $description .= 'Author of quoted post has blocked OP.'; + } elseif (($replyQuotedRecord['$type'] ?? '') === 'app.bsky.feed.defs#generatorView') { + $description .= '
'; + $description .= $this->getGeneratorViewDescription($replyQuotedRecord); + $description .= '';
} else {
$quotedAuthorDid = $replyQuotedRecord['author']['did'];
$quotedDisplayName = $replyQuotedRecord['author']['displayName'] ?? '';
@@ -584,4 +592,29 @@ class BlueskyBridge extends BridgeAbstract
$response = json_decode(getContents($uri), true);
return $response;
}
+
+ private function getGeneratorViewDescription(array $record): string
+ {
+ $avatar = e($record['avatar']);
+ $displayName = e($record['displayName']);
+ $displayHandle = e($record['creator']['handle']);
+ $likeCount = e($record['likeCount']);
+ preg_match('/\/([^\/]+)$/', $record['uri'], $matches);
+ $uri = e('https://bsky.app/profile/' . $record['creator']['did'] . '/feed/' . $matches[1]);
+
+ return <<
+
{$displayName}
+ Feed by @{$displayHandle}
+