Merge pull request #970 from AustinKelsay/bugfix-crosspost-link-context
Add context field to crossposted link if present
This commit is contained in:
commit
59b0027ad0
|
@ -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: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue