diff --git a/src/app.ts b/src/app.ts index da1b982..a1e0b77 100644 --- a/src/app.ts +++ b/src/app.ts @@ -296,21 +296,16 @@ async function forwardToSubscribers( try { if (sourceChannel.linkMode) { - // NOTE: Slack unfurls only on raw URLs, not `` mrkdwn links. - // So we include the raw permalink in the forwarded footer-style message. - const footerOnly = forwardLink - ? `📰 Forwarded from <#${msg.channelId}|${sourceChannel.name}> — ${forwardLink}` - : `📰 Forwarded from <#${msg.channelId}|${sourceChannel.name}>`; + // Keep the raw permalink in the top-level text so Slack generates its unfurl. await slack.chat.postMessage({ channel: sub.subscriberChannelId, username: postUsername, icon_url: postIcon, unfurl_links: true, unfurl_media: true, - text: footerOnly, + text: forwardLink || footerText, blocks: [ - { type: "section", text: { type: "mrkdwn", text: footerOnly } }, - { type: "context", elements: contextElements }, + { type: "section", text: { type: "mrkdwn", text: footerText } }, ], } as any); continue; @@ -1097,12 +1092,6 @@ app.post("/interactions", async (c) => { const savedMsg = { slackTs: messageTs, channelId, userId: msg.user || "", userName, text: msg.text || "", timestamp: slackTsToTime(messageTs).toISOString(), metadata }; if (ch) await fireWebhook(ch, savedMsg); if (ch) await forwardToSubscribers(savedMsg, ch, store, slack); - - await slack.chat.postMessage({ - channel: channelId, - thread_ts: messageTs, - text: "✅ Message backfilled and added to the feed!", - }); } catch (err: any) { console.error("backfill shortcut error:", err.message); await slack.chat.postMessage({ channel: channelId, text: `❌ Error backfilling message: ${err.message}` }); diff --git a/src/web/app.tsx b/src/web/app.tsx index 01b6b5a..74d4511 100644 --- a/src/web/app.tsx +++ b/src/web/app.tsx @@ -71,6 +71,7 @@ function ChannelNode({ data }: { data: any }) {
access: {accessLabel(data.approvedPosters)}
{posters.length > 0 &&
approved: {posters.join(", ")}
} {data.createdAt &&
created: {fmtDate(data.createdAt)}
} + {data.linkMode &&
link mode: {data.linkMode ? "yes" : "no"}
} {schema && (
metadata schema