From 9d9ca95034d20a6dedd9b8417e62940845c4c846 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Fri, 18 Apr 2025 15:09:20 -0600 Subject: [PATCH] fedimbed.bluesky: inline post link into footer --- src/modules/fedimbed.js | 54 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index 89f193b..47100a4 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -416,8 +416,21 @@ async function blueskyQuoteEmbed(quote) { } const footer = { - type: 10, - content: `${getStatsBluesky(quote)}\n`, + type: 9, + components: [ + { + type: 10, + content: `${getStatsBluesky(quote)}\n<:i:1362895346690424832> Bluesky \u2022 `, + }, + ], + accessory: { + type: 2, + style: 5, + label: "View Post", + url: `https://bsky.app/profile/${quote.author.did}/post/${quote.uri.substring(quote.uri.lastIndexOf("/") + 1)}`, + }, }; if (images.length > 0) { @@ -434,11 +447,7 @@ async function blueskyQuoteEmbed(quote) { } components.push(footer); - const url = `https://bsky.app/profile/${quote.author.did}/post/${quote.uri.substring( - quote.uri.lastIndexOf("/") + 1 - )}`; - - return {components, url, adult, hidden, spoiler, tags}; + return {components, adult, hidden, spoiler, tags}; } async function bluesky(msg, url, spoiler = false) { @@ -640,8 +649,21 @@ async function bluesky(msg, url, spoiler = false) { container.components.push(header); const footer = { - type: 10, - content: `${getStatsBluesky(post)}\n`, + type: 9, + components: [ + { + type: 10, + content: `${getStatsBluesky(post)}\n<:i:1362895346690424832> Bluesky \u2022 `, + }, + ], + accessory: { + type: 2, + style: 5, + label: "View Post", + url, + }, }; if (images.length > 0) { @@ -662,20 +684,6 @@ async function bluesky(msg, url, spoiler = false) { if (quoteData) container.components.push({type: 14}, ...quoteData.components); - const buttons = { - type: 1, - components: [ - { - type: 2, - style: 5, - label: "Post", - url, - }, - ], - }; - if (quoteData?.url) buttons.components.push({type: 2, style: 5, label: "Quoted Post", url: quoteData.url}); - container.components.push(buttons); - return { response: { flags: 1 << 15,