Merge pull request #970 from AustinKelsay/bugfix-crosspost-link-context

Add context field to crossposted link if present
This commit is contained in:
Keyan 2024-03-25 17:25:22 -05:00 committed by GitHub
commit 59b0027ad0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -24,10 +24,17 @@ async function discussionToEvent (item) {
async function linkToEvent (item) { async function linkToEvent (item) {
const createdAt = Math.floor(Date.now() / 1000) 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 { return {
created_at: createdAt, created_at: createdAt,
kind: 1, kind: 1,
content: `${item.title} \n ${item.url}`, content: contentField,
tags: [] tags: []
} }
} }