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