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

View file

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