Remove author info from thread posts; keep it in quoted posts
All checks were successful
CI / test (push) Successful in 54s
All checks were successful
CI / test (push) Successful in 54s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -246,19 +246,13 @@ final class BlueskyThreadsExtension extends Minz_Extension {
|
|||||||
$record = $post['record'] ?? [];
|
$record = $post['record'] ?? [];
|
||||||
$embed = $post['embed'] ?? null;
|
$embed = $post['embed'] ?? null;
|
||||||
|
|
||||||
$handle = $author['handle'] ?? '';
|
$handle = $author['handle'] ?? '';
|
||||||
$displayName = $author['displayName'] ?? $handle;
|
$text = $record['text'] ?? '';
|
||||||
$avatar = $author['avatar'] ?? '';
|
$facets = $record['facets'] ?? [];
|
||||||
$text = $record['text'] ?? '';
|
|
||||||
$facets = $record['facets'] ?? [];
|
|
||||||
|
|
||||||
$rkey = basename(rtrim($post['uri'] ?? '', '/'));
|
$rkey = basename(rtrim($post['uri'] ?? '', '/'));
|
||||||
$postUrl = 'https://bsky.app/profile/' . rawurlencode($handle) . '/post/' . $rkey;
|
$postUrl = 'https://bsky.app/profile/' . rawurlencode($handle) . '/post/' . $rkey;
|
||||||
|
|
||||||
$avatarHtml = $avatar !== ''
|
|
||||||
? '<img src="' . $this->e($avatar) . '" alt="" style="width:40px;height:40px;border-radius:50%;flex-shrink:0;">'
|
|
||||||
: '<span style="width:40px;height:40px;border-radius:50%;background:#ccc;display:inline-block;flex-shrink:0;"></span>';
|
|
||||||
|
|
||||||
$textHtml = nl2br($this->applyFacets($text, $facets));
|
$textHtml = nl2br($this->applyFacets($text, $facets));
|
||||||
$embedHtml = $embed !== null ? $this->renderEmbed($embed) : '';
|
$embedHtml = $embed !== null ? $this->renderEmbed($embed) : '';
|
||||||
|
|
||||||
@@ -280,15 +274,6 @@ final class BlueskyThreadsExtension extends Minz_Extension {
|
|||||||
|
|
||||||
return <<<HTML
|
return <<<HTML
|
||||||
<div class="bsky-post" style="{$style}">
|
<div class="bsky-post" style="{$style}">
|
||||||
<div style="display:flex;align-items:flex-start;gap:10px;margin-bottom:8px;">
|
|
||||||
<a href="https://bsky.app/profile/{$this->e($handle)}" style="text-decoration:none;">{$avatarHtml}</a>
|
|
||||||
<div>
|
|
||||||
<a href="https://bsky.app/profile/{$this->e($handle)}" style="text-decoration:none;color:inherit;">
|
|
||||||
<strong>{$this->e($displayName)}</strong>
|
|
||||||
</a><br>
|
|
||||||
<span style="color:#536471;font-size:0.85em;">@{$this->e($handle)}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="bsky-text" style="margin-bottom:8px;white-space:pre-wrap;word-break:break-word;">{$textHtml}</div>
|
<div class="bsky-text" style="margin-bottom:8px;white-space:pre-wrap;word-break:break-word;">{$textHtml}</div>
|
||||||
{$embedHtml}
|
{$embedHtml}
|
||||||
<div style="margin-top:8px;font-size:0.8em;color:#536471;">
|
<div style="margin-top:8px;font-size:0.8em;color:#536471;">
|
||||||
|
|||||||
Reference in New Issue
Block a user