fedimbed: fix another gts moment (emotes not being array)

This commit is contained in:
Cynthia Foxwell 2023-12-28 13:34:11 -07:00
parent a7c17c195b
commit 79cf9b9be7
1 changed files with 6 additions and 2 deletions

View File

@ -408,10 +408,14 @@ async function processUrl(msg, url, spoiler = false) {
cw = postData.summary;
timestamp = postData.published;
if (postData.tag)
emotes = postData.tag
if (postData.tag) {
let tag = postData.tag;
// gts moment
if (!Array.isArray(tag)) tag = [tag];
emotes = tag
.filter((x) => !!x.icon)
.map((x) => ({name: x.name, url: x.icon.url}));
}
// NB: gts doesnt send singular attachments as areay
const attachments = Array.isArray(postData.attachment)