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,28 +343,34 @@ async function blueskyQuoteEmbed(quote) {
const components = []; const components = [];
const header = { const header = [
type: 9, {
components: [ type: 10,
{ content: "-# <:i:1308640087759654922> Quoted Post",
type: 10, },
content: `### <:i:1308640087759654922> Quoted Post\n## ${quote.author.displayName}\n[@${ {
quote.author.handle type: 9,
}](https://bsky.app/profile/${quote.author.did})\n${ components: [
quote.value.facets?.length ?? 0 > 0 {
? processBlueskyFacets(quote.value.text, quote.value.facets) type: 10,
: quote.value.text content: `## ${quote.author.displayName}\n-# [@${quote.author.handle}](https://bsky.app/profile/${
}`.trim(), quote.author.did
}, })\n${
], quote.value.facets?.length ?? 0 > 0
accessory: { ? processBlueskyFacets(quote.value.text, quote.value.facets)
type: 11, : quote.value.text
media: { }`,
url: quote.author.avatar, },
],
accessory: {
type: 11,
media: {
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,33 +626,39 @@ 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 = [
type: 9, context && {
components: [ type: 10,
{ content: context,
type: 10, },
content: `${context}\n## ${post.author.displayName}\n[@${post.author.handle}](https://bsky.app/profile/${ {
post.author.did type: 9,
})\n${ components: [
post.record.facets?.length ?? 0 > 0 {
? processBlueskyFacets(post.record.text, post.record.facets) type: 10,
: post.record.text content: `## ${post.author.displayName}\n-# [@${post.author.handle}](https://bsky.app/profile/${
}`.trim(), post.author.did
}, })\n${
], post.record.facets?.length ?? 0 > 0
accessory: { ? processBlueskyFacets(post.record.text, post.record.facets)
type: 11, : post.record.text
media: { }`,
url: post.author.avatar, },
],
accessory: {
type: 11,
media: {
url: post.author.avatar,
},
}, },
}, },
}; ].filter((x) => !!x);
container.components.push(header); container.components.push(...header);
const footer = { const footer = {
type: 9, type: 9,