From a9506c45320b14ee814e2be1146fcfd73188ada1 Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Mon, 25 Mar 2024 17:16:45 -0500 Subject: [PATCH] Add context field to crossposted link if present --- components/use-crossposter.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/use-crossposter.js b/components/use-crossposter.js index 56f23a1f..22a74ea7 100644 --- a/components/use-crossposter.js +++ b/components/use-crossposter.js @@ -24,10 +24,17 @@ async function discussionToEvent (item) { async function linkToEvent (item) { const createdAt = Math.floor(Date.now() / 1000) + let contentField + if (item.text) { + contentField = `${item.title}\n${item.url}\n\n${item.text}` + } else { + contentField = `${item.title}\n${item.url}` + } + return { created_at: createdAt, kind: 1, - content: `${item.title} \n ${item.url}`, + content: contentField, tags: [] } }