fedimbed: move timestamp next to username in minimal

This commit is contained in:
Cynthia Foxwell 2025-05-07 20:22:39 -06:00
parent cafe25d614
commit 71829a58ac
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -381,7 +381,9 @@ async function blueskyQuoteEmbed(quote, minimal = false) {
? [ ? [
{ {
type: 10, type: 10,
content: `### ${Icons.fedimbed.quote} [${quote.author.displayName} (@${quote.author.handle})](${quoteUrl})\n${content}`, content: `### ${Icons.fedimbed.quote} [${quote.author.displayName} (@${
quote.author.handle
})](${quoteUrl}) \u2022 <t:${Math.floor(new Date(quote.value.createdAt).getTime() / 1000)}:F>\n${content}`,
}, },
] ]
: [ : [
@ -456,12 +458,7 @@ async function blueskyQuoteEmbed(quote, minimal = false) {
} }
} }
const footer = minimal const footer = {
? {
type: 10,
content: `<t:${Math.floor(new Date(quote.value.createdAt).getTime() / 1000)}:F>`,
}
: {
type: 9, type: 9,
components: [ components: [
{ {
@ -491,7 +488,7 @@ async function blueskyQuoteEmbed(quote, minimal = false) {
items: [video], items: [video],
}); });
} }
components.push(footer); if (!minimal) components.push(footer);
return {components, adult, hidden, spoiler, tags}; return {components, adult, hidden, spoiler, tags};
} }
@ -680,7 +677,9 @@ async function bluesky(msg, url, spoiler = false, minimal = false) {
const contentComponent = { const contentComponent = {
type: 10, type: 10,
content: minimal content: minimal
? `### [${post.author.displayName} (@${post.author.handle})](${url})\n${content}` ? `### [${post.author.displayName} (@${post.author.handle})](${url}) \u2022 <t:${Math.floor(
new Date(post.record.createdAt).getTime() / 1000
)}:F>\n${content}`
: `## ${post.author.displayName}\n-# [@${post.author.handle}](https://bsky.app/profile/${post.author.did})\n${content}`, : `## ${post.author.displayName}\n-# [@${post.author.handle}](https://bsky.app/profile/${post.author.did})\n${content}`,
}; };
@ -704,12 +703,7 @@ async function bluesky(msg, url, spoiler = false, minimal = false) {
].filter((x) => !!x); ].filter((x) => !!x);
container.components.push(...header); container.components.push(...header);
const footer = minimal const footer = {
? {
type: 10,
content: `<t:${Math.floor(new Date(post.record.createdAt).getTime() / 1000)}:F>`,
}
: {
type: 9, type: 9,
components: [ components: [
{ {
@ -739,7 +733,7 @@ async function bluesky(msg, url, spoiler = false, minimal = false) {
items: [video], items: [video],
}); });
} }
container.components.push(footer); if (!minimal) container.components.push(footer);
if (quoteOnly && !hasQuote) return {}; if (quoteOnly && !hasQuote) return {};
@ -1410,7 +1404,9 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
}; };
let headerContent = minimal let headerContent = minimal
? `### [${author.name ? `${author.name} (${author.handle})` : author.handle}](${realUrl})` ? `### [${author.name ? `${author.name} (${author.handle})` : author.handle}](${realUrl}) \u2022 <t:${Math.floor(
new Date(timestamp).getTime() / 1000
)}:F>`
: `${author.name ? `## ${author.name}\n` : ""}-# [${author.handle}](${author.url})`; : `${author.name ? `## ${author.name}\n` : ""}-# [${author.handle}](${author.url})`;
if (title) headerContent += minimal ? "\n**__" + title + "__**" : "\n### " + title; if (title) headerContent += minimal ? "\n**__" + title + "__**" : "\n### " + title;
@ -1478,14 +1474,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
} }
const footerIcon = PLATFORM_ICONS[platformName.toLowerCase()]; const footerIcon = PLATFORM_ICONS[platformName.toLowerCase()];
const footer = minimal const footer = {
? {
type: 10,
content: `${platformName === "Twitter" ? "" : platformName + " "}<t:${Math.floor(
new Date(timestamp).getTime() / 1000
)}:F>`,
}
: {
type: 9, type: 9,
components: [ components: [
{ {
@ -1557,7 +1546,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
); );
} }
container.components.push(footer); if (!minimal) container.components.push(footer);
const components = [cw.length > 0 && warningText, container]; const components = [cw.length > 0 && warningText, container];