fedimbed: missed a null check, fix timestamp

This commit is contained in:
Cynthia Foxwell 2022-12-31 13:12:26 -07:00
parent 735aa308f8
commit a216e5b4fb

View file

@ -198,7 +198,7 @@ async function processUrl(msg, url) {
author = { author = {
name: postData2.account?.display_name ?? postData2.user?.name, name: postData2.account?.display_name ?? postData2.user?.name,
handle: handle:
postData2.account.fqn ?? postData2.account?.fqn ??
`${postData2.account?.username ?? postData2.user?.username}@${ `${postData2.account?.username ?? postData2.user?.username}@${
urlObj.hostname urlObj.hostname
}`, }`,
@ -209,7 +209,7 @@ async function processUrl(msg, url) {
}`, }`,
avatar: postData2.account?.avatar ?? postData2.user?.avatarUrl, avatar: postData2.account?.avatar ?? postData2.user?.avatarUrl,
}; };
timestamp = postData2.created_at; timestamp = postData2.created_at ?? postData2.createdAt;
const attachments = postData2.media_attachments ?? postData2.files; const attachments = postData2.media_attachments ?? postData2.files;
if (attachments) { if (attachments) {
for (const attachment of attachments) { for (const attachment of attachments) {