From efcd4fbe7b5beaf6c5acc708c90cc04c9ef1238e Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 19 Apr 2025 16:03:56 -0600 Subject: [PATCH] fedimbed: potentially better spacing between stats and timestamp --- src/modules/fedimbed.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index cfda105..938a627 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -443,7 +443,7 @@ async function blueskyQuoteEmbed(quote) { components: [ { type: 10, - content: `-# ${getStatsBluesky(quote)}\n${Icons.fedimbed.bluesky} Bluesky \u2022 `, }, @@ -682,7 +682,7 @@ async function bluesky(msg, url, spoiler = false) { components: [ { type: 10, - content: `-# ${getStatsBluesky(post)}\n${Icons.fedimbed.bluesky} Bluesky \u2022 `, }, @@ -1443,7 +1443,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote = components: [ { type: 10, - content: `${stats.length > 0 ? "-# " + stats + "\n" : ""}${ + content: `${stats.length > 0 ? "### -# " + stats + "\n" : ""}${ footerIcon ? footerIcon + " " : "" }${platformName} \u2022 `, }, @@ -1502,6 +1502,8 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote = container.components.push(footer); + const components = [cw.length > 0 && warningText, container]; + if (quoteRes) { const quoteComponents = quoteRes.response.components[0].components; const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`; @@ -1510,13 +1512,17 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote = } else { quoteComponents.splice(0, 0, {type: 10, content: quoteContext}); } - container.components.push({type: 14}, ...quoteComponents); + if (container.components.length + quoteComponents.length + 1 > 10) { + components.push(quoteComponents); + } else { + container.components.push({type: 14}, ...quoteComponents); + } } return { response: { flags: 1 << 15, - components: [cw.length > 0 && warningText, container].filter((x) => !!x), + components: components.filter((x) => !!x), allowedMentions: { repliedUser: false, },