fedimbed.bluesky: more styling tweaks

This commit is contained in:
Cynthia Foxwell 2025-04-18 15:22:35 -06:00
parent 5961eced1f
commit ec151a9e18
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -343,18 +343,23 @@ async function blueskyQuoteEmbed(quote) {
const components = []; const components = [];
const header = { const header = [
{
type: 10,
content: "-# <:i:1308640087759654922> Quoted Post",
},
{
type: 9, type: 9,
components: [ components: [
{ {
type: 10, type: 10,
content: `### <:i:1308640087759654922> Quoted Post\n## ${quote.author.displayName}\n[@${ content: `## ${quote.author.displayName}\n-# [@${quote.author.handle}](https://bsky.app/profile/${
quote.author.handle quote.author.did
}](https://bsky.app/profile/${quote.author.did})\n${ })\n${
quote.value.facets?.length ?? 0 > 0 quote.value.facets?.length ?? 0 > 0
? processBlueskyFacets(quote.value.text, quote.value.facets) ? processBlueskyFacets(quote.value.text, quote.value.facets)
: quote.value.text : quote.value.text
}`.trim(), }`,
}, },
], ],
accessory: { accessory: {
@ -363,8 +368,9 @@ async function blueskyQuoteEmbed(quote) {
url: quote.author.avatar, url: quote.author.avatar,
}, },
}, },
}; },
components.push(header); ];
components.push(...header);
if (quote.embeds?.[0]) { if (quote.embeds?.[0]) {
const embed = quote.embeds[0]; const embed = quote.embeds[0];
@ -620,23 +626,28 @@ async function bluesky(msg, url, spoiler = false) {
let context = ""; let context = "";
if (data.thread.parent) { if (data.thread.parent) {
const reply = data.thread.parent.post; const reply = data.thread.parent.post;
context = `### <:i:1308640078825787412> Replying to: [${reply.author.displayName} (@${ context = `-# <:i:1308640078825787412> Replying to: [${reply.author.displayName} (@${
reply.author.handle reply.author.handle
})](https://bsky.app/profile/${reply.author.did}/post/${reply.uri.substring(reply.uri.lastIndexOf("/") + 1)})`; })](https://bsky.app/profile/${reply.author.did}/post/${reply.uri.substring(reply.uri.lastIndexOf("/") + 1)})`;
} }
const header = { const header = [
context && {
type: 10,
content: context,
},
{
type: 9, type: 9,
components: [ components: [
{ {
type: 10, type: 10,
content: `${context}\n## ${post.author.displayName}\n[@${post.author.handle}](https://bsky.app/profile/${ content: `## ${post.author.displayName}\n-# [@${post.author.handle}](https://bsky.app/profile/${
post.author.did post.author.did
})\n${ })\n${
post.record.facets?.length ?? 0 > 0 post.record.facets?.length ?? 0 > 0
? processBlueskyFacets(post.record.text, post.record.facets) ? processBlueskyFacets(post.record.text, post.record.facets)
: post.record.text : post.record.text
}`.trim(), }`,
}, },
], ],
accessory: { accessory: {
@ -645,8 +656,9 @@ async function bluesky(msg, url, spoiler = false) {
url: post.author.avatar, url: post.author.avatar,
}, },
}, },
}; },
container.components.push(header); ].filter((x) => !!x);
container.components.push(...header);
const footer = { const footer = {
type: 9, type: 9,