fedimbed.bluesky: fix quotes with external media

This commit is contained in:
Cynthia Foxwell 2025-03-14 19:52:52 -06:00
parent ac11f3a46b
commit 232a0f0115
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -48,6 +48,7 @@ const PLATFORM_COLORS = {
pixelfed: 0x10c5f8,
//cohost: 0x83254f,
bluesky: 0x0085ff,
twitter: 0xff6c60, // Nitter accent color
};
const BSKY_DOMAINS = [
@ -475,6 +476,17 @@ async function bluesky(msg, url, spoiler = false) {
videos.push({url: videoUrl, desc: post.embed.alt, type: contentType});
embeds.push({...mainEmbed, fields: [{name: "\u200b", value: `[Video Link](${videoUrl})`}]});
} else if (post.embed.media.$type === "app.bsky.embed.external#view") {
if (post.embed.external.uri.includes("tenor.com")) {
const url = new URL(post.embed.external.uri);
url.searchParams.delete("hh");
url.searchParams.delete("ww");
embeds.push({...mainEmbed, image: {url: url.toString()}});
} else {
embeds.push(mainEmbed);
}
} else {
embeds.push(mainEmbed);
}
const quoteData = await blueskyQuoteEmbed(post.embed.record.record);